Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long link times with --incompatible_sandbox_hermetic_tmp #134

Closed
robinlinden opened this issue Dec 12, 2023 · 2 comments · Fixed by #135
Closed

Long link times with --incompatible_sandbox_hermetic_tmp #134

robinlinden opened this issue Dec 12, 2023 · 2 comments · Fixed by #135
Labels
documentation Improvements or additions to documentation

Comments

@robinlinden
Copy link
Contributor

When using Bazel 7, --incompatible_sandbox_hermetic_tmp is flipped, leading to incredibly long link times.

I ran into this when bumping one of my projects to Bazel 7 where it caused the aarch64 cross-compilation job that normally takes 10-15 minutes to hit the 30-minute limit I've got set for it.

This can short-term be worked around with --noincompatible_sandbox_hermetic_tmp, but it feels like something that needs to be looked into somewhere.

robin@x:~/code/hastur$ bazel clean
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.

robin@x:~/code/hastur$ time bazel test --config=linux-aarch64-musl util/unicode_test
INFO: Analyzed target //util:unicode_test (48 packages loaded, 5896 targets configured).
INFO: From Linking util/unicode_test:
In file included from external/zig_sdk/lib/libc/musl/crt/rcrt1.c:3:
external/zig_sdk/lib/libc/musl/crt/../ldso/dlstart.c:146:20: warning: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
        GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
                          ^
external/zig_sdk/lib/libc/musl/crt/rcrt1.c:11:13: note: conflicting prototype is here
hidden void __dls2(unsigned char *base, size_t *sp)
            ^
1 warning generated.
INFO: Found 1 test target...
Target //util:unicode_test up-to-date:
  bazel-bin/util/unicode_test
INFO: Elapsed time: 25.911s, Critical Path: 25.37s
INFO: 10 processes: 3 internal, 7 linux-sandbox.
INFO: Build completed successfully, 10 total actions

Executed 1 out of 1 test: 1 test passes.

real    0m25.921s
user    0m0.018s
sys     0m0.000s

robin@x:~/code/hastur$ bazel clean
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.

robin@x:~/code/hastur$ time bazel test --config=linux-aarch64-musl --noincompatible_sandbox_hermetic_tmp util/unicode_test
INFO: Analyzed target //util:unicode_test (48 packages loaded, 5896 targets configured).
INFO: Found 1 test target...
Target //util:unicode_test up-to-date:
  bazel-bin/util/unicode_test
INFO: Elapsed time: 2.562s, Critical Path: 2.04s
INFO: 10 processes: 3 internal, 7 linux-sandbox.
INFO: Build completed successfully, 10 total actions

Executed 1 out of 1 test: 1 test passes.

real    0m2.571s
user    0m0.010s
sys     0m0.000s
ghost pushed a commit that referenced this issue Dec 13, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp` is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

The top-level project itself is not bzlmod yet, because that's
book-keeping (it can already be used with bzlmod, so this is purely
book-keeping). We can tackle this out of band with dependency updates.

Fixes #134
@motiejus
Copy link
Collaborator

Thanks! Covered in #135, please review that and see if it works for you.

We recommend --sandbox_add_mount_pair=/tmp or, if you can, --sandbox_add_mount_pair=/tmp/zig-cache instead of incompatible_sandbox_hermetic_tmp.

@motiejus motiejus added the documentation Improvements or additions to documentation label Dec 13, 2023
@robinlinden
Copy link
Contributor Author

Thanks for the quick response! --sandbox_add_mount_pair=/tmp seems to work fine and give me the normal speedier link times, so will switch to that. :)

ghost pushed a commit that referenced this issue Dec 14, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134
ghost pushed a commit that referenced this issue Dec 14, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134
ghost pushed a commit that referenced this issue Dec 14, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134.
ghost pushed a commit that referenced this issue Dec 15, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134.
ghost pushed a commit that referenced this issue Dec 15, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134.
ghost pushed a commit that referenced this issue Dec 19, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134.
ghost pushed a commit that referenced this issue Dec 19, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134.
motiejus pushed a commit that referenced this issue Dec 19, 2023
- `.bazelrc`: `sandbox_add_mount_pair=/tmp/zig-cache` (if you can) or
  `/tmp` (if not) is now required everywhere.
- `.bazelrc` and `README`: remove deprecated/now-default flags.
- `README`: add links to #10 and #83.
- `README`: mention bzlmod.
- `examples/*/.bazelrc`: make them the same for a better recommendation.

Fixes #134.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants