build: watch FLOW_HEADS only when OXY_BUILD does not name the build (refs andymccall/oxygenflow#52) 141b1fb2ebe9
A CI job that sets OXY_BUILD then keeps a cached target fresh from one state to the next, instead of rerunning the build script and recompiling the crate on every push.
- Author
- Andy McCall @andymccall <[email protected]>
- When
- · 2026-10-13 16:07 UTC
- Signature
- ✔ signed by Andy McCall
- Hash
141b1fb2ebe91e4ebe083fbe919785bab6cd42ad4a597c3e06e879d5f738dde9- Depends on
- e293c90dca62
- Depended on by
- nothing yet
- In bookmarks
- carried-not-removed doctor-trust identical-sides keyless-tags main merge-remote-bookmark paths-for-resolutions-and-amend push-notes show-stat subrepo-pin-state
- In tags
- v0.10.0 v0.11.0 v0.4.4 v0.4.5 v0.4.6 v0.5.0 v0.5.1 v0.6.0 v0.7.0 v0.8.0 v0.9.0
- Edits
- 2 atoms, 0 tree operations, 1 file
Browse the tree at this change
modified build.rs +5 −1
| … | 2 unchanged lines |
||
| 3 | 3 | //! building, else "local build". |
|
| 4 | 4 | fn main() { |
|
| 5 | 5 | println!("cargo:rerun-if-env-changed=OXY_BUILD"); |
|
| 6 | - | println!("cargo:rerun-if-env-changed=FLOW_HEADS"); |
|
| 6 | + | // The heads name the build only when OXY_BUILD does not: a CI job that |
|
| 7 | + | // sets it stays fresh from one state to the next (oxygenflow#52). |
|
| 8 | + | if !std::env::var("OXY_BUILD").is_ok_and(|b| !b.trim().is_empty()) { |
|
| 9 | + | println!("cargo:rerun-if-env-changed=FLOW_HEADS"); |
|
| 10 | + | } |
|
| 7 | 11 | let build = std::env::var("OXY_BUILD") |
|
| 8 | 12 | .ok() |
|
| 9 | 13 | .map(|b| b.trim().to_string()) |
|
| … | 18 unchanged lines |