Skip to content

Commit 4d28ad8

Browse files
committed
macOS: Use system linker with Rust+Bazel, other fixes
1 parent 32aab74 commit 4d28ad8

File tree

6 files changed

+30
-25
lines changed

6 files changed

+30
-25
lines changed

.bazelrc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ build:macos --cxxopt=-fno-modules
4545
build:macos --features=-layering_check --features=-parse_headers
4646

4747
# C++: Disable annoying warnings
48-
build:linux --cxxopt=-Wno-unused-command-line-argument
49-
build:linux --host_cxxopt=-Wno-unused-command-line-argument
50-
build:macos --cxxopt=-Wno-unused-command-line-argument
51-
build:macos --host_cxxopt=-Wno-unused-command-line-argument
48+
build:linux --copt=-Wno-unused-command-line-argument
49+
build:linux --host_copt=-Wno-unused-command-line-argument
50+
build:macos --copt=-Wno-unused-command-line-argument
51+
build:macos --host_copt=-Wno-unused-command-line-argument
5252

5353
# `--config=libcxx`: Enables compilation and linking with libc++
5454
build:libcxx --cxxopt=-stdlib=libc++
@@ -86,6 +86,10 @@ common:ci --verbose_failures
8686
## Rust
8787
build --@rules_rust//rust/toolchain/channel=nightly
8888

89+
# Use Bazel's C++ toolchain as the linker for Rust targets instead of relying
90+
# on a system linker being available in the sandbox (fixes macOS linker errors).
91+
build --@rules_rust//rust/settings:experimental_use_cc_common_link=True
92+
8993
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
9094
build --output_groups=+clippy_checks
9195

MODULE.bazel.lock

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/deps/cc.MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
# SOFTWARE.
2121

2222
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
23-
bazel_dep(name = "curl", version = "8.11.0.bcr.4")
24-
bazel_dep(name = "zlib", version = "1.3.1.bcr.8")
25-
bazel_dep(name = "zstd", version = "1.5.7")
23+
bazel_dep(name = "curl", version = "8.11.0.bcr.5")
24+
bazel_dep(name = "zlib", version = "1.3.2")
25+
bazel_dep(name = "zstd", version = "1.5.7.bcr.1")
2626
bazel_dep(name = "abseil-cpp", version = "20260107.1", repo_name = "absl")
2727
bazel_dep(name = "violet", version = "26.03.08")
2828
archive_override(

bazel/deps/rust.MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
# SOFTWARE.
2121

22-
bazel_dep(name = "rules_rust", version = "0.68.1")
22+
bazel_dep(name = "rules_rust", version = "0.69.0")
2323

2424
## Configure Rust toolchain
2525
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/devshell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
### - linux
2929
valgrind,
3030
### - darwin
31-
apple-sdk_15,
31+
apple-sdk_14,
3232
## tools
3333
pkg-config,
3434
python3,
@@ -47,7 +47,7 @@
4747
ripgrep,
4848
taplo,
4949
}: let
50-
darwinPackages = [apple-sdk_15];
50+
darwinPackages = [apple-sdk_14];
5151
linuxPackages = [valgrind];
5252

5353
# Alias for `llvmPackages_XX` that we aim to support. At the moment,

0 commit comments

Comments
 (0)