Skip to content

Conversation

danielframpton
Copy link
Contributor

Currently, cc-rs always returns the latest version of the msvc tools it can find, including preview versions.

For scenarios (such as we have at Microsoft) where we want to ensure we are building with a specific version of the tools, this change makes it possible to request a specific version of the msvc tools even if a developer has other versions on their machine.

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, can we have some doc for the env var in find-msvc-tools, and in cc refer to find-msvc-tools for possible env var?

if let Some(version) = env_getter.get_env("VCToolsVersion") {
// Restrict the search to a specific msvc version; if it doesn't exist then
// our caller will fail to find the tool for this instance and move on.
return version.to_str().map(|s| s.to_string());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return version.to_str().map(|s| s.to_string());
return version.to_str().map(ToString::to_string)

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.

2 participants