Skip to content
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

fix finding toolchains when invoked by msbuild #1201

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

russelltg
Copy link
Contributor

As noted in #1189 (comment), when invoking msbuild from the commandline VisualStudioDir is not set. VSTEL_MSBuildProjectFullPath does seem to be set reliably, even if it's undocumented....

I'm open to alternative fixes here as well. It's possible that we should check that the value of it ends in .vcxproj as if it's a C# library or something it may not have the proper environment set (I'm rather unsure).

@NobodyXu
Copy link
Collaborator

NobodyXu commented Sep 6, 2024

cc @ChrisDenton could you take a look at this PR please?

@russelltg
Copy link
Contributor Author

Another note is that VSTEL_MSBuildProjectFullPath is also set by VS, so I suppose we could remove VisualStudioDir and just use VSTEL_MSBuildProjectFullPath instead

@ChrisDenton
Copy link
Member

Another note is that VSTEL_MSBuildProjectFullPath is also set by VS, so I suppose we could remove VisualStudioDir and just use VSTEL_MSBuildProjectFullPath instead

This would be my preference. I think this should be kept as simple as possible.

Though I wonder, is the VsInstallRoot property not exposed as an environment variable?

@russelltg
Copy link
Contributor Author

Doesn't seem like it. I dumped the env here #1189 (comment)

@ChrisDenton
Copy link
Member

Fair enough. So I'd agree using VSTEL_MSBuildProjectFullPath is the best option we have.

@NobodyXu NobodyXu merged commit e4a1a88 into rust-lang:main Sep 6, 2024
26 checks passed
@NobodyXu
Copy link
Collaborator

NobodyXu commented Sep 6, 2024

Thank you russelltg ChrisDenton !

@github-actions github-actions bot mentioned this pull request Sep 6, 2024
This pull request was closed.
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