Skip to content

Commit 5bd3b89

Browse files
committed
wip
1 parent 37e9b2f commit 5bd3b89

File tree

5 files changed

+71
-3
lines changed

5 files changed

+71
-3
lines changed

.bazelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ common --action_env="BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1"
88
common --announce_rc
99
common --color=yes
1010
common --curses=yes
11-
common --incompatible_strict_action_env
11+
#common --incompatible_strict_action_env
1212
common --ui_actions_shown=20
1313
common --progress_in_terminal_title
1414
common --enable_platform_specific_config
@@ -37,4 +37,5 @@ test --test_output=errors
3737
test --test_summary=detailed
3838
test --test_verbose_timeout_warnings
3939

40+
import %workspace%/tools/shell_executable.bazelrc
4041
try-import %workspace%/user.bazelrc

manual.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cd /home/m1-s/.cache/bazel/_bazel_m1-s/f571dc30ab43d79e1980717ed6aa3182/sandbox/processwrapper-sandbox/40/execroot/_main
2+
3+
export BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
4+
export EXPERIMENTAL_SPLIT_XML_GENERATION=1
5+
export JAVA_RUNFILES=bazel-out/k8-fastbuild/bin/test/failure_1_test.bash.runfiles
6+
export PATH=/home/m1-s/.cache/bazelisk/downloads/sha256/17247e8a84245f59d3bc633d0cfe0a840992a7760a11af1a30012d03da31604c/bin:/nix/store/0nxvi9r5ymdlr2p24rjj9qzyms72zld1-bash-interactive-5.2p37/bin:/nix/store/if3mj9bz2y0grw308cqawki28ahfhfns-bazelisk-1.25.0/bin:/nix/store/mp7ba85zcqdj2sqwa29pql02s6nqpcxy-coreutils-9.7/bin:/nix/store/7fjnb79r7p38piiyn5xwgcj5w7fpfi02-findutils-4.10.0/bin:/nix/store/8b4vn1iyn6kqiisjvlmv67d1c0p3j6wj-gnugrep-3.11/bin:/nix/store/q7v3i9ii8mp6pjasxwip4ybq79hzxj1q-nix-2.28.4/bin
7+
export PYTHON_RUNFILES=bazel-out/k8-fastbuild/bin/test/failure_1_test.bash.runfiles
8+
export RUNFILES_DIR=bazel-out/k8-fastbuild/bin/test/failure_1_test.bash.runfiles
9+
export RUN_UNDER_RUNFILES=1
10+
export TEST_BINARY=test/failure_1_test.bash
11+
export TEST_INFRASTRUCTURE_FAILURE_FILE=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.infrastructure_failure
12+
export TEST_LOGSPLITTER_OUTPUT_FILE=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.raw_splitlogs/test.splitlogs
13+
export TEST_NAME=//test:failure_1_test
14+
export TEST_PREMATURE_EXIT_FILE=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.exited_prematurely
15+
export TEST_SHARD_INDEX=0
16+
export TEST_SIZE=small
17+
export TEST_SRCDIR=bazel-out/k8-fastbuild/bin/test/failure_1_test.bash.runfiles
18+
export TEST_TARGET=//test:failure_1_test
19+
export TEST_TIMEOUT=60
20+
export TEST_TMPDIR=_tmp/e3aa989485e1fe464a6bebee86395fff
21+
export TEST_TOTAL_SHARDS=0
22+
export TEST_UNDECLARED_OUTPUTS_ANNOTATIONS=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.outputs_manifest/ANNOTATIONS
23+
export TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.outputs_manifest
24+
export TEST_UNDECLARED_OUTPUTS_DIR=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.outputs
25+
export TEST_UNDECLARED_OUTPUTS_MANIFEST=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.outputs_manifest/MANIFEST
26+
export TEST_UNUSED_RUNFILES_LOG_FILE=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.unused_runfiles_log
27+
export TEST_WARNINGS_OUTPUT_FILE=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.warnings
28+
export TEST_WORKSPACE=_main
29+
export TMPDIR=/tmp
30+
export TZ=UTC
31+
export XML_OUTPUT_FILE=bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.x
32+
33+
/home/m1-s/.cache/bazel/_bazel_m1-s/install/0fdbfcdc2c6c2270badcaff8eec2742a/process-wrapper \
34+
--timeout=0 \
35+
--kill_delay=15 \
36+
--stats=/home/m1-s/.cache/bazel/_bazel_m1-s/f571dc30ab43d79e1980717ed6aa3182/sandbox/processwrapper-sandbox/40/stats.out \
37+
external/bazel_tools/tools/test/generate-xml.sh \
38+
bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.log \
39+
bazel-out/k8-fastbuild/testlogs/test/failure_1_test/test.xml 0 127

tools/BUILD.bazel

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile
33
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")
44
load("@rules_multirun//:defs.bzl", "multirun")
55
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
6+
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
67

78
buildifier(
89
name = "buildifier.check",
@@ -20,7 +21,7 @@ genrule(
2021
name = "gen-clang-format",
2122
outs = ["clang-format.bash"],
2223
cmd = """
23-
echo "#!/bin/bash" > $@
24+
echo "#!/usr/bin/env bash" > $@
2425
echo "cd \\$$BUILD_WORKSPACE_DIRECTORY" >> $@
2526
echo "exec bazelisk build \\$$@ //..." >> $@
2627
""",
@@ -67,7 +68,7 @@ genrule(
6768
name = "gen-clang-tidy",
6869
outs = ["clang-tidy.bash"],
6970
cmd = """
70-
echo "#!/bin/bash" > $@
71+
echo "#!/usr/bin/env bash" > $@
7172
echo "cd \\$$BUILD_WORKSPACE_DIRECTORY" >> $@
7273
echo "exec bazelisk build {options} \\$${{@:-//...}}" >> $@
7374
""".format(
@@ -106,3 +107,24 @@ refresh_compile_commands(
106107
"//...": "--extra_toolchains=@llvm_toolchain//:all",
107108
},
108109
)
110+
111+
genrule(
112+
name = "actual_bazelrc",
113+
outs = ["actual.bazelrc"],
114+
srcs = [
115+
"bazel-wrapper/flake.nix",
116+
"bazel-wrapper/flake.lock",
117+
],
118+
cmd = """
119+
mkdir nix
120+
cp -L ./tools/bazel-wrapper/flake.nix ./tools/bazel-wrapper/flake.lock ./nix
121+
file=$$(nix build ./nix#shellExecutable --print-out-paths)
122+
cp "$$file" $@
123+
""",
124+
)
125+
126+
diff_test(
127+
name = "shell_executable.bazelrc_diff_test",
128+
file1 = "shell_executable.bazelrc",
129+
file2 = ":actual_bazelrc",
130+
)

tools/bazel-wrapper/flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@
2020
bash
2121
bazelisk
2222
coreutils
23+
diffutils
2324
findutils
2425
gnugrep
26+
gnused
2527
nix
2628
]
2729
++ lib.optionals stdenv.isDarwin [
2830
darwin.cctools
2931
];
3032
in {
33+
shellExecutable = pkgs.writeText
34+
"shell_executable.bazelrc"
35+
"common --shell_executable ${pkgs.lib.getExe pkgs.bash}";
3136
default = pkgs.writeShellApplication {
3237
name = "bazel-wrapper";
3338
runtimeInputs = tools;

tools/shell_executable.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
common --shell_executable /nix/store/0nxvi9r5ymdlr2p24rjj9qzyms72zld1-bash-interactive-5.2p37/bin/bash

0 commit comments

Comments
 (0)