Fix 562, Rust example 07: vendoring #563
Merged
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.
This PR resolves issue #562
For once, the affected Build file has been updated to use the vendored Tokio crate alias without a version number
so in case the vendoring script ever downloads a different version the build should still succeed as long as the newer
crate version remains API compatible.
Then, the root cause has been eliminated by pinning the crate dependency to an exact version so that
Bazel should download exactly the pinned version.
The issue was caused by a very unlucky version convention in crate.spec in which
'version = "1.43.0",'
does not actually pin the version. Instead, it sets a lower version bound akin to "no lower than this version",
which causes all sorts of problems. Instead, the correct form to pin a crate version is to use an equal sign prefix:
'version = "=1.43.0",
Complicating things further, the vendor script generates two aliases, one with a version and one without a version for each vendored crate.
As none of this is obvious let alone intuitive, I have updated the Readme to explain the intricate details
of the rules_rust vendoring behavior so that the reader can make an informed decision about vendoring, version pining,
and aliasing.
Housekeeping:
Bumped up Bazel version to latest 8.1.1 for all Rust examples via the .bazelversion file.