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

Achieve perfect reproducibility for Linux Bazel builds #1543

Merged
merged 1 commit into from
Dec 14, 2024
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
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ common --enable_platform_specific_config
common --incompatible_enable_cc_toolchain_resolution
common --incompatible_enable_proto_toolchain_resolution

# Simulate rules_python's initialization with a script and use a statically
# linked musl Python toolchain.
# TODO(aaronmondal): This is a hack. It works for us because have just a few
# simple python scripts in the repository and don't have
# complex Python dependencies. Implement LRE for Python.
common --@rules_python//python/config_settings:bootstrap_impl=script
common --@rules_python//python/config_settings:py_linux_libc=musl

# Don't leak PATH and LD_LIBRARY_PATH into the build.
build --incompatible_strict_action_env

Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module(

bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_python", version = "0.40.0")
bazel_dep(name = "rules_python", version = "1.0.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
Expand Down
1 change: 1 addition & 0 deletions nativelink-proto/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load(
"@rules_rust//rust:defs.bzl",
"rust_binary",
Expand Down