Skip to content

Conversation

@nagilson
Copy link
Member

@nagilson nagilson commented Nov 4, 2025

resolves #51525,

  • VS uses the local appdata, VS versioned folder, sdk.txt file to determine whether or not to accept preview sdks

  • VS Release rejects preview SDKs by default which causes the msbuild sdk resolver to not find sdks, as msbuild respects the vs settings

  • This changes the vs settings to enable our internal SDKs to be found by msbuild when it's going under test.

  • Arcade doesn't fallback to the global VS if the vs requirements is missing, but it should, so changed this

  • Possible improvements: this PR assumes sdk.txt content ordering does not matter - based on VS src code this appears to be true but could change in the future

Also tried:

  • modifying global.json to enable preview sdks, which was not enough. some tests have a custom global.json and it seems to not take precedence

  • setting env vars such as msbuildsdks which did not take precedence over the vs setting.

@nagilson
Copy link
Member Author

nagilson commented Nov 6, 2025

I was working in another PR to test multiple options at once: #51591
Looks like I got it to work. The ❌ is there due to some mac SSL issues in the template engine. I'll clean up this PR.
Then I'll backport it. Then, I'll push a change to see if Arcade would accept a change for this.

nagilson added a commit to nagilson/sdk that referenced this pull request Nov 6, 2025
I edited the json wrong in dotnet#51558. If this is all that's needed, the fix can be simpler. I think this likely isn't the case since there are tests with a custom global.json file, but it's worth trying.
- VS uses the local appdata, VS versioned folder, sdk.txt file to determine whether or not to accept preview sdks

- VS Release rejects preview SDKs by default which causes the msbuild sdk resolver to not find sdks, as msbuild respects the vs settings

- This changes the vs settings to enable our internal SDKs to be found by msbuild when it's going under test.

- Possible improvements: this PR assumes sdk.txt content ordering does not matter - based on VS code this appears to be true but could change in the future

Also tried:
- modifying global.json to enable preview sdks, which was not enough. some tests have a  custom global.json and it seems to not take precedence

setting env vars such as msbuildsdks which did not take precedence over the vs setting

This commit is a condensed version of the work done in dotnet#51591 and dotnet#51598
@nagilson nagilson force-pushed the nagilson-vs-rejects-previews-903 branch from d111492 to 665cdcb Compare November 7, 2025 19:53
@nagilson nagilson enabled auto-merge November 7, 2025 19:54
@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

/backport to release/9.0.1xx

@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

/backport to release/8.0.3xx

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to release/9.0.1xx (link to workflow run)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

@nagilson backporting to release/8.0.3xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Set sdk.txt file to enable preview SDKs
Using index info to reconstruct a base tree...
M	build/RunTestsOnHelix.cmd
Falling back to patching base and 3-way merge...
Auto-merging build/RunTestsOnHelix.cmd
CONFLICT (content): Merge conflict in build/RunTestsOnHelix.cmd
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Set sdk.txt file to enable preview SDKs
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

@nagilson backporting to release/8.0.4xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Set sdk.txt file to enable preview SDKs
Using index info to reconstruct a base tree...
M	build/RunTestsOnHelix.cmd
Falling back to patching base and 3-way merge...
Auto-merging build/RunTestsOnHelix.cmd
CONFLICT (content): Merge conflict in build/RunTestsOnHelix.cmd
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Set sdk.txt file to enable preview SDKs
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

@nagilson backporting to release/8.0.1xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Set sdk.txt file to enable preview SDKs
Using index info to reconstruct a base tree...
M	build/RunTestsOnHelix.cmd
Falling back to patching base and 3-way merge...
Auto-merging build/RunTestsOnHelix.cmd
CONFLICT (content): Merge conflict in build/RunTestsOnHelix.cmd
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Set sdk.txt file to enable preview SDKs
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@nagilson nagilson requested a review from a team November 7, 2025 19:57
@nagilson nagilson merged commit 622f19c into dotnet:release/9.0.3xx Nov 7, 2025
26 of 29 checks passed
@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

/backport to release/9.0.1xx

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to release/9.0.1xx (link to workflow run)

Copilot AI added a commit that referenced this pull request Nov 7, 2025
Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Nov 7, 2025
Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

I suppose we might want to fix this for when vs 2026 goes into release

@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

/backport to release/10.0.1xx

@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

/backport to release/10.0.2xx

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to release/10.0.1xx (link to workflow run)

@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

/backport to main

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to release/10.0.2xx (link to workflow run)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Started backporting to main (link to workflow run)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

@nagilson backporting to release/10.0.1xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Set sdk.txt file to enable preview SDKs
Applying: Get global json tools vs by default when locating VS
Using index info to reconstruct a base tree...
M	eng/common/tools.ps1
Falling back to patching base and 3-way merge...
Auto-merging eng/common/tools.ps1
CONFLICT (content): Merge conflict in eng/common/tools.ps1
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Get global json tools vs by default when locating VS
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

@nagilson backporting to main failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Set sdk.txt file to enable preview SDKs
Applying: Get global json tools vs by default when locating VS
Using index info to reconstruct a base tree...
M	eng/common/tools.ps1
Falling back to patching base and 3-way merge...
Auto-merging eng/common/tools.ps1
CONFLICT (content): Merge conflict in eng/common/tools.ps1
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Get global json tools vs by default when locating VS
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

@nagilson backporting to release/10.0.2xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Set sdk.txt file to enable preview SDKs
Applying: Get global json tools vs by default when locating VS
Using index info to reconstruct a base tree...
M	eng/common/tools.ps1
Falling back to patching base and 3-way merge...
Auto-merging eng/common/tools.ps1
CONFLICT (content): Merge conflict in eng/common/tools.ps1
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Get global json tools vs by default when locating VS
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@nagilson
Copy link
Member Author

nagilson commented Nov 7, 2025

Actually, we've informed Arcade and they can fix all of the repos, so I think the urgency of pushing this to 10 / 11 is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants