Skip to content

Commit

Permalink
Bump flake (TraceMachina#1493)
Browse files Browse the repository at this point in the history
- Regenerate toolchains
- Bump Bazel and rules_cc
- Bump stable Rust version
- Work around excessive rustc/spidermonkey rebuilds
- Use native rust toolchains for tooling-only workflows
- Adjust patches
- Adjust golangci config
- Adjust package.json for new deno version
  • Loading branch information
aaronmondal authored Nov 23, 2024
1 parent a8c3217 commit 99b9cbb
Show file tree
Hide file tree
Showing 21 changed files with 3,513 additions and 2,942 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.1
7.4.1
2 changes: 0 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ linters:
enable-all: true
disable:
# Deprecated.
- execinquery
- gomnd
- exportloopref

# Allow all packages for now.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
name = "nativelink"
version = "0.5.3"
edition = "2021"
rust-version = "1.81.0"
rust-version = "1.82.0"

[profile.release]
lto = true
Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module(
compatibility_level = 0,
)

bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_python", version = "0.36.0")

Expand All @@ -18,7 +18,7 @@ python.toolchain(
)
use_repo(python, python = "python_versions")

bazel_dep(name = "rules_rust", version = "0.51.0")
bazel_dep(name = "rules_rust", version = "0.54.1")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
Expand Down Expand Up @@ -46,7 +46,7 @@ rust.toolchain(
"2024-07-24/rust-std-nightly-aarch64-apple-darwin.tar.xz": "ea8afa34a2010b7ed371ad260af837cf89d02fb24783ed9cee75685781247fde",
},
versions = [
"1.81.0",
"1.82.0",
"nightly/2024-07-24",
],
)
Expand All @@ -57,7 +57,7 @@ rust_host_tools = use_extension(
)
rust_host_tools.host_tools(
edition = "2021",
version = "1.81.0",
version = "1.82.0",
)

use_repo(rust, "rust_toolchains")
Expand Down
50 changes: 25 additions & 25 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,23 @@
system,
...
}: let
stable-rust-version = "1.81.0";
stable-rust-version = "1.82.0";
nightly-rust-version = "2024-07-24";

# TODO(aaronmondal): Make musl builds work on Darwin.
# See: https://github.com/TraceMachina/nativelink/issues/751
stable-rust =
if pkgs.stdenv.isDarwin
then pkgs.rust-bin.stable.${stable-rust-version}
else pkgs.pkgsMusl.rust-bin.stable.${stable-rust-version};
nightly-rust =
if pkgs.stdenv.isDarwin
then pkgs.rust-bin.nightly.${nightly-rust-version}
else pkgs.pkgsMusl.rust-bin.nightly.${nightly-rust-version};

# TODO(aaronmondal): Tools like rustdoc don't work with the `pkgsMusl`
# package set because of missing libgcc_s. Fix this upstream and use the
# `stable-rust` toolchain in the devShell as well.
# See: https://github.com/oxalica/rust-overlay/issues/161
stable-rust-native = pkgs.rust-bin.stable.${stable-rust-version};
nightly-rust-native = pkgs.rust-bin.nightly.${nightly-rust-version};

maybeDarwinDeps = pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.libiconv
];

llvmPackages = pkgs.llvmPackages_18;
llvmPackages = pkgs.llvmPackages_19;

customStdenv = pkgs.callPackage ./tools/llvmStdenv.nix {inherit llvmPackages;};

