tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
bazel_7: cleanup changes made to common tests
Guillaume Maudoux
2 years ago
5151e14e
05ecc09b
+293
-119
8 changed files
expand all
collapse all
unified
split
pkgs
development
tools
build-managers
bazel
bash-tools-test.nix
bazel_5
default.nix
bazel_7
protobuf-test.nix
tests.nix
cpp-test.nix
java-test.nix
protobuf-test.nix
shebang-test.nix
+1
-1
pkgs/development/tools/build-managers/bazel/bash-tools-test.nix
···
1
1
-
{ lib, writeText, bazel, runLocal, bazelTest, distDir, extraBazelArgs ? ""}:
1
1
+
{ writeText, bazel, runLocal, bazelTest, distDir, extraBazelArgs ? ""}:
2
2
3
3
# Tests that certain executables are available in bazel-executed bash shells.
4
4
+1
-1
pkgs/development/tools/build-managers/bazel/bazel_5/default.nix
···
287
287
sha256 = "1mm4awx6sa0myiz9j4hwp71rpr7yh8vihf3zm15n2ii6xb82r31k";
288
288
};
289
289
290
290
-
in (lib.optionalSttrs (!stdenv.hostPlatform.isDarwin) {
290
290
+
in (lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) {
291
291
# `extracted` doesn’t work on darwin
292
292
shebang = callPackage ../shebang-test.nix { inherit runLocal extracted bazelTest distDir; bazel = bazel_self;};
293
293
}) // {
+183
pkgs/development/tools/build-managers/bazel/bazel_7/protobuf-test.nix
···
1
1
+
{ bazel
2
2
+
, bazelTest
3
3
+
, fetchFromGitHub
4
4
+
, fetchurl
5
5
+
, stdenv
6
6
+
, darwin
7
7
+
, extraBazelArgs ? ""
8
8
+
, lib
9
9
+
, openjdk8
10
10
+
, jdk11_headless
11
11
+
, runLocal
12
12
+
, runtimeShell
13
13
+
, writeScript
14
14
+
, writeText
15
15
+
, distDir
16
16
+
, Foundation
17
17
+
, callPackage
18
18
+
, libtool
19
19
+
, lndir
20
20
+
, repoCache
21
21
+
, tree
22
22
+
}:
23
23
+
24
24
+
let
25
25
+
26
26
+
lockfile = ./tests.MODULE.bazel.lock;
27
27
+
28
28
+
protocbufRepoCache = callPackage ./bazel-repository-cache.nix {
29
29
+
# We are somewhat lucky that bazel's own lockfile works for our tests.
30
30
+
# Use extraDeps if the tests need things that are not in that lockfile.
31
31
+
# But most test dependencies are bazel's builtin deps, so that at least aligns.
32
32
+
inherit lockfile;
33
33
+
34
34
+
# Remove platform-specific binaries, as they are large and useless.
35
35
+
requiredDepNamePredicate = name:
36
36
+
null == builtins.match ".*(macos|osx|linux|win|android|maven).*" name;
37
37
+
};
38
38
+
39
39
+
MODULE = writeText "MODULE.bazel" ''
40
40
+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
41
41
+
bazel_dep(name = "protobuf", version = "21.7")
42
42
+
bazel_dep(name = "zlib", version = "1.3")
43
43
+
'';
44
44
+
45
45
+
WORKSPACE = writeText "WORKSPACE" ''
46
46
+
workspace(name = "our_workspace")
47
47
+
48
48
+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
49
49
+
50
50
+
http_archive(
51
51
+
name = "rules_proto",
52
52
+
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
53
53
+
strip_prefix = "rules_proto-5.3.0-21.7",
54
54
+
urls = [
55
55
+
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
56
56
+
],
57
57
+
)
58
58
+
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
59
59
+
rules_proto_dependencies()
60
60
+
rules_proto_toolchains()
61
61
+
'';
62
62
+
63
63
+
personProto = writeText "person.proto" ''
64
64
+
syntax = "proto3";
65
65
+
66
66
+
package person;
67
67
+
68
68
+
message Person {
69
69
+
string name = 1;
70
70
+
int32 id = 2;
71
71
+
string email = 3;
72
72
+
}
73
73
+
'';
74
74
+
75
75
+
personBUILD = writeText "BUILD" ''
76
76
+
load("@rules_proto//proto:defs.bzl", "proto_library")
77
77
+
78
78
+
proto_library(
79
79
+
name = "person_proto",
80
80
+
srcs = ["person.proto"],
81
81
+
visibility = ["//visibility:public"],
82
82
+
)
83
83
+
84
84
+
java_proto_library(
85
85
+
name = "person_java_proto",
86
86
+
deps = [":person_proto"],
87
87
+
)
88
88
+
89
89
+
cc_proto_library(
90
90
+
name = "person_cc_proto",
91
91
+
deps = [":person_proto"],
92
92
+
)
93
93
+
'';
94
94
+
95
95
+
toolsBazel = writeScript "bazel" ''
96
96
+
#! ${runtimeShell}
97
97
+
98
98
+
export CXX='${stdenv.cc}/bin/clang++'
99
99
+
export LD='${darwin.cctools}/bin/ld'
100
100
+
export LIBTOOL='${darwin.cctools}/bin/libtool'
101
101
+
export CC='${stdenv.cc}/bin/clang'
102
102
+
103
103
+
# XXX: hack for macosX, this flags disable bazel usage of xcode
104
104
+
# See: https://github.com/bazelbuild/bazel/issues/4231
105
105
+
export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
106
106
+
107
107
+
export HOMEBREW_RUBY_PATH="foo"
108
108
+
109
109
+
exec "$BAZEL_REAL" "$@"
110
110
+
'';
111
111
+
112
112
+
workspaceDir = runLocal "our_workspace" { } (''
113
113
+
mkdir $out
114
114
+
cp --no-preserve=all ${MODULE} $out/MODULE.bazel
115
115
+
cp --no-preserve=all ${./tests.MODULE.bazel.lock} $out/MODULE.bazel.lock
116
116
+
#cp ${WORKSPACE} $out/WORKSPACE
117
117
+
touch $out/WORKSPACE
118
118
+
touch $out/BUILD.bazel
119
119
+
mkdir $out/person
120
120
+
cp --no-preserve=all ${personProto} $out/person/person.proto
121
121
+
cp --no-preserve=all ${personBUILD} $out/person/BUILD.bazel
122
122
+
''
123
123
+
+ (lib.optionalString stdenv.isDarwin ''
124
124
+
echo 'tools bazel created'
125
125
+
mkdir $out/tools
126
126
+
install ${toolsBazel} $out/tools/bazel
127
127
+
''));
128
128
+
129
129
+
testBazel = bazelTest {
130
130
+
name = "bazel-test-protocol-buffers";
131
131
+
inherit workspaceDir;
132
132
+
bazelPkg = bazel;
133
133
+
buildInputs = [
134
134
+
(if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless)
135
135
+
tree
136
136
+
bazel
137
137
+
]
138
138
+
++ lib.optionals stdenv.hostPlatform.isDarwin [
139
139
+
Foundation
140
140
+
darwin.objc4
141
141
+
];
142
142
+
143
143
+
bazelScript = ''
144
144
+
# Augment bundled repository_cache with our extra paths
145
145
+
mkdir -p $PWD/.repository_cache/content_addressable
146
146
+
cp -r --no-preserve=all ${repoCache}/content_addressable/* \
147
147
+
$PWD/.repository_cache/content_addressable
148
148
+
cp -r --no-preserve=all ${protocbufRepoCache}/content_addressable/* \
149
149
+
$PWD/.repository_cache/content_addressable
150
150
+
151
151
+
tree $PWD/.repository_cache
152
152
+
153
153
+
${bazel}/bin/bazel \
154
154
+
build \
155
155
+
--repository_cache=$PWD/.repository_cache \
156
156
+
${extraBazelArgs} \
157
157
+
--enable_bzlmod \
158
158
+
--verbose_failures \
159
159
+
//... \
160
160
+
'' + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") ''
161
161
+
--host_javabase='@local_jdk//:jdk' \
162
162
+
--java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \
163
163
+
--javabase='@local_jdk//:jdk' \
164
164
+
'' + lib.optionalString (stdenv.isDarwin) ''
165
165
+
--cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \
166
166
+
--linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \
167
167
+
'';
168
168
+
#--cxxopt=-framework --cxxopt=Foundation \
169
169
+
#--linkopt=-F${Foundation}/Library/Frameworks \
170
170
+
#--host_linkopt=-F${Foundation}/Library/Frameworks \
171
171
+
172
172
+
#--distdir=$PWD/.repository_cache \
173
173
+
#--verbose_failures \
174
174
+
#--curses=no \
175
175
+
#--sandbox_debug \
176
176
+
#--strict_java_deps=off \
177
177
+
#--strict_proto_deps=off \
178
178
+
#--repository_cache=${repoCache} \
179
179
+
#--distdir=${repoCache} \
180
180
+
};
181
181
+
182
182
+
in
183
183
+
testBazel
+1
-1
pkgs/development/tools/build-managers/bazel/bazel_7/tests.nix
···
145
145
cpp = callBazelTest ../cpp-test.nix args;
146
146
java = callBazelTest ../java-test.nix args;
147
147
pythonBinPath = callBazelTest ../python-bin-path-test.nix args;
148
148
-
protobuf = callBazelTest ../protobuf-test.nix (args // { repoCache = testsRepoCache; });
148
148
+
protobuf = callBazelTest ./protobuf-test.nix (args // { repoCache = testsRepoCache; });
149
149
});
150
150
151
151
bazelWithNixHacks = bazel_self.override { enableNixHacks = true; };
+9
-11
pkgs/development/tools/build-managers/bazel/cpp-test.nix
···
1
1
-
{ bazel
1
1
+
{
2
2
+
bazel
2
3
, bazelTest
3
4
, bazel-examples
4
5
, stdenv
···
10
11
, writeScript
11
12
, writeText
12
13
, distDir
13
13
-
, Foundation
14
14
+
, Foundation ? null
14
15
}:
15
16
16
17
let
···
30
31
exec "$BAZEL_REAL" "$@"
31
32
'';
32
33
33
33
-
workspaceDir = runLocal "our_workspace" { } (''
34
34
+
workspaceDir = runLocal "our_workspace" {} (''
34
35
cp -r ${bazel-examples}/cpp-tutorial/stage3 $out
35
36
find $out -type d -exec chmod 755 {} \;
36
37
''
···
44
45
inherit workspaceDir;
45
46
bazelPkg = bazel;
46
47
bazelScript = ''
47
47
-
${bazel}/bin/bazel info output_base
48
48
${bazel}/bin/bazel build //... \
49
49
--verbose_failures \
50
50
-
--sandbox_debug \
51
50
--distdir=${distDir} \
52
51
--curses=no \
53
52
${extraBazelArgs} \
54
53
'' + lib.optionalString (stdenv.isDarwin) ''
55
55
-
--cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \
56
56
-
--linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \
57
57
-
--linkopt=-Wl,-F${Foundation}/Library/Frameworks \
58
58
-
--linkopt=-L${darwin.libobjc}/lib \
54
54
+
--cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \
55
55
+
--linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \
56
56
+
--linkopt=-Wl,-F${Foundation}/Library/Frameworks \
57
57
+
--linkopt=-L${darwin.libobjc}/lib \
59
58
'';
60
59
};
61
60
62
62
-
in
63
63
-
testBazel
61
61
+
in testBazel
+9
-18
pkgs/development/tools/build-managers/bazel/java-test.nix
···
31
31
exec "$BAZEL_REAL" "$@"
32
32
'';
33
33
34
34
-
workspaceDir = runLocal "our_workspace" { } (''
34
34
+
workspaceDir = runLocal "our_workspace" {} (''
35
35
cp -r ${bazel-examples}/java-tutorial $out
36
36
find $out -type d -exec chmod 755 {} \;
37
37
''
···
44
44
name = "bazel-test-java";
45
45
inherit workspaceDir;
46
46
bazelPkg = bazel;
47
47
-
buildInputs = [
48
48
-
(if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless)
49
49
-
];
47
47
+
buildInputs = [ (if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless) ];
50
48
bazelScript = ''
51
49
${bazel}/bin/bazel \
52
50
run \
53
51
--announce_rc \
54
54
-
--toolchain_resolution_debug='@bazel_tools//tools/jdk:(runtime_)?toolchain_type' \
52
52
+
${lib.optionalString (lib.strings.versionOlder "5.0.0" bazel.version)
53
53
+
"--toolchain_resolution_debug='@bazel_tools//tools/jdk:(runtime_)?toolchain_type'"
54
54
+
} \
55
55
--distdir=${distDir} \
56
56
--verbose_failures \
57
57
--curses=no \
58
58
--strict_java_deps=off \
59
59
//:ProjectRunner \
60
60
'' + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") ''
61
61
-
--host_javabase='@local_jdk//:jdk' \
62
62
-
--java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \
63
63
-
--javabase='@local_jdk//:jdk' \
61
61
+
--host_javabase='@local_jdk//:jdk' \
62
62
+
--java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \
63
63
+
--javabase='@local_jdk//:jdk' \
64
64
'' + extraBazelArgs;
65
65
};
66
66
67
67
-
# --repo_env=JAVA_HOME=${jdk11_headless}/${if stdenv.hostPlatform.isDarwin then "/zulu-17.jdk/Contents/Home" else "/lib/openjdk"} \
68
68
-
#--java_language_version=17 \
69
69
-
#--java_language_version=17 \
70
70
-
#--java_runtime_version=local_jdk \
71
71
-
# --java_language_version=11 \
72
72
-
# --tool_java_runtime_version=local_jdk_17 \
73
73
-
# --tool_java_language_version=17 \
74
74
-
#--java_runtime_version=local_jdk_11 \
75
75
-
in
76
76
-
testBazel
67
67
+
in testBazel
77
68
+89
-86
pkgs/development/tools/build-managers/bazel/protobuf-test.nix
···
1
1
-
{ bazel
1
1
+
{
2
2
+
bazel
2
3
, bazelTest
3
4
, fetchFromGitHub
4
5
, fetchurl
5
6
, stdenv
6
7
, darwin
7
7
-
, extraBazelArgs ? ""
8
8
, lib
9
9
, openjdk8
10
10
, jdk11_headless
···
13
13
, writeScript
14
14
, writeText
15
15
, distDir
16
16
-
, Foundation
17
17
-
, callPackage
18
18
-
, libtool
19
19
-
, lndir
20
20
-
, repoCache
21
21
-
, tree
22
16
}:
23
17
24
18
let
19
19
+
com_google_protobuf = fetchFromGitHub {
20
20
+
owner = "protocolbuffers";
21
21
+
repo = "protobuf";
22
22
+
rev = "v3.13.0";
23
23
+
sha256 = "1nqsvi2yfr93kiwlinz8z7c68ilg1j75b2vcpzxzvripxx5h6xhd";
24
24
+
};
25
25
26
26
-
lockfile = ./bazel_7/tests.MODULE.bazel.lock;
26
26
+
bazel_skylib = fetchFromGitHub {
27
27
+
owner = "bazelbuild";
28
28
+
repo = "bazel-skylib";
29
29
+
rev = "2ec2e6d715e993d96ad6222770805b5bd25399ae";
30
30
+
sha256 = "1z2r2vx6kj102zvp3j032djyv99ski1x1sl4i3p6mswnzrzna86s";
31
31
+
};
27
32
28
28
-
protocbufRepoCache = callPackage ./bazel_7/bazel-repository-cache.nix {
29
29
-
# We are somewhat lucky that bazel's own lockfile works for our tests.
30
30
-
# Use extraDeps if the tests need things that are not in that lockfile.
31
31
-
# But most test dependencies are bazel's builtin deps, so that at least aligns.
32
32
-
inherit lockfile;
33
33
+
rules_python = fetchFromGitHub {
34
34
+
owner = "bazelbuild";
35
35
+
repo = "rules_python";
36
36
+
rev = "c8c79aae9aa1b61d199ad03d5fe06338febd0774";
37
37
+
sha256 = "1zn58wv5wcylpi0xj7riw34i1jjpqahanxx8y9srwrv0v93b6pqz";
38
38
+
};
33
39
34
34
-
# Take all the rules_ deps, bazel_ deps and their transitive dependencies,
35
35
-
# but none of the platform-specific binaries, as they are large and useless.
36
36
-
requiredDepNamePredicate = name:
37
37
-
null == builtins.match ".*(macos|osx|linux|win|android|maven).*" name;
40
40
+
rules_proto = fetchFromGitHub {
41
41
+
owner = "bazelbuild";
42
42
+
repo = "rules_proto";
43
43
+
rev = "a0761ed101b939e19d83b2da5f59034bffc19c12";
44
44
+
sha256 = "09lqfj5fxm1fywxr5w8pnpqd859gb6751jka9fhxjxjzs33glhqf";
38
45
};
39
46
40
40
-
MODULE = writeText "MODULE.bazel" ''
41
41
-
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
42
42
-
bazel_dep(name = "protobuf", version = "21.7")
43
43
-
bazel_dep(name = "zlib", version = "1.3")
44
44
-
'';
47
47
+
net_zlib = fetchurl rec {
48
48
+
url = "https://zlib.net/zlib-1.2.11.tar.gz";
49
49
+
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1";
50
50
+
51
51
+
passthru.sha256 = sha256;
52
52
+
};
45
53
46
54
WORKSPACE = writeText "WORKSPACE" ''
47
55
workspace(name = "our_workspace")
48
56
57
57
+
load("//:proto-support.bzl", "protobuf_deps")
58
58
+
protobuf_deps()
59
59
+
load("@rules_proto//proto:repositories.bzl", "rules_proto_toolchains")
60
60
+
rules_proto_toolchains()
61
61
+
'';
62
62
+
63
63
+
protoSupport = writeText "proto-support.bzl" ''
64
64
+
"""Load dependencies needed to compile the protobuf library as a 3rd-party consumer."""
65
65
+
49
66
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
50
67
51
51
-
http_archive(
52
52
-
name = "rules_proto",
53
53
-
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
54
54
-
strip_prefix = "rules_proto-5.3.0-21.7",
55
55
-
urls = [
56
56
-
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
57
57
-
],
58
58
-
)
59
59
-
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
60
60
-
rules_proto_dependencies()
61
61
-
rules_proto_toolchains()
68
68
+
def protobuf_deps():
69
69
+
"""Loads common dependencies needed to compile the protobuf library."""
70
70
+
71
71
+
if "zlib" not in native.existing_rules():
72
72
+
# proto_library, cc_proto_library, and java_proto_library rules implicitly
73
73
+
# depend on @com_google_protobuf for protoc and proto runtimes.
74
74
+
# This statement defines the @com_google_protobuf repo.
75
75
+
native.local_repository(
76
76
+
name = "com_google_protobuf",
77
77
+
path = "${com_google_protobuf}",
78
78
+
)
79
79
+
native.local_repository(
80
80
+
name = "bazel_skylib",
81
81
+
path = "${bazel_skylib}",
82
82
+
)
83
83
+
native.local_repository(
84
84
+
name = "rules_proto",
85
85
+
path = "${rules_proto}",
86
86
+
)
87
87
+
native.local_repository(
88
88
+
name = "rules_python",
89
89
+
path = "${rules_python}",
90
90
+
)
91
91
+
92
92
+
http_archive(
93
93
+
name = "zlib",
94
94
+
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
95
95
+
sha256 = "${net_zlib.sha256}",
96
96
+
strip_prefix = "zlib-1.2.11",
97
97
+
urls = ["file://${net_zlib}"],
98
98
+
)
62
99
'';
63
100
64
101
personProto = writeText "person.proto" ''
···
105
142
# See: https://github.com/bazelbuild/bazel/issues/4231
106
143
export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
107
144
108
108
-
export HOMEBREW_RUBY_PATH="foo"
109
109
-
110
145
exec "$BAZEL_REAL" "$@"
111
146
'';
112
147
113
113
-
workspaceDir = runLocal "our_workspace" { } (''
148
148
+
workspaceDir = runLocal "our_workspace" {} (''
114
149
mkdir $out
115
115
-
cp --no-preserve=all ${MODULE} $out/MODULE.bazel
116
116
-
cp --no-preserve=all ${./bazel_7/tests.MODULE.bazel.lock} $out/MODULE.bazel.lock
117
117
-
#cp ${WORKSPACE} $out/WORKSPACE
118
118
-
touch $out/WORKSPACE
150
150
+
cp ${WORKSPACE} $out/WORKSPACE
119
151
touch $out/BUILD.bazel
152
152
+
cp ${protoSupport} $out/proto-support.bzl
120
153
mkdir $out/person
121
121
-
cp --no-preserve=all ${personProto} $out/person/person.proto
122
122
-
cp --no-preserve=all ${personBUILD} $out/person/BUILD.bazel
154
154
+
cp ${personProto} $out/person/person.proto
155
155
+
cp ${personBUILD} $out/person/BUILD.bazel
123
156
''
124
157
+ (lib.optionalString stdenv.isDarwin ''
125
125
-
echo 'tools bazel created'
126
158
mkdir $out/tools
127
127
-
install ${toolsBazel} $out/tools/bazel
159
159
+
cp ${toolsBazel} $out/tools/bazel
128
160
''));
129
161
130
162
testBazel = bazelTest {
131
163
name = "bazel-test-protocol-buffers";
132
164
inherit workspaceDir;
133
165
bazelPkg = bazel;
134
134
-
buildInputs = [
135
135
-
(if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless)
136
136
-
tree
137
137
-
bazel
138
138
-
]
139
139
-
++ lib.optionals stdenv.hostPlatform.isDarwin [
140
140
-
Foundation
141
141
-
darwin.objc4
142
142
-
];
143
143
-
166
166
+
buildInputs = [ (if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless) ];
144
167
bazelScript = ''
145
145
-
# Augment bundled repository_cache with our extra paths
146
146
-
mkdir -p $PWD/.repository_cache/content_addressable
147
147
-
cp -r --no-preserve=all ${repoCache}/content_addressable/* \
148
148
-
$PWD/.repository_cache/content_addressable
149
149
-
cp -r --no-preserve=all ${protocbufRepoCache}/content_addressable/* \
150
150
-
$PWD/.repository_cache/content_addressable
151
151
-
152
152
-
tree $PWD/.repository_cache
153
153
-
154
168
${bazel}/bin/bazel \
155
169
build \
156
156
-
--repository_cache=$PWD/.repository_cache \
157
157
-
${extraBazelArgs} \
158
158
-
--enable_bzlmod \
170
170
+
--distdir=${distDir} \
159
171
--verbose_failures \
172
172
+
--curses=no \
173
173
+
--sandbox_debug \
174
174
+
--strict_java_deps=off \
175
175
+
--strict_proto_deps=off \
160
176
//... \
161
177
'' + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") ''
162
162
-
--host_javabase='@local_jdk//:jdk' \
163
163
-
--java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \
164
164
-
--javabase='@local_jdk//:jdk' \
178
178
+
--host_javabase='@local_jdk//:jdk' \
179
179
+
--java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \
180
180
+
--javabase='@local_jdk//:jdk' \
165
181
'' + lib.optionalString (stdenv.isDarwin) ''
166
166
-
--cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \
167
167
-
--linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \
182
182
+
--cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \
183
183
+
--linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \
168
184
'';
169
169
-
#--cxxopt=-framework --cxxopt=Foundation \
170
170
-
#--linkopt=-F${Foundation}/Library/Frameworks \
171
171
-
#--host_linkopt=-F${Foundation}/Library/Frameworks \
172
172
-
173
173
-
#--distdir=$PWD/.repository_cache \
174
174
-
#--verbose_failures \
175
175
-
#--curses=no \
176
176
-
#--sandbox_debug \
177
177
-
#--strict_java_deps=off \
178
178
-
#--strict_proto_deps=off \
179
179
-
#--repository_cache=${repoCache} \
180
180
-
#--distdir=${repoCache} \
181
185
};
182
186
183
183
-
in
184
184
-
testBazel
187
187
+
in testBazel
-1
pkgs/development/tools/build-managers/bazel/shebang-test.nix
···
22
22
bazelPkg = bazel;
23
23
bazelScript = ''
24
24
set -ueo pipefail
25
25
-
26
25
FAIL=
27
26
check_shebangs() {
28
27
local dir="$1"