diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 16b93bb6f25e2..c59f8d3aa8569 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -78,7 +78,6 @@ jobs: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SE_AVOID_STATS: true steps: - name: Checkout source tree uses: actions/checkout@v4 diff --git a/rust/BUILD.bazel b/rust/BUILD.bazel index f894dcf756b6a..f874f84aac8e5 100644 --- a/rust/BUILD.bazel +++ b/rust/BUILD.bazel @@ -91,6 +91,10 @@ rust_library( ["src/**/*.rs"], exclude = ["main.rs"], ), + crate_features = select({ + "//common:stamp": [], + "//conditions:default": ["avoid_stats"], + }), edition = "2024", visibility = ["//rust:__subpackages__"], deps = all_crate_deps(normal = True), diff --git a/rust/Cargo.Bazel.lock b/rust/Cargo.Bazel.lock index b073b75728ea7..115047354d34c 100644 --- a/rust/Cargo.Bazel.lock +++ b/rust/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "1516a316c77bba8f4f92ef0a103d79cb6171808128005d89cbe82ad22f081370", + "checksum": "15fc6f823e5b945ffdb6b09e450dca4b33a09988993f28301823b8da05d689fc", "crates": { "addr2line 0.25.1": { "name": "addr2line", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 96e50e2514129..ac7143b2efcd5 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -42,6 +42,9 @@ fs_extra = "1.3.0" [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.9", features = ["winver", "winnt", "sysinfoapi"] } +[features] +avoid_stats = [] + [dev-dependencies] assert_cmd = "2.0.17" is_executable = "1.0.5" diff --git a/rust/src/config.rs b/rust/src/config.rs index cff48ea7b6e78..93d28c4eea675 100644 --- a/rust/src/config.rs +++ b/rust/src/config.rs @@ -132,7 +132,7 @@ impl ManagerConfig { avoid_browser_download: BooleanKey("avoid-browser-download", false).get_value(), language_binding: StringKey(vec!["language-binding"], "").get_value(), selenium_version: StringKey(vec!["selenium-version"], "").get_value(), - avoid_stats: BooleanKey("avoid-stats", false).get_value(), + avoid_stats: BooleanKey("avoid-stats", cfg!(feature = "avoid_stats")).get_value(), skip_driver_in_path: BooleanKey("skip-driver-in-path", false).get_value(), skip_browser_in_path: BooleanKey("skip-browser-in-path", false).get_value(), }