Expand Down Expand Up @@ -150,7 +140,7 @@
linkerPath =
if isLinuxBuild && isLinuxTarget
then "${pkgs.mold}/bin/ld.mold"
else "${pkgs.llvmPackages_latest.lld}/bin/ld.lld";
else "${llvmPackages.lld}/bin/ld.lld";
in
{
inherit src;
Expand All @@ -169,7 +159,7 @@
(
if isLinuxBuild
then [pkgs.mold]
else [pkgs.llvmPackages_latest.lld]
else [llvmPackages.lld]
)
++ pkgs.lib.optionals p.stdenv.targetPlatform.isDarwin [
p.darwin.apple_sdk.frameworks.Security
Expand Down Expand Up @@ -242,7 +232,7 @@
"build-chromium-tests"
./deploy/chromium-example/build_chromium_tests.sh;

docs = pkgs.callPackage ./tools/docs.nix {rust = stable-rust.default;};
docs = pkgs.callPackage ./tools/docs.nix {rust = stable-rust-native.default;};

inherit (nix2container.packages.${system}.nix2container) pullImage;
inherit (nix2container.packages.${system}.nix2container) buildImage;
Expand Down Expand Up @@ -389,10 +379,19 @@
./tools/nixpkgs_disable_ratehammering_pulumi_tests.diff
];
};
rust-overlay-patched = (import self.inputs.nixpkgs {inherit system;}).applyPatches {
name = "rust-overlay-patched";
src = self.inputs.rust-overlay;
patches = [
# This dependency has a giant dependency chain and we don't need
# it for our usecases.
./tools/rust-overlay_cut_libsecret.diff
];
};
in
import nixpkgs-patched {
inherit system;
overlays = [(import rust-overlay)];
overlays = [(import rust-overlay-patched)];
};
apps = {
default = {
Expand Down Expand Up @@ -459,7 +458,8 @@
};
pre-commit.settings = {
hooks = import ./tools/pre-commit-hooks.nix {
inherit pkgs nightly-rust;
inherit pkgs;
nightly-rust = nightly-rust-native;
};
};
local-remote-execution.settings = {
Expand Down
4 changes: 2 additions & 2 deletions local-remote-execution/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module(
bazel_dep(name = "platforms", version = "0.0.10")

# Use the starlark implementation of C++ rules instead of the builtin ones.
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.0.17")

# Use the starlark implementation of Java rules instead of the builtin ones.
bazel_dep(name = "rules_java", version = "7.6.5")
bazel_dep(name = "rules_java", version = "8.5.1")
45 changes: 31 additions & 14 deletions local-remote-execution/generated-cc/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,21 @@ filegroup(
srcs = ["cc_wrapper.sh"],
)

filegroup(
name = "validate_static_library",
srcs = ["validate_static_library.sh"],
)

filegroup(
name = "compiler_deps",
srcs = glob(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
) + [
":builtin_include_directory_paths",
":cc_wrapper",
":validate_static_library",
],
)

# This is the entry point for --crosstool_top. Toolchains are found
Expand All @@ -86,6 +95,7 @@ cc_toolchain(
module_map = ":module.modulemap",
objcopy_files = ":empty",
strip_files = ":empty",
supports_header_parsing = 1,
supports_param_files = 1,
toolchain_config = ":local",
toolchain_identifier = "local",
Expand All @@ -111,18 +121,22 @@ cc_toolchain_config(
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/nix/store/k60snilqpm9cys8h55hib7yzwa0xcxgn-clang-wrapper-18.1.8/resource-root/include",
"/nix/store/wlavaybjbzgllhq11lib6qgr7rm8imgp-glibc-2.39-52-dev/include",
"/nix/store/k60snilqpm9cys8h55hib7yzwa0xcxgn-clang-wrapper-18.1.8/resource-root/share",
"/nix/store/lgy959d2i3psg6a85pv2vx4bwmva4m0r-libcxx-18.1.8-dev/include/c++/v1",
"/nix/store/xbn5wq1pyhwb63qlnw1z0b88q53yw9yr-clang-wrapper-19.1.3/resource-root/include",
"/nix/store/aax0hx68i2ikhpf27hdm6a2a209d4s6p-glibc-2.40-36-dev/include",
"/nix/store/xbn5wq1pyhwb63qlnw1z0b88q53yw9yr-clang-wrapper-19.1.3/resource-root/share",
"/nix/store/669q4my6n9sdg1i6baw5j2akbmi6r8s1-libcxx-19.1.3-dev/include/c++/v1",
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
],
cxx_flags = ["-std=c++14"],
dbg_compile_flags = ["-g"],
extra_flags_per_feature = {"use_module_maps": [
"-Xclang",
"-fno-cxx-modules",
]},
host_system_name = "x86_64-unknown-linux-gnu",
link_flags = [
"-fuse-ld=/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/ld.mold",
"-B/nix/store/pk06lmp6wwn35xmvn9d7fr78qg6k9qxw-customClang/bin",
"-fuse-ld=/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/ld.mold",
"-B/nix/store/lw8g7lpw6rwjmz6wxp2grzaixlvn02a7-customClang/bin",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
],
Expand All @@ -147,18 +161,21 @@ cc_toolchain_config(
target_libc = "glibc_2.35",
target_system_name = "local",
tool_paths = {
"ar": "/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/ar",
"ld": "/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/ld",
"ar": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/ar",
"ld": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/ld",
"llvm-cov": "None",
"llvm-profdata": "None",
"cpp": "/usr/bin/cpp",
"gcc": "/nix/store/pk06lmp6wwn35xmvn9d7fr78qg6k9qxw-customClang/bin/customClang",
"dwp": "/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/dwp",
"gcc": "/nix/store/lw8g7lpw6rwjmz6wxp2grzaixlvn02a7-customClang/bin/customClang",
"dwp": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/dwp",
"gcov": "None",
"nm": "/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/nm",
"objcopy": "/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/objcopy",
"objdump": "/nix/store/p05cf5z3nycmxkq14jfp5vl23v46aidy-llvm-binutils-wrapper-18.1.8/bin/objdump",
"nm": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/nm",
"objcopy": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/objcopy",
"objdump": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/objdump",
"strip": "/usr/bin/strip",
"c++filt": "/nix/store/9ms692fd1qf6435c1kzxvsjrg3fg58ys-llvm-binutils-wrapper-19.1.3/bin/c++filt",
"parse_headers": "cc_wrapper.sh",
"validate_static_library": "validate_static_library.sh",
},
toolchain_identifier = "local",
unfiltered_compile_flags = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
This file is generated by cc_configure and contains builtin include directories
that /nix/store/pk06lmp6wwn35xmvn9d7fr78qg6k9qxw-customClang/bin/customClang reported. This file is a dependency of every compilation action and
that /nix/store/lw8g7lpw6rwjmz6wxp2grzaixlvn02a7-customClang/bin/customClang reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.

/nix/store/k60snilqpm9cys8h55hib7yzwa0xcxgn-clang-wrapper-18.1.8/resource-root/include
/nix/store/wlavaybjbzgllhq11lib6qgr7rm8imgp-glibc-2.39-52-dev/include
/nix/store/k60snilqpm9cys8h55hib7yzwa0xcxgn-clang-wrapper-18.1.8/resource-root/share
/nix/store/lgy959d2i3psg6a85pv2vx4bwmva4m0r-libcxx-18.1.8-dev/include/c++/v1
/nix/store/xbn5wq1pyhwb63qlnw1z0b88q53yw9yr-clang-wrapper-19.1.3/resource-root/include
/nix/store/aax0hx68i2ikhpf27hdm6a2a209d4s6p-glibc-2.40-36-dev/include
/nix/store/xbn5wq1pyhwb63qlnw1z0b88q53yw9yr-clang-wrapper-19.1.3/resource-root/share
/nix/store/669q4my6n9sdg1i6baw5j2akbmi6r8s1-libcxx-19.1.3-dev/include/c++/v1
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Loading

0 comments on commit 99b9cbb

Please sign in to comment.