Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ build --@llvm//config:experimental_stub_libgcc_s=True
build --@rules_cc//cc/toolchains/args/archiver_flags:use_libtool_on_macos=False
build --@rules_rust//cargo/settings:experimental_symlink_execroot

# The hermetic LLVM toolchain correctly scopes `--unwindlib=none` to link
# actions only, but the clang++ driver still prints "argument unused during
# compilation: '--unwindlib=none'" on the exec-config ([for tool]) link steps
# where it is a no-op (process_wrapper, cargo_build_script_runner, the proc-
# macro crates, ...). It is doing its job everywhere it matters; silence the
# spurious driver warning. Unconditional (not scoped to a --config) so it also
# covers the sanitizer and Bazel-Native lanes, which activate the same @llvm
# clang via `--extra_toolchains` rather than --config=nl-toolchain.
build --linkopt=-Wno-unused-command-line-argument
build --host_linkopt=-Wno-unused-command-line-argument

# Don't use legacy repository rules.
build --incompatible_disable_native_repo_rules

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
run: >
nix develop --impure --command
bash -c "bazel-retry run \
--config=nl-quiet \
--lockfile_mode=error \
--verbose_failures \
@local-remote-execution//examples:${TOOLCHAIN}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/native-bazel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ jobs:
if [ "${{ matrix.bazel_version }}" == "8.7.0" ]; then
# Bazel 8 cannot parse the Bazel 9 MODULE.bazel.lock format.
./tools/bazel-retry.sh test //... \
--config=nl-quiet \
--lockfile_mode=off \
--extra_toolchains=@rust_toolchains//:all \
--verbose_failures
else
./tools/bazel-retry.sh test //... \
--config=nl-quiet \
--lockfile_mode=error \
--extra_toolchains=@rust_toolchains//:all \
--verbose_failures
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
nix develop --impure --command \
bazel-retry test //... \
--config=nl-toolchain \
--config=nl-quiet \
--verbose_failures \
--lockfile_mode=error \

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ jobs:
exec: ${{ runner.os == 'Linux' && 'on' || 'off' }}

- name: Run Bazel tests
run: bazel test --config=${{ matrix.sanitizer }} --lockfile_mode=error --verbose_failures //...
run: bazel test --config=${{ matrix.sanitizer }} --config=nl-quiet --lockfile_mode=error --verbose_failures //...
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module(
name = "nativelink",
version = "1.7.5",
compatibility_level = 0,
)

bazel_dep(name = "rules_cc", version = "0.2.22")
Expand Down
16 changes: 16 additions & 0 deletions ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,21 @@ common:nl-rbe --remote_download_toplevel
common:nl-rbe --remote_retries=8
common:nl-rbe --experimental_remote_cache_eviction_retries=5

# --- Log legibility (CI presentation only) ---
# Make CI logs scannable so a real warning or failure stands out instead of
# being buried under per-action progress and per-test success chatter. This
# group suppresses ONLY presentation noise; it never hides warnings, errors,
# or the compiler output that precedes them. On the full //... suite this turns
# a hundreds-of-lines log into tens (verified: the nativelink-store test suite
# goes from 56 log lines to 10). Opt-in via --config=nl-quiet so local
# interactive builds keep their live progress.
# - noshow_progress: drop the "[N / M] Compiling ..." progress stream.
# - show_result=0: don't list every built target's output path at the end.
common:nl-quiet --noshow_progress
common:nl-quiet --show_result=0
# - test_summary=terse: print a summary line only for tests that did NOT pass,
# instead of one "PASSED in 0.Ns" line per test.
test:nl-quiet --test_summary=terse

# Endpoints deliberately do not appear in this file: the setup action derives
# them from the claim-base repository secret at job time.
2 changes: 1 addition & 1 deletion nativelink-util/tests/connection_manager_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async fn aborted_caller_future_does_not_leak_permits() -> Result<(), Error> {
// task abort; bare `let _ = ...` would drop it immediately
// and defeat the test.
let _conn = cm.connection(format!("aborted-{i}")).await;
futures::future::pending::<()>().await
futures::future::pending::<()>().await;
}));
}
tokio::time::sleep(Duration::from_millis(100)).await;
Expand Down
20 changes: 14 additions & 6 deletions nativelink-worker/tests/multi_worker_cas_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// This test spins up multiple isolated tokio runtimes to simulate independent
// worker processes, which legitimately needs the raw runtime/spawn APIs that
// `src` forbids via `clippy::disallowed_methods`. It also declares test-local
// constants mid-function and fills buffers with small truncating casts. Allow
// the lints that fire on those intentional test-only patterns; `src` stays
// strict.
#![allow(clippy::disallowed_methods)]
#![allow(clippy::items_after_statements)]
#![allow(clippy::cast_possible_truncation)]

use std::sync::Arc;

use bytes::Bytes;
Expand Down Expand Up @@ -78,8 +88,7 @@ async fn test_multi_worker_isolated_cas_fails() -> Result<(), Error> {
if let Err(e) = result {
assert!(
e.to_string().contains("not found") || e.to_string().contains("No such"),
"Expected 'not found' error, got: {}",
e
"Expected 'not found' error, got: {e}"
);
}

Expand Down Expand Up @@ -146,7 +155,7 @@ async fn test_multi_worker_shared_cas_works() -> Result<(), Error> {

/// Stress test with many workers and concurrent actions
#[tokio::test]
#[ignore] // This is a longer-running test
#[ignore = "longer-running stress test"]
async fn stress_test_multi_worker_cas() -> Result<(), Error> {
let temp_dir = std::env::temp_dir().join(format!("test-stress-cas-{}", uuid::Uuid::new_v4()));
std::fs::create_dir_all(&temp_dir).unwrap();
Expand All @@ -172,7 +181,7 @@ async fn stress_test_multi_worker_cas() -> Result<(), Error> {
let data = vec![i as u8; FILE_SIZE];
// Use a simple digest for testing (not a real hash)
let digest = DigestInfo::try_new(
&format!("{:064}", i), // Create a 64-char hex string
&format!("{i:064}"), // Create a 64-char hex string
FILE_SIZE,
)?;
cas.update_oneshot(digest, data.into()).await?;
Expand All @@ -198,8 +207,7 @@ async fn stress_test_multi_worker_cas() -> Result<(), Error> {
assert_eq!(
data.len(),
FILE_SIZE,
"Worker {} got wrong data size",
worker_id
"Worker {worker_id} got wrong data size"
);
}
Ok::<_, Error>(())
Expand Down
7 changes: 6 additions & 1 deletion toolchain-examples/rbe-toolchain-test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ writeShellScriptBin "rbe-toolchain-test" ''

NO_COLOR=true ${nativelink}/bin/nativelink -- toolchain-examples/nativelink-config.json5 | tee -i toolchain-examples/nativelink.log &

CORE_BAZEL_ARGS="--check_direct_dependencies=error --remote_cache=grpc://localhost:50051 --remote_executor=grpc://localhost:50051"
# --noshow_progress / --show_result=0 quiet the per-action progress stream and
# the built-target listing so the RBE example logs stay scannable. Raw flags
# (not --config=nl-quiet) because these commands run in the toolchain-examples
# workspace, which does not define that config; and no --test_summary because
# some commands here are `build` (curl, zstd), where it is not a valid option.
CORE_BAZEL_ARGS="--check_direct_dependencies=error --remote_cache=grpc://localhost:50051 --remote_executor=grpc://localhost:50051 --noshow_progress --show_result=0"

echo "" > toolchain-examples/cmd.log

Expand Down
Loading