From b341e4fc0497b60d4bd3422ec1e04fa5fe630429 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Sat, 22 Jun 2024 00:59:13 +0000 Subject: [PATCH 1/4] CARGO_INCREMENTAL=0 --- .github/buildomat/jobs/tuf-repo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/buildomat/jobs/tuf-repo.sh b/.github/buildomat/jobs/tuf-repo.sh index fbedf2ea7a..941f2bcfb1 100755 --- a/.github/buildomat/jobs/tuf-repo.sh +++ b/.github/buildomat/jobs/tuf-repo.sh @@ -58,6 +58,8 @@ rustc --version # runs without `--locked` and will update the lockfile. cargo tree --locked >/dev/null +export CARGO_INCREMENTAL=0 + ptime -m ./tools/install_builder_prerequisites.sh -yp source ./tools/include/force-git-over-https.sh From 70c57681f21b12f0f7d4e3e49bb225ab1c77af6a Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Tue, 25 Jun 2024 22:34:20 +0000 Subject: [PATCH 2/4] run omicron-package with `--only` --- dev-tools/releng/src/main.rs | 75 +++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/dev-tools/releng/src/main.rs b/dev-tools/releng/src/main.rs index 9f95344862..ec1785aa0a 100644 --- a/dev-tools/releng/src/main.rs +++ b/dev-tools/releng/src/main.rs @@ -460,20 +460,23 @@ async fn main() -> Result<()> { ) .after("omicron-package"); - // omicron-package package - jobs.push_command( - format!("{}-package", target), - Command::new(&omicron_package) - .args([ - "--target", - target.as_str(), - "--artifacts", - artifacts_path.as_str(), - "package", - ]) - .env_remove("CARGO_MANIFEST_DIR"), - ) - .after(format!("{}-target", target)); + // `omicron-package package`. We limit this only to the packages + // necessary to build the proto area; the rest of the zones are built in + // the "zone-package" job. + let mut command = Command::new(&omicron_package) + .args([ + "--target", + target.as_str(), + "--artifacts", + artifacts_path.as_str(), + "package", + ]) + .env_remove("CARGO_MANIFEST_DIR"); + for package in target.proto_package_names() { + command = command.arg("--only").arg(package); + } + jobs.push_command(format!("{}-package", target), command) + .after(format!("{}-target", target)); // omicron-package stamp stamp_packages!( @@ -541,11 +544,31 @@ async fn main() -> Result<()> { .after("helios-setup") .after(format!("{}-proto", target)); } - // Build the recovery target after we build the host target. Only one - // of these will build at a time since Cargo locks its target directory; - // since host-package and host-image both take longer than their recovery - // counterparts, this should be the fastest option to go first. + + // Build the recovery image packages after we build the host image packages. + // Only one of these will build at a time since Cargo locks its target + // directory; since host-package and host-image both take longer than their + // recovery counterparts, this should be the fastest option to go first. jobs.select("recovery-package").after("host-package"); + // After that, build the remainder of the zones. + let mut command = Command::new(&omicron_package) + .args([ + "--target", + Target::Host.as_str(), + "--artifacts", + Target::Host.artifacts_path(&args).as_str(), + "package", + ]) + .env_remove("CARGO_MANIFEST_DIR"); + for package in TUF_PACKAGES { + command = command.arg("--only").arg(package); + } + jobs.push_command("zone-package", command).after("recovery-package"); + stamp_packages!("zone-stamp", Target::Host, TUF_PACKAGES) + .after("zone-package") + .after("host-stamp") + .after("recovery-stamp"); + if args.host_dataset == args.recovery_dataset { // If the datasets are the same, we can't parallelize these. jobs.select("recovery-image").after("host-image"); @@ -559,19 +582,17 @@ async fn main() -> Result<()> { .after("host-proto"); jobs.select("host-image").after("host-profile"); - stamp_packages!("tuf-stamp", Target::Host, TUF_PACKAGES) - .after("host-stamp") - .after("recovery-stamp"); - - // Run `cargo xtask verify-libraries --release`. (This was formerly run in - // the build-and-test Buildomat job, but this fits better here where we've - // already built most of the binaries.) + // Run `cargo xtask verify-libraries --release`. This ends up building all + // the remaining binaries in the workspace that are not shipped. (This was + // formerly run in the build-and-test Buildomat job, but this fits better + // here where we've already built most of the binaries.) jobs.push_command( "verify-libraries", Command::new(&cargo).args(["xtask", "verify-libraries", "--release"]), ) .after("host-package") - .after("recovery-package"); + .after("recovery-package") + .after("zone-package"); for (name, base_url) in [ ("staging", "https://permslip-staging.corp.oxide.computer"), @@ -599,7 +620,7 @@ async fn main() -> Result<()> { args.extra_manifest, ), ) - .after("tuf-stamp") + .after("zone-stamp") .after("host-image") .after("recovery-image") .after("hubris-staging") From 8f841687b30ddf952e2d1b00368876ead4adf115 Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Fri, 28 Jun 2024 19:59:43 +0000 Subject: [PATCH 3/4] write a "we tried that, it was bad" comment --- nexus/tests/test_all.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nexus/tests/test_all.rs b/nexus/tests/test_all.rs index 80aaca96bc..63736bc3f1 100644 --- a/nexus/tests/test_all.rs +++ b/nexus/tests/test_all.rs @@ -5,9 +5,10 @@ //! Integration test driver //! //! All integration tests are driven from this top-level integration test so -//! that we only have to build one target and so that Cargo can run the tests -//! concurrently. (Currently, Cargo runs separate integration tests -//! sequentially.) +//! that we only have to build one target. This was originally done because +//! `cargo test` does not parallelize across targets. We continue to do this +//! because any targets depending on omicron-nexus as a library are very +//! expensive to link, and it is better to only have to do that once. #[macro_use] extern crate slog; From 8a2b4201c72581e4f16a94a4c759f1c910304cbf Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Fri, 22 Nov 2024 19:18:29 +0000 Subject: [PATCH 4/4] answer my own question with a comment --- dev-tools/xtask/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev-tools/xtask/src/main.rs b/dev-tools/xtask/src/main.rs index 2d359202de..23c6a381d3 100644 --- a/dev-tools/xtask/src/main.rs +++ b/dev-tools/xtask/src/main.rs @@ -142,6 +142,8 @@ fn main() -> Result<()> { Cmds::Openapi(external) => external.exec_bin("openapi-manager"), #[cfg(target_os = "illumos")] Cmds::Releng(external) => { + // Build releng with the release profile, as most of its deps will + // be built with `--release` by build tooling anyway. external.cargo_args(["--release"]).exec_bin("omicron-releng") } #[cfg(target_os = "illumos")]