From 6d164984a90356a57c39389a53bf7062c2b86de7 Mon Sep 17 00:00:00 2001
From: Guillaume Maudoux None
Constraints for the target platform.
+
register
True
+
+
+
+bool, whether the underlying toolchain should be automatically registered with
+register_toolchains
. Useful when you need a more advanced
+toolchain configuration than the one provided here.
+
True
bool, whether the underlying toolchain should be automatically registered with
register_toolchains
. Useful when you need a more advanced
-toolchain configuration than the one provided here.
+toolchain configuration than the one provided here and do not want this partial
+toolchain to be registered as-is.
diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl
index 01552c920..b920d8ba6 100644
--- a/nixpkgs/nixpkgs.bzl
+++ b/nixpkgs/nixpkgs.bzl
@@ -719,11 +719,6 @@ def nixpkgs_cc_configure(
fail_not_supported = fail_not_supported,
)
- # Stop before generating the toolchain. The only point of not registering it
- # is because it is not used.
- if (not register):
- return
-
# Generate the `cc_toolchain` workspace.
if (exec_constraints == None) != (target_constraints == None):
fail("Both exec_constraints and target_constraints need to be provided or none of them.")
@@ -734,12 +729,13 @@ def nixpkgs_cc_configure(
target_constraints = target_constraints,
)
- maybe(
- native.bind,
- name = "cc_toolchain",
- actual = "@{}//:toolchain".format(name),
- )
- native.register_toolchains("@{}_toolchains//:all".format(name))
+ if register:
+ maybe(
+ native.bind,
+ name = "cc_toolchain",
+ actual = "@{}//:toolchain".format(name),
+ )
+ native.register_toolchains("@{}_toolchains//:all".format(name))
def _readlink(repository_ctx, path):
return repository_ctx.path(path).realpath
From ce1a031a52a3d5a088cb0341e6e77a85855385f1 Mon Sep 17 00:00:00 2001
From: Guillaume Maudoux nixpkgs_cc_configure(name, attribute_path, nix_file, nix_file_content, nix_file_deps, repositories, repository, nixopts, quiet, fail_not_supported, exec_constraints, - target_constraints) + target_constraints, register)Use a CC toolchain from Nixpkgs. No-op if not a nix-based platform. @@ -441,10 +441,7 @@ default is
True
-bool, whether the underlying toolchain should be automatically registered with
-register_toolchains
. Useful when you need a more advanced
-toolchain configuration than the one provided here and do not want this partial
-toolchain to be registered as-is.
+bool, enabled by default, Whether to register (with `register_toolchains`) the generated toolchain and install it as the default cc_toolchain.