Repository navigation
Use explicit git revs in Cargo.toml - #67
Merged
Merged
Conversation
Cargo can find a version of tlvc and tlvc-text without trouble when
hubtools is used as a direct dep:
```
james@duster ~/src/jmpesp [] [] $ cargo init hubtools-dep
Creating binary (application) package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
james@duster ~/src/jmpesp [] [] $ cd hubtools-dep/
james@duster ~/src/jmpesp/hubtools-dep [] [] $ echo 'hubtools = { git = "https://github.com/oxidecomputer/hubtools" }' >> Cargo.toml
james@duster ~/src/jmpesp/hubtools-dep [] [] $ cat Cargo.toml
[package]
name = "hubtools-dep"
version = "0.1.0"
edition = "2024"
[dependencies]
hubtools = { git = "https://github.com/oxidecomputer/hubtools" }
james@duster ~/src/jmpesp/hubtools-dep [] [] $ cargo build
Updating git repository `https://github.com/oxidecomputer/hubtools`
Updating crates.io index
Updating git repository `https://github.com/oxidecomputer/lpc55_support`
Updating git repository `https://github.com/oxidecomputer/tlvc`
Locking 130 packages to latest Rust 1.98.0 compatible versions
Adding generic-array v0.14.7 (available: v0.14.9)
Downloaded path-slash v0.2.1
...snip...
Compiling ron v0.8.1
Compiling pkcs1 v0.7.5
Compiling lpc55_areas v0.2.5 (https://github.com/oxidecomputer/lpc55_support#fc64732f)
Compiling ppv-lite86 v0.2.21
Compiling tlvc v0.4.1 (https://github.com/oxidecomputer/tlvc#7a96eab9)
Compiling tlvc-text v0.4.0 (https://github.com/oxidecomputer/tlvc#7a96eab9)
Compiling rand_chacha v0.3.1
Compiling rand v0.8.8
Compiling rsa v0.9.10
Compiling lpc55_sign v0.3.5 (https://github.com/oxidecomputer/lpc55_support#fc64732f)
Compiling hubtools v0.4.9 (https://github.com/oxidecomputer/hubtools#5ea53d26)
Compiling hubtools-dep v0.1.0 (/home/james/src/jmpesp/hubtools-dep)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 21.32s
```
But not as an indirect dep, such as when sled-agent is used as a direct
dep. The error seen there is:
```
error: failed to select a version for the requirement `tlvc = "^0.3"`
candidate versions found which didn't match: 0.4.1
location searched: Git repository https://github.com/oxidecomputer/tlvc
required by package `hubtools v0.4.7 (https://github.com/oxidecomputer/hubtools.git?rev=2b1ef9b38d75563ea800baa3b17327eec17b1b7a#2b1ef9b3)`
... which satisfies git dependency `hubtools` of package `sp-sim v0.1.0 (/home/james/src/oxidecomputer/omicron4/sp-sim)`
... which satisfies path dependency `sp-sim` of package `omicron-sled-agent v0.1.0 (/home/james/src/oxidecomputer/omicron4/sled-agent)`
... which satisfies path dependency `omicron-sled-agent` of package `sled-config v0.1.0 (/home/james/src/jmpesp/sled-config)`
```
The assumption is that this is because the most current commit in the
`tlvc` repo uses version 0.4.1 while the Cargo.toml present here
requests version 0.3, and cargo's rules about what versions can satisfy
certain requests are somehow different for direct and indirect deps.
Even when hubtools is a direct dep the version of these git deps that
gets pulled in doesn't match what is requested in the Cargo.toml. Solve
both this and the indirect dep problem by changing `version =` to `rev
=` for both the tlvc and lpc55_support dependencies to pin what's
actually being pulled in. Also while we're here, update those revs to
the latest version in those repos.
labbott
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cargo can find a version of tlvc and tlvc-text without trouble when hubtools is used as a direct dep:
But not as an indirect dep, such as when sled-agent is used as a direct dep. The error seen there is:
The assumption is that this is because the most current commit in the
tlvcrepo uses version 0.4.1 while the Cargo.toml present here requests version 0.3, and cargo's rules about what versions can satisfy certain requests are somehow different for direct and indirect deps.Even when hubtools is a direct dep the version of these git deps that gets pulled in doesn't match what is requested in the Cargo.toml. Solve both this and the indirect dep problem by changing
version =torev =for both the tlvc and lpc55_support dependencies to pin what's actually being pulled in. Also while we're here, update those revs to the latest version in those repos.