trying --experimental_use_hermetic_linux_sandbox

This commit is contained in:
Motiejus Jakštys 2022-12-11 07:03:10 +02:00
parent 020ff7ad38
commit c821cc3468
3 changed files with 23 additions and 15 deletions

View File

@ -1,4 +1,16 @@
common --color=yes --curses=yes
build --announce_rc
build --incompatible_enable_cc_toolchain_resolution
build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:hermetic-sandbox --experimental_use_hermetic_linux_sandbox
build:hermetic-sandbox --sandbox_add_mount_pair=/bin
build:hermetic-sandbox --sandbox_add_mount_pair=/usr
build:hermetic-sandbox --sandbox_add_mount_pair=/tmp/bazel-zig-cc
# for /proc/self/exe
build:hermetic-sandbox --sandbox_add_mount_pair=/proc
## symlinks in to /usr
build:hermetic-sandbox --sandbox_add_mount_pair=/usr/bin:/bin
build:hermetic-sandbox --sandbox_add_mount_pair=/usr/lib:/lib
build:hermetic-sandbox --sandbox_add_mount_pair=/usr/lib64:/lib64

View File

@ -45,5 +45,13 @@ bazel --batch clean; bazel --batch build --platforms=@zig_sdk//libc_aware/platfo
INFO: Elapsed time: 142.264s, Critical Path: 20.65s
```
Similar to `--config=hermetic-sandbox`. Which means there is something else at
play, not only re-hashing the sandbox files:
```
bazel --batch clean; bazel --batch build --platforms=@zig_sdk//libc_aware/platform:linux_amd64_gnu.2.28 ...
INFO: Elapsed time: 136.957s, Critical Path: 18.14s
```
[1]: https://sr.ht/~motiejus/bazel-zig-cc
[2]: https://github.com/grailbio/bazel-toolchain

View File

@ -30,11 +30,11 @@ load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
### ZIG
BAZEL_ZIG_CC_VERSION = "88e7e47ed20ca7b2f9509dfe09089b812d7d94eb"
BAZEL_ZIG_CC_VERSION = "70ef4dd54e8caafbc5ba93808d6cfe16d6c75290"
http_archive(
name = "bazel-zig-cc",
sha256 = "2a9dd119243899041279b61066a98b53d6859e168f7fc3be0cc9532fa329fc68",
sha256 = "128cb23d433d7b6aa8ddb44a8c295eaff7f9f6742f8b582abff7631f8a977390",
strip_prefix = "bazel-zig-cc-{}".format(BAZEL_ZIG_CC_VERSION),
urls = [
"https://git.sr.ht/~motiejus/bazel-zig-cc/archive/{}.tar.gz".format(BAZEL_ZIG_CC_VERSION),
@ -43,19 +43,7 @@ http_archive(
load("@bazel-zig-cc//toolchain:defs.bzl", zig_toolchains = "toolchains")
zig_toolchains(
host_platform_sha256 = {
"linux-aarch64": "9d85f451e06eb246ba6ac11c20ea988f38de078e31c922b7919c599d097dcc17",
"linux-x86_64": "b8c2876d7012234b99dc0d772a39ef3223d65a20acd0d061c4be692375220af0",
"macos-aarch64": "50a7bf17e36f677d994f18f021fb8cdcd17faceb8504994a1083888601059606",
"macos-x86_64": "90360f529b8e103ac3538de9a27835bfb37a9f6b4b1e5581bcb23ec2c4cac2e6",
"windows-x86_64": "87669cc8bda2c6eef0f3c298ddd545d495e1d3554b787bd7ccbca144c5ef729a",
},
url_formats = [
"https://dl.jakstys.lt/zig/zig-{host_platform}-{version}.{_ext}",
],
version = "0.11.0-dev.324+f61c5f3f5",
)
zig_toolchains()
register_toolchains(
# amd64 toolchains for libc-aware platforms: