flowey: add explicit no_incremental flag for cargo builds#3054
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an explicit no_incremental configuration knob to Flowey’s common cargo-flag plumbing so pipelines (notably the local build-reproducible workflow) can opt out of incremental compilation for more reproducible outputs.
Changes:
- Introduce
no_incrementalinto shared pipeline/job params and propagate it intocfg_cargo_common_flags. - Apply
no_incrementalinrun_cargo_buildby settingCARGO_INCREMENTAL=0when requested. - Expose a
--no-incrementalCLI flag for local pipeline runs and wire it through affected pipelines.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| flowey/flowey_lib_hvlite/src/_jobs/cfg_common.rs | Adds no_incremental to shared job params and forwards it to common cargo flags. |
| flowey/flowey_lib_common/src/cfg_cargo_common_flags.rs | Extends common cargo flags with no_incremental and adds a setter request. |
| flowey/flowey_lib_common/src/run_cargo_build.rs | Consumes no_incremental and sets CARGO_INCREMENTAL=0 when enabled; removes prior local --target-dir behavior. |
| flowey/flowey_lib_common/src/run_cargo_clippy.rs | Updates flags destructuring to tolerate the new field. |
| flowey/flowey_lib_common/src/run_cargo_doc.rs | Updates flags destructuring to tolerate the new field. |
| flowey/flowey_hvlite/src/pipelines_shared/cfg_common_params.rs | Adds --no-incremental to local CLI args and sets no_incremental=true for cloud backends. |
| flowey/flowey_hvlite/src/pipelines/build_reproducible.rs | Forces local reproducible builds to use --locked and --no-incremental. |
| flowey/flowey_hvlite/src/pipelines/vmm_tests.rs | Plumbs no_incremental into common params (set to false). |
| flowey/flowey_hvlite/src/pipelines/restore_packages.rs | Plumbs no_incremental into common params (set to false). |
| flowey/flowey_hvlite/src/pipelines/custom_vmfirmwareigvm_dll.rs | Plumbs no_incremental into common params (set to false). |
| flowey/flowey_hvlite/src/pipelines/build_igvm.rs | Plumbs no_incremental into common params (set to false). |
| rt.sh.change_dir(cargo_work_dir); | ||
| let mut cmd = flowey::shell_cmd!(rt, "{argv0} {params...}"); | ||
| if !matches!(rt.backend(), FlowBackend::Local) { | ||
| // if running in CI, no need to waste time with incremental | ||
| // build artifacts | ||
| if no_incremental { | ||
| with_env.insert("CARGO_INCREMENTAL".to_owned(), "0".to_owned()); | ||
| } else { | ||
| // if build locally, use per-package target dirs | ||
| // to avoid rebuilding | ||
| // TODO: remove this once cargo's caching improves | ||
| cmd = cmd | ||
| .arg("--target-dir") | ||
| .arg(in_folder.join("target").join(&crate_name)); | ||
| } |
a18fad4 to
669ccdc
Compare
|
|
||
| let mut env = HashMap::new(); | ||
| if no_incremental { | ||
| env.insert("CARGO_INCREMENTAL".to_owned(), "0".to_owned()); |
There was a problem hiding this comment.
Where is this used? Also does incremental matter for doc/clippy runs?
There was a problem hiding this comment.
It shouldn't matter for docs, I think I did this to make it more consistent but I think a better thing to do here is just destructure it and ignore it. I'll push a change that does that. For clippy I think this was already plumbed so I'm keeping the same behavior there.
669ccdc to
cbbac83
Compare
There was a problem hiding this comment.
Pull request overview
Adds an explicit no_incremental configuration knob to Flowey’s shared cargo-flag plumbing so pipelines (notably reproducible builds) can deterministically control whether incremental compilation is disabled, instead of relying on backend/CI heuristics.
Changes:
- Introduce
no_incrementalin the common cfg (cfg_common) and cargo flags node (cfg_cargo_common_flags) and thread it through hvlite pipeline parameter wiring. - Update
cargo buildandcargo clippyFlowey nodes to setCARGO_INCREMENTAL=0only whenno_incrementalis requested. - Add a
--no-incrementalCLI flag for local runs and defaultno_incremental: truefor cloud params.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| flowey/flowey_lib_hvlite/src/_jobs/cfg_common.rs | Plumbs no_incremental from common job params into the shared cargo-flags node. |
| flowey/flowey_lib_common/src/cfg_cargo_common_flags.rs | Extends the shared Flags struct and request API with no_incremental. |
| flowey/flowey_lib_common/src/run_cargo_build.rs | Uses Flags.no_incremental to conditionally set CARGO_INCREMENTAL=0 during builds. |
| flowey/flowey_lib_common/src/run_cargo_clippy.rs | Uses Flags.no_incremental to conditionally set CARGO_INCREMENTAL=0 during clippy. |
| flowey/flowey_lib_common/src/run_cargo_doc.rs | Adjusts destructuring for the new flag (currently ignored). |
| flowey/flowey_hvlite/src/pipelines_shared/cfg_common_params.rs | Adds --no-incremental to local CLI args; sets no_incremental: true for cloud defaults. |
| flowey/flowey_hvlite/src/pipelines/build_reproducible.rs | Sets locked + no_incremental explicitly for the local reproducible build pipeline. |
| flowey/flowey_hvlite/src/pipelines/build_igvm.rs | Threads no_incremental into cfg_common params for this pipeline path. |
| flowey/flowey_hvlite/src/pipelines/vmm_tests.rs | Adds no_incremental field when constructing cfg_common params. |
| flowey/flowey_hvlite/src/pipelines/restore_packages.rs | Adds no_incremental field when constructing cfg_common params. |
| flowey/flowey_hvlite/src/pipelines/custom_vmfirmwareigvm_dll.rs | Adds no_incremental field when constructing cfg_common params. |
cbbac83 to
bf38951
Compare
bf38951 to
61b83bf
Compare
61b83bf to
edb104f
Compare
edb104f to
7acebbf
Compare
7acebbf to
f00251b
Compare
f00251b to
fcc5990
Compare
fcc5990 to
170dd7e
Compare
170dd7e to
ab8d588
Compare
…3054) Flowey needs the ability to set if the build is incremental or not so that the build-reproducible pipeline can set it and not have machine-dependent paths as part of its target directory outputs. This change makes that configuration explicit rather than just plumbing in the environment variable based on CI or not. This change is part of a few remaining changes needed to get OpenHCL building reproducibly across machines.
Flowey needs the ability to set if the build is incremental or not so that the build-reproducible pipeline can set it and not have machine-dependent paths as part of its target directory outputs. This change makes that configuration explicit rather than just plumbing in the environment variable based on CI or not.
This change is part of a few remaining changes needed to get OpenHCL building reproducibly across machines.