Skip to content

Commit a8df597

Browse files
committed
Test basic-gazelle example with incompatible flags
Also update the version of Gazelle used by the example to get rid of a usage of `cfg = "host"`.
1 parent f2dcbd6 commit a8df597

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

.bazelci/presubmit.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ tasks:
332332
platform: ubuntu2004
333333
working_directory: examples/basic-gazelle
334334
build_flags:
335-
- "--incompatible_config_setting_private_default_visibility"
336-
- "--incompatible_enforce_config_setting_visibility"
335+
- "--config=incompatible"
336+
test_flags:
337+
- "--config=incompatible"
337338
build_targets:
338339
- "//..."
339340
test_targets:
@@ -343,8 +344,9 @@ tasks:
343344
platform: macos
344345
working_directory: examples/basic-gazelle
345346
build_flags:
346-
- "--incompatible_config_setting_private_default_visibility"
347-
- "--incompatible_enforce_config_setting_visibility"
347+
- "--config=incompatible"
348+
test_flags:
349+
- "--config=incompatible"
348350
build_targets:
349351
- "//..."
350352
test_targets:
@@ -354,33 +356,19 @@ tasks:
354356
platform: windows
355357
working_directory: examples/basic-gazelle
356358
build_flags:
357-
- "--incompatible_config_setting_private_default_visibility"
358-
- "--incompatible_enforce_config_setting_visibility"
359+
- "--config=incompatible"
359360
# Go requires a C toolchain that accepts options and emits errors like
360361
# gcc or clang. The Go SDK does not support MSVC.
361-
- "--cpu=x64_windows"
362-
- "--compiler=mingw-gcc"
363362
- '--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'
364363
# NOTE(bazelbuild/bazel#10529): bazel doesn't register the mingw toolchain automatically.
365364
# We also need the host and target platforms to have the mingw constraint value.
366-
- "--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows_mingw"
367-
- "--host_platform=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
368-
- "--platforms=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
369-
- "--incompatible_enable_cc_toolchain_resolution"
370365
build_targets:
371366
- "//..."
372367
test_targets:
373368
- "//..."
374369
test_flags:
375-
# Go requires a C toolchain that accepts options and emits errors like
376-
# gcc or clang. The Go SDK does not support MSVC.
377-
- "--cpu=x64_windows"
378-
- "--compiler=mingw-gcc"
370+
- "--config=incompatible"
379371
- '--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'
380-
- "--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows_mingw"
381-
- "--host_platform=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
382-
- "--platforms=@io_bazel_rules_go//go/toolchain:windows_amd64_cgo"
383-
- "--incompatible_enable_cc_toolchain_resolution"
384372
# On Windows CI, bazel (bazelisk) needs %LocalAppData% to find the cache directory.
385373
# We invoke bazel in tests, so the tests need this, too.
386374
- "--test_env=LOCALAPPDATA"

examples/basic-gazelle/.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import %workspace%/../../.bazelrc

examples/basic-gazelle/WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ http_archive(
1616
# Download the bazel_gazelle ruleset.
1717
http_archive(
1818
name = "bazel_gazelle",
19-
sha256 = "efbbba6ac1a4fd342d5122cbdfdb82aeb2cf2862e35022c752eaddffada7c3f3",
19+
sha256 = "727f3e4edd96ea20c29e8c2ca9e8d2af724d8c7778e7923a854b2c80952bc405",
2020
urls = [
21-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.27.0/bazel-gazelle-v0.27.0.tar.gz",
22-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.27.0/bazel-gazelle-v0.27.0.tar.gz",
21+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
22+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.30.0/bazel-gazelle-v0.30.0.tar.gz",
2323
],
2424
)
2525

0 commit comments

Comments
 (0)