Use "fosskers/rs-versions" to determine the latest CRT and SDK versions. #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem with 17.4.1 manifest
xwin/src/lib.rs
Lines 342 to 350 in 5ece33c
The latest CRT version is obtained from a dependency of
Microsoft.VisualStudio.Product.BuildTools
package.A dependency with a CRT version is expected to begin with
Microsoft.VisualStudio.Component.VC.
and end with.x86.x64
.The latest version is determined by string ordering.
In the current
17.4.1
version of the manifest, there is a dependencyMicrosoft.VisualStudio.Component.VC.Modules.x86.x64
, so xwin determines that the latest CRT version isModules
.Executing
causes an error
xwin can't find
Microsoft.VC.{crt_version}.CRT.Headers.base
package in the manifest because{crt_version}
isModules
.Potential problem with string ordering
String ordering might fail on some version numbers,
e.g. if the dependencies are
the latest version will be determined as
15.9
.xwin/src/lib.rs
Lines 522 to 526 in 5ece33c
The latest SDK version is also determined by string ordering.
List of existing versions from currently available manifests
Might be useful to determine if changes from this pull request are needed.
Looks like recent "CRT version" is just a concatenation of
14.*
real CRT version and manifest version (which matches Visual Studio version) and they usually increase simultaneously.String ordering might work if there will be no major CRT version increase.
CRT versions
15.9.51
manifest (matchingMicrosoft.VisualStudio.Component.VC.Tools.*
)16.11.21
manifest (matchingMicrosoft.VisualStudio.Component.VC.*.x86.x64
)17.4.1
manifest (matchingMicrosoft.VisualStudio.Component.VC.*.x86.x64
)SDK versions (matching
Win10SDK_*
)15.9.51
manifest16.11.21
manifest17.4.1
manifestThe solution
Use versions crate to compare versions.
Real versions will take precedence over obvious non-versions because an alphanumeric is less than a numeric with rs-versions.
Why not other crates.
https://github.com/timvisee/version-compare.git
Only
PartialOrd
is implemented,.max()
doesn't work, need to write.max_by(|a, b| a.compare(b).ord().unwrap())
.https://github.com/dtolnay/semver.git
Expects exactly 3 numbers separated by dots.