From 762c2cbf4eef6a15029cf62aebd0efbaf7ee1509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 13 Dec 2023 08:51:03 +0200 Subject: [PATCH] upgrading to Bazel 7 - `.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. --- .bazelrc | 5 +- .bazelversion | 2 +- MODULE.bazel.lock | 435 +++++++++++++++++++++++++++++++++++++ README.md | 66 ++++-- examples/bzlmod/.bazelrc | 8 +- examples/rules_cc/.bazelrc | 8 +- 6 files changed, 490 insertions(+), 34 deletions(-) diff --git a/.bazelrc b/.bazelrc index 16c4087..5f48e88 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,12 +1,9 @@ -common --enable_bzlmod - test --sandbox_default_allow_network=false test --test_output=errors build --verbose_failures build --worker_sandboxing -build --experimental_reuse_sandbox_directories -build --incompatible_enable_cc_toolchain_resolution build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 build --experimental_output_directory_naming_scheme=diff_against_dynamic_baseline +build --sandbox_add_mount_pair=/tmp diff --git a/.bazelversion b/.bazelversion index 19b860c..66ce77b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.4.0 +7.0.0 diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 128f474..e52a572 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1153,6 +1153,441 @@ } } }, + "@@gazelle~0.34.0//:extensions.bzl%go_deps": { + "general": { + "bzlTransitiveDigest": "bxCC2wkQKI2fVRS2z8qAkH7FpoBFV1H7+yyT3EXXdbU=", + "accumulatedFileDigests": { + "@@rules_go~0.43.0//:go.mod": "58f9901703af412a1a8771d283721ef391c0ca1cc6ef3c141334311965535676", + "@@gazelle~0.34.0//:go.mod": "9ae159a385b2f244bbe964b9f91dbea6e7bd534e0b22e846655f241c65de2c49", + "@@//:go.mod": "6e943cdf46a3d53e49117a82ffd81f1c653769338cf7c432e2cf011a158f7ec3", + "@@//:go.sum": "cf31a66d8fd57f2af1b0e569ca1459160f6611fa25c60455254ff7f5b8f1711f", + "@@rules_go~0.43.0//:go.sum": "c6368ec1da45691f9148115d7317e740c3b32313b624b8f6545ef36b2ab4d781", + "@@gazelle~0.34.0//:go.sum": "7469786f3930030c430969cedae951e6947cb40f4a563dac94a350659c0fedc4" + }, + "envVariables": {}, + "generatedRepoSpecs": { + "org_golang_x_tools_go_vcs": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_tools_go_vcs", + "importpath": "golang.org/x/tools/go/vcs", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4=", + "replace": "", + "version": "v0.1.0-deprecated" + } + }, + "com_github_fsnotify_fsnotify": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_fsnotify_fsnotify", + "importpath": "github.com/fsnotify/fsnotify", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=", + "replace": "", + "version": "v1.7.0" + } + }, + "org_golang_x_text": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_text", + "importpath": "golang.org/x/text", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=", + "replace": "", + "version": "v0.13.0" + } + }, + "com_github_pmezard_go_difflib": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_pmezard_go_difflib", + "importpath": "github.com/pmezard/go-difflib", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", + "replace": "", + "version": "v1.0.0" + } + }, + "org_golang_google_protobuf": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_google_protobuf", + "importpath": "google.golang.org/protobuf", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=", + "replace": "", + "version": "v1.30.0" + } + }, + "com_github_bmatcuk_doublestar_v4": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_bmatcuk_doublestar_v4", + "importpath": "github.com/bmatcuk/doublestar/v4", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=", + "replace": "", + "version": "v4.6.1" + } + }, + "org_golang_x_mod": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_mod", + "importpath": "golang.org/x/mod", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=", + "replace": "", + "version": "v0.13.0" + } + }, + "com_github_davecgh_go_spew": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_davecgh_go_spew", + "importpath": "github.com/davecgh/go-spew", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", + "replace": "", + "version": "v1.1.1" + } + }, + "in_gopkg_yaml_v3": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~in_gopkg_yaml_v3", + "importpath": "gopkg.in/yaml.v3", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=", + "replace": "", + "version": "v3.0.1" + } + }, + "org_golang_x_tools": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_tools", + "importpath": "golang.org/x/tools", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=", + "replace": "", + "version": "v0.14.0" + } + }, + "com_github_bazelbuild_buildtools": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_bazelbuild_buildtools", + "importpath": "github.com/bazelbuild/buildtools", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:VUHCI4QRifAGYsbVJYqJndLf7YqV12YthB+PLFsEKqo=", + "replace": "", + "version": "v0.0.0-20231017121127-23aa65d4e117" + } + }, + "org_golang_x_net": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_net", + "importpath": "golang.org/x/net", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=", + "replace": "", + "version": "v0.16.0" + } + }, + "org_golang_google_genproto": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_google_genproto", + "importpath": "google.golang.org/genproto", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=", + "replace": "", + "version": "v0.0.0-20200526211855-cb27e3aa2013" + } + }, + "com_github_gogo_protobuf": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_gogo_protobuf", + "importpath": "github.com/gogo/protobuf", + "build_directives": [ + "gazelle:proto disable" + ], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", + "replace": "", + "version": "v1.3.2" + } + }, + "com_github_stretchr_testify": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_stretchr_testify", + "importpath": "github.com/stretchr/testify", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=", + "replace": "", + "version": "v1.8.2" + } + }, + "com_github_golang_protobuf": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_golang_protobuf", + "importpath": "github.com/golang/protobuf", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=", + "replace": "", + "version": "v1.5.3" + } + }, + "com_github_golang_mock": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_golang_mock", + "importpath": "github.com/golang/mock", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=", + "replace": "", + "version": "v1.6.0" + } + }, + "org_golang_x_sync": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_sync", + "importpath": "golang.org/x/sync", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=", + "replace": "", + "version": "v0.4.0" + } + }, + "bazel_gazelle_go_repository_config": { + "bzlFile": "@@gazelle~0.34.0//internal/bzlmod:go_deps.bzl", + "ruleClassName": "_go_repository_config", + "attributes": { + "name": "gazelle~0.34.0~go_deps~bazel_gazelle_go_repository_config", + "importpaths": { + "com_github_bazelbuild_buildtools": "github.com/bazelbuild/buildtools", + "com_github_stretchr_testify": "github.com/stretchr/testify", + "com_github_davecgh_go_spew": "github.com/davecgh/go-spew", + "com_github_golang_protobuf": "github.com/golang/protobuf", + "com_github_pmezard_go_difflib": "github.com/pmezard/go-difflib", + "org_golang_google_protobuf": "google.golang.org/protobuf", + "in_gopkg_yaml_v3": "gopkg.in/yaml.v3", + "com_github_gogo_protobuf": "github.com/gogo/protobuf", + "com_github_golang_mock": "github.com/golang/mock", + "org_golang_x_net": "golang.org/x/net", + "org_golang_x_sys": "golang.org/x/sys", + "org_golang_x_text": "golang.org/x/text", + "org_golang_x_tools": "golang.org/x/tools", + "org_golang_google_genproto": "google.golang.org/genproto", + "org_golang_google_grpc": "google.golang.org/grpc", + "com_github_bmatcuk_doublestar_v4": "github.com/bmatcuk/doublestar/v4", + "com_github_fsnotify_fsnotify": "github.com/fsnotify/fsnotify", + "com_github_google_go_cmp": "github.com/google/go-cmp", + "org_golang_x_mod": "golang.org/x/mod", + "org_golang_x_sync": "golang.org/x/sync", + "org_golang_x_tools_go_vcs": "golang.org/x/tools/go/vcs", + "@rules_go~0.43.0": "github.com/bazelbuild/rules_go", + "@gazelle~0.34.0": "github.com/bazelbuild/bazel-gazelle" + }, + "module_names": { + "@rules_go~0.43.0": "rules_go", + "@gazelle~0.34.0": "gazelle" + }, + "build_naming_conventions": {} + } + }, + "org_golang_google_grpc": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_google_grpc", + "importpath": "google.golang.org/grpc", + "build_directives": [ + "gazelle:proto disable" + ], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=", + "replace": "", + "version": "v1.50.0" + } + }, + "org_golang_x_sys": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~org_golang_x_sys", + "importpath": "golang.org/x/sys", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=", + "replace": "", + "version": "v0.13.0" + } + }, + "com_github_google_go_cmp": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository.bzl", + "ruleClassName": "go_repository", + "attributes": { + "name": "gazelle~0.34.0~go_deps~com_github_google_go_cmp", + "importpath": "github.com/google/go-cmp", + "build_directives": [], + "build_file_generation": "auto", + "build_extra_args": [], + "patches": [], + "patch_args": [], + "sum": "h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=", + "replace": "", + "version": "v0.6.0" + } + } + }, + "moduleExtensionMetadata": { + "explicitRootModuleDirectDeps": [], + "explicitRootModuleDirectDevDeps": [ + "com_github_bazelbuild_buildtools", + "com_github_stretchr_testify" + ], + "useAllRepos": "NO" + } + } + }, + "@@gazelle~0.34.0//internal/bzlmod:non_module_deps.bzl%non_module_deps": { + "general": { + "bzlTransitiveDigest": "AjbsH9WZCj0ipLarbbkp25YBRrRhWYvO7OIiTcHyyok=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_gazelle_is_bazel_module": { + "bzlFile": "@@gazelle~0.34.0//internal:is_bazel_module.bzl", + "ruleClassName": "is_bazel_module", + "attributes": { + "name": "gazelle~0.34.0~non_module_deps~bazel_gazelle_is_bazel_module", + "is_bazel_module": true + } + }, + "bazel_gazelle_go_repository_tools": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository_tools.bzl", + "ruleClassName": "go_repository_tools", + "attributes": { + "name": "gazelle~0.34.0~non_module_deps~bazel_gazelle_go_repository_tools", + "go_cache": "@@gazelle~0.34.0~non_module_deps~bazel_gazelle_go_repository_cache//:go.env" + } + }, + "bazel_gazelle_go_repository_cache": { + "bzlFile": "@@gazelle~0.34.0//internal:go_repository_cache.bzl", + "ruleClassName": "go_repository_cache", + "attributes": { + "name": "gazelle~0.34.0~non_module_deps~bazel_gazelle_go_repository_cache", + "go_sdk_name": "@rules_go~0.43.0~go_sdk~go_default_sdk", + "go_env": {} + } + } + } + } + }, "@@rules_go~0.43.0//go:extensions.bzl%go_sdk": { "os:linux,arch:amd64": { "bzlTransitiveDigest": "X7FY+0kUDFpsa3ulS9IPEJAqEW8vwFdmD7u4epims+M=", diff --git a/README.md b/README.md index b318cf8..e5a1a1e 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ Read about zig-cc; the rest of the README will present how to use this toolchain from Bazel. -Configuring toolchains in Bazel is complex, under-documented, and fraught with -peril. We, the team behind `hermetic_cc_toolchain`,are still confused on how -this all works, and often wonder why it works at all. That aside, we made -our best effort to make `hermetic_cc_toolchain` usable for your C/C++/CGo -projects, with as many guardrails as we could install. +Configuring toolchains in Bazel is complex and fraught with peril. We, the team +behind `hermetic_cc_toolchain`, are still confused on how this all works, and +often wonder why it works at all. That aside, we made our best effort to make +`hermetic_cc_toolchain` usable for your C/C++/CGo projects, with as many +guardrails can be installed. While copy-pasting the code in your project, attempt to read and understand the text surrounding the code snippets. This will save you hours of head @@ -58,19 +58,37 @@ load("@hermetic_cc_toolchain//toolchain:defs.bzl", zig_toolchains = "toolchains" zig_toolchains() ``` -And this to `.bazelrc`: +And this to `.bazelrc` on a Unix-y systems: ``` -build --incompatible_enable_cc_toolchain_resolution +build --sandbox_add_mount_pair=/tmp +``` + +Windows: + +``` +build --sandbox_add_mount_pair=C:\Temp +``` + +The directories can be narrowed down to `/tmp/zig-cache` and +`C:\Temp\hermetic_cc_toolchain` respectively if it can be ensured they will be +created before the invocation of `bazel build`. See [#83][pr-83] for more +context. If a different place is prefferred for zig cache, set: + +``` +build --repo_env=HERMETIC_CC_TOOLCHAIN_CACHE_PREFIX=/path/to/cache +build --sandbox_add_mount_pair=/path/to/cache ``` The snippets above will download the zig toolchain and make the bazel -toolchains available for registration and usage. If you do nothing else, this -may work. The `.bazelrc` snippet instructs Bazel to use the registered "new -kinds of toolchains". All above are required regardless of how wants to use it. -The next steps depend on how one wants to use `hermetic_cc_toolchain`. The -descriptions below is a gentle introduction to C++ toolchains from "user's -perspective" too. +toolchains available for registration and usage. If nothing else is done, this +will work for some minimal use cases. The `.bazelrc` snippet instructs Bazel to +use the registered "new kinds of toolchains". The next steps depend on how one +wants to use `hermetic_cc_toolchain`. The descriptions below is a gentle +introduction to C++ toolchains from "user's perspective" too. + +See [examples][examples] for some other recommended `.bazelrc` flags, as well +as how to use `hermetic_cc_toolchain` with bzlmod. ### Use case: manually build a single target with a specific zig cc toolchain @@ -315,6 +333,8 @@ Currently zig cache is stored in `/tmp/hermetic_cc_toolchain`, so `bazel clean --expunge` will not clear the zig cache. Zig's cache should be stored somewhere in the project's path. It is not clear how to do it. +See [#83][pr-83] for more context. + ### OSX: sysroot For non-trivial programs (and for all darwin/arm64 cgo programs) MacOS SDK may @@ -323,19 +343,15 @@ is currently not implemented, but patches implementing it will be accepted, as long as the OSX sysroot must come through an `http_archive`. In essence, OSX target support is not well tested with `hermetic_cc_toolchain`. +Also see [#10][pr-10]. -## Known Issues In Upstream - -This section lists issues that we have stumbled into when using `zig cc`, and -is outside of `hermetic_cc_toolchain`'s control. +### Bazel 6 or earlier -### Number of libc stubs with Go 1.20+ +Add to `.bazelrc`: -Until Go 1.19 the number of glibc stubs that needed to be compiled was strictly -controlled. Go 1.20 no longer ships with pre-compiled archive files for the -standard library, and it generates them on the fly, causing many extraneous -libc stubs. Therefore, the initial compilation will take longer until those -stubs are pre-cached. +``` +build --incompatible_enable_cc_toolchain_resolution +``` ## Host Environments @@ -362,7 +378,6 @@ $ docker run -e CC=/usr/bin/false -ti --rm -v "$PWD:/x" -w /x debian:bookworm-sl # ./ci/test # ./ci/zig-wrapper ``` - ## Communication We maintain two channels for comms: @@ -424,3 +439,6 @@ On a more practical note: [subset]: https://en.wikipedia.org/wiki/Subset [universal-headers]: https://github.com/ziglang/universal-headers [go-monorepo]: https://www.uber.com/blog/go-monorepo-bazel/ +[pr-83]: https://github.com/uber/hermetic_cc_toolchain/issues/83 +[pr-10]: https://github.com/uber/hermetic_cc_toolchain/issues/10 +[examples]: https://github.com/uber/hermetic_cc_toolchain/tree/main/examples diff --git a/examples/bzlmod/.bazelrc b/examples/bzlmod/.bazelrc index e384b23..143b0e9 100644 --- a/examples/bzlmod/.bazelrc +++ b/examples/bzlmod/.bazelrc @@ -1,11 +1,11 @@ -common --enable_bzlmod +# Copyright 2023 Uber Technologies, Inc. +# Licensed under the MIT License test --sandbox_default_allow_network=false test --test_output=errors build --verbose_failures build --worker_sandboxing -build --experimental_reuse_sandbox_directories -build --incompatible_enable_cc_toolchain_resolution build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 -build --experimental_output_directory_naming_scheme=diff_against_baseline +build --sandbox_add_mount_pair=/tmp +build --experimental_output_directory_naming_scheme=diff_against_dynamic_baseline diff --git a/examples/rules_cc/.bazelrc b/examples/rules_cc/.bazelrc index ece2c07..143b0e9 100644 --- a/examples/rules_cc/.bazelrc +++ b/examples/rules_cc/.bazelrc @@ -1,5 +1,11 @@ # Copyright 2023 Uber Technologies, Inc. # Licensed under the MIT License +test --sandbox_default_allow_network=false +test --test_output=errors + +build --verbose_failures +build --worker_sandboxing -build --incompatible_enable_cc_toolchain_resolution build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 +build --sandbox_add_mount_pair=/tmp +build --experimental_output_directory_naming_scheme=diff_against_dynamic_baseline