From 19b0283410c824d31d2452c40db46fb02daa73d1 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 12 Nov 2024 11:57:00 +0100 Subject: [PATCH 1/3] Remove unnecessary setting of `RERUN_IS_PUBLISHING` --- .github/workflows/contrib_rerun_py.yml | 3 --- .github/workflows/reusable_build_and_upload_rerun_cli.yml | 3 --- scripts/ci/build_and_upload_wheels.py | 1 - 3 files changed, 7 deletions(-) diff --git a/.github/workflows/contrib_rerun_py.yml b/.github/workflows/contrib_rerun_py.yml index 920125dd2f70..ae7158256e91 100644 --- a/.github/workflows/contrib_rerun_py.yml +++ b/.github/workflows/contrib_rerun_py.yml @@ -57,9 +57,6 @@ jobs: environments: wheel-test-min - name: Build rerun-cli - env: - # this stops `re_web_viewer_server/build.rs` from running - RERUN_IS_PUBLISHING: true run: | pixi run rerun-build-native-and-web-release diff --git a/.github/workflows/reusable_build_and_upload_rerun_cli.yml b/.github/workflows/reusable_build_and_upload_rerun_cli.yml index 19921e6d3bbe..28eabeb3ef85 100644 --- a/.github/workflows/reusable_build_and_upload_rerun_cli.yml +++ b/.github/workflows/reusable_build_and_upload_rerun_cli.yml @@ -172,9 +172,6 @@ jobs: # This does not run in the pixi environment, doing so # causes it to select the wrong compiler on macos-arm64 - name: Build rerun-cli - env: - # this stops `re_web_viewer_server/build.rs` from running - RERUN_IS_PUBLISHING: true run: | pixi run cargo build \ --locked \ diff --git a/scripts/ci/build_and_upload_wheels.py b/scripts/ci/build_and_upload_wheels.py index 8d1fbf69b1b5..6e62fec57f0d 100755 --- a/scripts/ci/build_and_upload_wheels.py +++ b/scripts/ci/build_and_upload_wheels.py @@ -88,7 +88,6 @@ def build_and_upload(bucket: Bucket | None, mode: BuildMode, gcs_dir: str, targe f"--target {target} " f"{maturin_feature_flags} " f"--out {dist}", - env={**os.environ.copy(), "RERUN_IS_PUBLISHING": "yes"}, # stop `re_web_viewer` from building here ) pkg = os.listdir(dist)[0] From 7de0a7b5b6807da6bb9314cc93efdddb628c9b50 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 12 Nov 2024 11:57:17 +0100 Subject: [PATCH 2/3] Add clarifying comment to re_web_viewer_server/build.rs --- crates/viewer/re_web_viewer_server/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/viewer/re_web_viewer_server/build.rs b/crates/viewer/re_web_viewer_server/build.rs index f09de9100507..274472a4e8fc 100644 --- a/crates/viewer/re_web_viewer_server/build.rs +++ b/crates/viewer/re_web_viewer_server/build.rs @@ -1,3 +1,4 @@ fn main() { + // Once we bump to Rust 1.80+ this will tell the checker that this flag actually exists for releases. println!("cargo::rustc-check-cfg=cfg(disable_web_viewer_server)"); } From 03aaaeb634f20acefd1a1efbe1057d86ebd99d43 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 12 Nov 2024 11:58:20 +0100 Subject: [PATCH 3/3] Rename `RERUN_IS_PUBLISHING` to `RERUN_IS_PUBLISHING_CRATES` --- crates/build/re_build_tools/src/lib.rs | 6 +++--- scripts/ci/crates.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/build/re_build_tools/src/lib.rs b/crates/build/re_build_tools/src/lib.rs index 3bf2da9c7d08..f4f6050f24f1 100644 --- a/crates/build/re_build_tools/src/lib.rs +++ b/crates/build/re_build_tools/src/lib.rs @@ -93,9 +93,9 @@ impl Environment { pub fn detect() -> Self { let is_in_rerun_workspace = is_tracked_env_var_set("IS_IN_RERUN_WORKSPACE"); - if is_tracked_env_var_set("RERUN_IS_PUBLISHING") { - // "RERUN_IS_PUBLISHING" is set by `scripts/ci/crates.py` - eprintln!("Environment: env-var RERUN_IS_PUBLISHING is set"); + if is_tracked_env_var_set("RERUN_IS_PUBLISHING_CRATES") { + // "RERUN_IS_PUBLISHING_CRATES" is set by `scripts/ci/crates.py` + eprintln!("Environment: env-var RERUN_IS_PUBLISHING_CRATES is set"); Self::PublishingCrates } else if is_in_rerun_workspace && std::env::var("CI").is_ok() { // `CI` is an env-var set by GitHub actions. diff --git a/scripts/ci/crates.py b/scripts/ci/crates.py index e3e862339b50..da287ad0dd32 100755 --- a/scripts/ci/crates.py +++ b/scripts/ci/crates.py @@ -469,7 +469,7 @@ def publish_unpublished_crates_in_parallel(all_crates: dict[str, Crate], version # walk the dependency graph in parallel and publish each crate print(f"Publishing {len(unpublished_crates)} crates…") - env = {**os.environ.copy(), "RERUN_IS_PUBLISHING": "yes"} + env = {**os.environ.copy(), "RERUN_IS_PUBLISHING_CRATES": "yes"} DAG(dependency_graph).walk_parallel( lambda name: publish_crate(unpublished_crates[name], token, version, env), # noqa: E731 # 30 tokens per minute (burst limit in crates.io)