-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Update build script to append .slnx for some uses of the -vs flag
#122312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update build script to append .slnx for some uses of the -vs flag
#122312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the build script to support both .sln and .slnx solution file extensions when using the -vs flag. The change modernizes the logic by replacing exact string comparisons with regex patterns and updates the generated solution file paths from .sln to .slnx.
Key Changes
- Replaced case-insensitive equality checks (
-ieq) with regex patterns (-match) to accept multiple input formats:coreclr,coreclr.sln, orcoreclr.slnx - Updated the generated solution file paths from
CoreCLR.slntoCoreCLR.slnxandcorehost.slntocorehost.slnx - Applied the same changes to both coreclr and corehost solution handling logic
|
It is cmake generated project. We discussed earlier that we want to wait until minimum cmake version is revved to 4.2 which added .slnx support (#120823 is updating min version to 3.6). |
jkoritzinsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend rewording the comment as the Copilot review mentioned, but other than that LGTM
I think it's worth supporting .slnx as an option so people who use the newer CMake versions can use |
@jkoritzinsky, the way this change is proposed, we can't use it with old VS ( |
|
@am11 Would you prefer I change the condition to account for just |
|
@adamperlin, I meant to keep support for both extensions in this transition period: am11@3da5eba. Once the minimum CMake version requirement moves past 4.2, we can remove .sln fallback branches. |
|
@am11, you're right, I didn't notice that it would only resolve slnx now. @adamperlin can you set it up to resolve slnx or sln, whichever is present? (Preferring slnx if it both exist) |
Yes, I can definitely set it up to resolve that way! |
…d-script-solution-gen-fix
… options to support older CMAKE versions
|
@jkoritzinsky @am11 Can you take another look? I've updated this now to resolve to |
When running
.\build.cmd -vs coreclr.slnxfor example, the solution would not be found as a hardcoded.slnwas still being used. This also changes the logic to use a regex instead for the hardcoded cases which we recognized in the-vsargument.