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

omicron-package: allow building specific packages and their dependencies #5799

Merged
merged 10 commits into from
Jun 24, 2024
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dev-tools/xtask/src/check_workspace_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@ pub fn run_cmd() -> Result<()> {
}
}

let mut seen_bins = BTreeSet::new();
for package in &workspace.packages {
if workspace.workspace_members.contains(&package.id) {
for target in &package.targets {
if target.is_bin() {
if !seen_bins.insert(&target.name) {
eprintln!(
"error: bin target {:?} seen multiple times",
target.name
Comment on lines +156 to +157
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dumb question, but when would this practically trigger? Mechanically, I understand that it's "a binary target exists in the set of all targets multiple times", but would this be like, multiple versions of one binary? How could that happen?

(Mostly asking for the sake of whoever sees this error in the wild - I'm also interested in whatever hint we could provide for "how to fix this").

Copy link
Contributor Author

@iliana iliana Jun 24, 2024

Choose a reason for hiding this comment

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

Two binaries with the same name in the workspace (e.g. some package has a binary named "schema-updater" along with the omicron-nexus package) — while self-reviewing the code I tested to see if Cargo dealt with that, and it... doesn't! (yet, at least.)

I can see how someone might do this accidentally, and if so it might get really hard to debug.

);
nerrors += 1;
}
}
}
}
}

eprintln!(
"check-workspace-deps: errors: {}, warnings: {}",
nerrors, nwarnings
Expand Down
2 changes: 0 additions & 2 deletions installinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ tokio-stream.workspace = true

[features]
image-standard = []
image-trampoline = []
rack-topology-single-sled = []
4 changes: 2 additions & 2 deletions package/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ workspace = true
[dependencies]
anyhow.workspace = true
camino.workspace = true
cargo_metadata.workspace = true
clap.workspace = true
futures.workspace = true
hex.workspace = true
illumos-utils.workspace = true
indicatif.workspace = true
omicron-workspace-hack.workspace = true
omicron-zone-package.workspace = true
petgraph.workspace = true
rayon.workspace = true
Expand All @@ -30,13 +32,11 @@ slog-bunyan.workspace = true
slog-term.workspace = true
smf.workspace = true
strum.workspace = true
swrite.workspace = true
tar.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = [ "full" ] }
toml.workspace = true
walkdir.workspace = true
omicron-workspace-hack.workspace = true

[dev-dependencies]
expectorate.workspace = true
Expand Down
Loading
Loading