aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Moffett <kyle@moffetthome.net>2023-09-26 08:43:45 -0600
committerGitHub <noreply@github.com>2023-09-26 10:43:45 -0400
commit4b2312bc8e488eecca446137abe9e0df963d3253 (patch)
tree5dd303724823165f0f99a7aaae82a7f185baedbe
parent4ad40ef271da8176d4fc0194d2089b8a76e19d7b (diff)
downloadbazelbuild-platforms-4b2312bc8e488eecca446137abe9e0df963d3253.tar.gz
Bazel Platforms: Add `//cpu:any` constraint value for arch-indep builds (#75)
* Bazel Platforms: Add `//cpu:any` constraint value for arch-indep builds Some builds are expected to only produce architecture-independent data files, such as configuration files, database seed data, composited images, or even some kinds of interpreted scripts (Shell, Python, Perl, etc). When such a build is being performed, this constraint value may be used to ensure that architecture-dependent builds cannot be performed (except by way of another transition). As a final example, consider building a package of NIC firmware images for many different NIC models. The package overall is architecture-independent, and should be built with `//cpu:any`, then each individual image rule has a transition to the suitable architecture for that specific NIC model. * Update BUILD Changed "any" to "all" * Update BUILD Fix comment --------- Co-authored-by: aiuto <aiuto@google.com>
-rw-r--r--cpu/BUILD19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpu/BUILD b/cpu/BUILD
index 729d711..9670e0c 100644
--- a/cpu/BUILD
+++ b/cpu/BUILD
@@ -30,6 +30,25 @@ constraint_setting(name = "cpu")
# Many of the name here are legacy values and probably violate these conditions.
# We'll try to clean those up over time.
+# Special case: Architecture-independent outputs only
+#
+# Some builds are expected to only produce architecture-independent data files,
+# such as configuration files, database seed data, composited images, or even
+# some kinds of interpreted scripts (Shell, Python, Perl, etc).
+#
+# When such a build is being performed, this constraint value may be used to
+# ensure that architecture-dependent builds cannot be performed (except by way
+# of another transition).
+#
+# As a final example, consider building a package of NIC firmware images for
+# many different NIC models. The package overall is architecture-independent,
+# and should be built with `//cpu:all`, then each individual image rule has a
+# transition to the suitable architecture for that specific NIC model.
+constraint_value(
+ name = "all",
+ constraint_setting = ":cpu",
+)
+
constraint_value(
name = "aarch32",
constraint_setting = ":cpu",