summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2023-09-20 08:51:41 -0700
committerGitHub <noreply@github.com>2023-09-20 15:51:41 +0000
commitfeb90e8e7a92381001cf2f2052a7fd982b28ee26 (patch)
treef6f33e1335c85d2956d01c442b49dec5d1657d16
parentb360aacf281c9fc407d0f624518302bebb711d8a (diff)
downloadbazelbuild-apple_support-feb90e8e7a92381001cf2f2052a7fd982b28ee26.tar.gz
Add very basic linux CI (#264)upstream/1.10.1
You can build univeral_binary targets on Linux and they just passthrough. This validates we don't break that.
-rw-r--r--.bazelci/presubmit.yml28
-rw-r--r--.bazelrc8
-rw-r--r--lib/transitions.bzl5
3 files changed, 19 insertions, 22 deletions
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index b474952..57c5e3e 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -10,15 +10,10 @@ x_defaults:
test_targets:
- "//..."
- toolchain_flags: &toolchain_flags
- build_flags:
- - "--apple_crosstool_top=@local_config_apple_cc//:toolchain"
- - "--crosstool_top=@local_config_apple_cc//:toolchain"
- - "--host_crosstool_top=@local_config_apple_cc//:toolchain"
- test_flags:
- - "--apple_crosstool_top=@local_config_apple_cc//:toolchain"
- - "--crosstool_top=@local_config_apple_cc//:toolchain"
- - "--host_crosstool_top=@local_config_apple_cc//:toolchain"
+ linux_common: &linux_common
+ platform: ubuntu2004
+ build_targets:
+ - "//test/test_data:multi_arch_cc_binary"
tasks:
macos_latest:
@@ -29,7 +24,6 @@ tasks:
macos_latest_bzlmod:
name: "Current LTS using bzlmod"
bazel: latest
- <<: *toolchain_flags
<<: *common
build_targets:
- "//..."
@@ -58,16 +52,14 @@ tasks:
- .bazelci/update_workspace_to_deps_heads.sh
<<: *common
- macos_latest_vendored_toolchain:
- name: "Latest Bazel vendored toolchain"
+ linux_latest:
+ name: "Current LTS on Linux"
bazel: latest
- <<: *common
- <<: *toolchain_flags
+ <<: *linux_common
- macos_last_green_vendored_toolchain:
- name: "Last Green Bazel vendored toolchain"
+ linux_last_green:
+ name: "last_green on Linux"
bazel: last_green
- <<: *common
- <<: *toolchain_flags
+ <<: *linux_common
buildifier: latest
diff --git a/.bazelrc b/.bazelrc
index b6ac081..6716d81 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,4 +1,6 @@
-build --apple_crosstool_top=@local_config_apple_cc//:toolchain
-build --crosstool_top=@local_config_apple_cc//:toolchain
-build --host_crosstool_top=@local_config_apple_cc//:toolchain
+build --enable_platform_specific_config
build --features=treat_warnings_as_errors
+
+build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain
+build:macos --crosstool_top=@local_config_apple_cc//:toolchain
+build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain
diff --git a/lib/transitions.bzl b/lib/transitions.bzl
index 08726c6..2bcfabc 100644
--- a/lib/transitions.bzl
+++ b/lib/transitions.bzl
@@ -32,7 +32,10 @@ def _macos_universal_transition_impl(settings, _attr):
},
]
else:
- return settings
+ return {
+ "//command_line_option:cpu": settings["//command_line_option:cpu"],
+ "//command_line_option:platforms": settings["//command_line_option:platforms"],
+ }
macos_universal_transition = transition(
implementation = _macos_universal_transition_impl,