Skip to content

Commit

Permalink
Bump rules_pkg dep to 0.9.1 to fix build with --incompatible_config_s…
Browse files Browse the repository at this point in the history
…etting_private_default_visibility (#452)

Required for Bazel 7 compatibility.

Note that rules_pkg 0.9.1 requires Python 3.6 or newer as the system's Python 3; this means we cannot build //distribution on Ubuntu 16.04 any more (which is fine, since it only affects the skylib developer workflow; users of skylib on Ubuntu 16.04 are not affected). Update CI config accordingly.

Fixes #414
  • Loading branch information
tetromino authored Aug 8, 2023
1 parent 288731e commit 6fcbad3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
43 changes: 37 additions & 6 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,40 @@ tasks:
platform: ubuntu1804
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--test_env=PATH"

ubuntu1604_latest:
<<: *reusable_config
name: "Latest Bazel"
platform: ubuntu1604
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
build_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."
test_flags:
- "--test_env=PATH"
test_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."

macos_latest:
<<: *reusable_config
name: "Latest Bazel"
platform: macos
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--test_env=PATH"
Expand All @@ -46,6 +60,7 @@ tasks:
platform: windows
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
# TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
Expand All @@ -59,26 +74,40 @@ tasks:
platform: ubuntu1804
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--test_env=PATH"

ubuntu1604_last_green:
<<: *reusable_config
name: "Last Green Bazel"
platform: ubuntu1604
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
build_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."
test_flags:
- "--test_env=PATH"
test_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."

macos_last_green:
<<: *reusable_config
name: "Last Green Bazel"
platform: macos
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--test_env=PATH"
Expand All @@ -89,6 +118,7 @@ tasks:
platform: windows
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
# TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
Expand All @@ -102,10 +132,11 @@ tasks:
platform: ubuntu1804
bazel: last_green
build_flags:
- "--incompatible_disallow_empty_glob"
- "--experimental_enable_bzlmod"
- "--enable_bzlmod"
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--experimental_enable_bzlmod"
- "--test_env=PATH"
- "--enable_bzlmod"
- "--test_env=PATH"

buildifier: latest
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bazel_dep(name = "platforms", version = "0.0.4")

# Build-only / test-only dependencies
bazel_dep(name = "stardoc", version = "0.5.6", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "rules_pkg", version = "0.7.0", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "0.9.1", dev_dependency = True)
bazel_dep(name = "rules_cc", version = "0.0.2", dev_dependency = True)

# Needed for bazelci and for building distribution tarballs.
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ stardoc_repositories()
maybe(
http_archive,
name = "rules_pkg",
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
],
)

Expand Down

0 comments on commit 6fcbad3

Please sign in to comment.