Skip to content

Commit

Permalink
Test basic-gazelle example with incompatible flags (bazelbuild#3575)
Browse files Browse the repository at this point in the history
Also update the version of Gazelle used by the example to get rid of a
usage of `cfg = "host"`.
  • Loading branch information
fmeum authored and jacqueline.lee committed Jul 19, 2023
1 parent 8740bd6 commit ef3b625
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
28 changes: 8 additions & 20 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,9 @@ tasks:
platform: ubuntu2004
working_directory: examples/basic-gazelle
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_enforce_config_setting_visibility"
- "--config=incompatible"
test_flags:
- "--config=incompatible"
build_targets:
- "//..."
test_targets:
Expand All @@ -343,8 +344,9 @@ tasks:
platform: macos
working_directory: examples/basic-gazelle
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_enforce_config_setting_visibility"
- "--config=incompatible"
test_flags:
- "--config=incompatible"
build_targets:
- "//..."
test_targets:
Expand All @@ -354,33 +356,19 @@ tasks:
platform: windows
working_directory: examples/basic-gazelle
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_enforce_config_setting_visibility"
- "--config=incompatible"
# Go requires a C toolchain that accepts options and emits errors like
# gcc or clang. The Go SDK does not support MSVC.
- "--cpu=x64_windows"
- "--compiler=mingw-gcc"
- '--action_env=PATH=C:\tools\msys64\usr\bin;C:\tools\msys64\bin;C:\tools\msys64\mingw64\bin;C:\python3\Scripts\;C:\python3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\tools\msys64\usr\bin;c:\openjdk\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\CMake\bin;c:\ninja;c:\bazel;c:\buildkite'
# NOTE(bazelbuild/bazel#10529): bazel doesn't register the mingw toolchain automatically.
# We also need the host and target platforms to have the mingw constraint value.
- "--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows_mingw"
- "--host_platform=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
- "--platforms=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
- "--incompatible_enable_cc_toolchain_resolution"
build_targets:
- "//..."
test_targets:
- "//..."
test_flags:
# Go requires a C toolchain that accepts options and emits errors like
# gcc or clang. The Go SDK does not support MSVC.
- "--cpu=x64_windows"
- "--compiler=mingw-gcc"
- "--config=incompatible"
- '--action_env=PATH=C:\tools\msys64\usr\bin;C:\tools\msys64\bin;C:\tools\msys64\mingw64\bin;C:\python3\Scripts\;C:\python3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\tools\msys64\usr\bin;c:\openjdk\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\CMake\bin;c:\ninja;c:\bazel;c:\buildkite'
- "--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows_mingw"
- "--host_platform=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
- "--platforms=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
- "--incompatible_enable_cc_toolchain_resolution"
# On Windows CI, bazel (bazelisk) needs %LocalAppData% to find the cache directory.
# We invoke bazel in tests, so the tests need this, too.
- "--test_env=LOCALAPPDATA"
Expand Down
1 change: 1 addition & 0 deletions examples/basic-gazelle/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import %workspace%/../../.bazelrc
6 changes: 3 additions & 3 deletions examples/basic-gazelle/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ http_archive(
# Download the bazel_gazelle ruleset.
http_archive(
name = "bazel_gazelle",
sha256 = "efbbba6ac1a4fd342d5122cbdfdb82aeb2cf2862e35022c752eaddffada7c3f3",
sha256 = "727f3e4edd96ea20c29e8c2ca9e8d2af724d8c7778e7923a854b2c80952bc405",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.27.0/bazel-gazelle-v0.27.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.27.0/bazel-gazelle-v0.27.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
],
)

Expand Down

0 comments on commit ef3b625

Please sign in to comment.