Skip to content

Commit

Permalink
Use hermetic toolchain in compatibility workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
aherrmann committed May 18, 2020
1 parent 4408eca commit f0fb522
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions compatibility/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ load(
)
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_cc_configure",
"nixpkgs_cc_configure_hermetic",
"nixpkgs_local_repository",
"nixpkgs_package",
"nixpkgs_python_configure",
Expand Down Expand Up @@ -78,14 +78,17 @@ nixpkgs_local_repository(
],
)

nixpkgs_cc_configure(
nixpkgs_cc_configure_hermetic(
# We override the Bazel's autodetect toolchain to avoid accidentaly
# dependencies on the inhermetic autodetected builtin include paths or
# builds failing due to Bazel not finding `cc` in `$PATH` or `$CC`.
name = "local_config_cc",
nix_file = "@daml//nix:bazel-cc-toolchain.nix",
nix_file_deps = common_nix_file_deps + [
"@daml//nix:bazel-cc-toolchain.nix",
"@daml//nix:tools/bazel-cc-toolchain/default.nix",
],
repositories = dev_env_nix_repos,
)
) if not is_windows else None

nixpkgs_package(
name = "glibc_locales",
Expand Down
6 changes: 6 additions & 0 deletions compatibility/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def daml_deps():
strip_prefix = "rules_nixpkgs-%s" % rules_nixpkgs_version,
urls = ["https://github.com/tweag/rules_nixpkgs/archive/%s.tar.gz" % rules_nixpkgs_version],
sha256 = rules_nixpkgs_sha256,
patches = [
# Remove once https://github.com/tweag/rules_nixpkgs/pull/128
# has been merged
"@daml//bazel_tools:nixpkgs-hermetic-cc-toolchain.patch",
],
patch_args = ["-p1"],
)

if "com_github_bazelbuild_buildtools" not in native.existing_rules():
Expand Down

0 comments on commit f0fb522

Please sign in to comment.