···1-# The Bazel build tool
2-3-https://bazel.build/
4-5-The bazel tool requires regular maintenance, especially under darwin, so we created a maintainers team.
6-7-Please ping @NixOS/bazel in your github PR/issue to increase your chance of a quick turnaround, thanks!
···369 # On Darwin, the last argument to gcc is coming up as an empty string. i.e: ''
370 # This is breaking the build of any C target. This patch removes the last
371 # argument if it's found to be an empty string.
372- ../trim-last-argument-to-gcc-if-empty.patch
373374 # --experimental_strict_action_env (which may one day become the default
375 # see bazelbuild/bazel#2574) hardcodes the default
···377 # This is non hermetic on non-nixos systems. On NixOS, bazel cannot find the required binaries.
378 # So we are replacing this bazel paths by defaultShellPath,
379 # improving hermeticity and making it work in nixos.
380- (replaceVars ../strict_action_env.patch {
381 strictActionEnvPatch = defaultShellPath;
382 })
383384 # bazel reads its system bazelrc in /etc
385 # override this path to a builtin one
386- (replaceVars ../bazel_rc.patch {
387 bazelSystemBazelRCPath = bazelRC;
388 })
389 ]
···369 # On Darwin, the last argument to gcc is coming up as an empty string. i.e: ''
370 # This is breaking the build of any C target. This patch removes the last
371 # argument if it's found to be an empty string.
372+ ./trim-last-argument-to-gcc-if-empty.patch
373374 # --experimental_strict_action_env (which may one day become the default
375 # see bazelbuild/bazel#2574) hardcodes the default
···377 # This is non hermetic on non-nixos systems. On NixOS, bazel cannot find the required binaries.
378 # So we are replacing this bazel paths by defaultShellPath,
379 # improving hermeticity and making it work in nixos.
380+ (replaceVars ./strict_action_env.patch {
381 strictActionEnvPatch = defaultShellPath;
382 })
383384 # bazel reads its system bazelrc in /etc
385 # override this path to a builtin one
386+ (replaceVars ./bazel_rc.patch {
387 bazelSystemBazelRCPath = bazelRC;
388 })
389 ]
···1-#!/usr/bin/env python3
2-import sys
3-import json
4-5-if len(sys.argv) == 1:
6- print("usage: ./this-script WORKSPACE", file=sys.stderr)
7- print("Takes the bazel WORKSPACE file and reads all archives into a json dict (by evaling it as python code)", file=sys.stderr)
8- print("Hail Eris.", file=sys.stderr)
9- sys.exit(1)
10-11-http_archives = []
12-13-# just the kw args are the dict { name, sha256, urls … }
14-def http_archive(**kw):
15- http_archives.append(kw)
16-# like http_file
17-def http_file(**kw):
18- http_archives.append(kw)
19-20-# this is inverted from http_archive/http_file and bundles multiple archives
21-def distdir_tar(**kw):
22- for archive_name in kw['archives']:
23- http_archives.append({
24- "name": archive_name,
25- "sha256": kw['sha256'][archive_name],
26- "urls": kw['urls'][archive_name]
27- })
28-29-# stubs for symbols we are not interested in
30-# might need to be expanded if new bazel releases add symbols to the workspace
31-def workspace(name): pass
32-def load(*args): pass
33-def bind(**kw): pass
34-def list_source_repository(**kw): pass
35-def new_local_repository(**kw): pass
36-def local_repository(**kw): pass
37-DOC_VERSIONS = []
38-def stardoc_repositories(**kw): pass
39-def skydoc_repositories(**kw): pass
40-def rules_sass_dependencies(**kw): pass
41-def node_repositories(**kw): pass
42-def sass_repositories(**kw): pass
43-def register_execution_platforms(*args): pass
44-def rbe_autoconfig(*args, **kw): pass
45-def rules_pkg_dependencies(*args, **kw): pass
46-def winsdk_configure(*args, **kw): pass
47-def register_local_rc_exe_toolchains(*args, **kw): pass
48-def register_toolchains(*args, **kw): pass
49-def debian_deps(): pass
50-def grpc_deps(): pass
51-def grpc_extra_deps(): pass
52-def bazel_skylib_workspace(): pass
53-54-# execute the WORKSPACE like it was python code in this module,
55-# using all the function stubs from above.
56-with open(sys.argv[1]) as f:
57- exec(f.read())
58-59-# transform to a dict with the names as keys
60-d = { el['name']: el for el in http_archives }
61-62-print(json.dumps(d, sort_keys=True, indent=4))