Skip to content

Commit

Permalink
chore(deps): update dependency bazel to v8.0.0 (#410)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency bazel to v8.0.0

* Fix archive_override urls attribute type

* Set --enable_workspace when --noenable_bzlmod is set

* Update rules_java to 8.6.2 in WORKSPACE mode

* Set and use repo name for runfiles integration tests

This addresses bazelbuild/bazel#24717.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andreas Herrmann <[email protected]>
  • Loading branch information
renovate[bot] and aherrmann authored Dec 18, 2024
1 parent 45687ad commit 2385047
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
8.0.0-pre.20240607.2
8.0.0
# The first line of this file is used by Bazelisk and Bazel to be sure
# the right version of Bazel is used to build and test this repo.
# This also defines which version is used on CI.
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ runs:

- name: Set bzlmod flag
working-directory: ${{ inputs.folder }}
# Set --enable_bzlmod if bzlmodEnabled is true, else --noenable_bzlmod.
# Set --enable_bzlmod if bzlmodEnabled is true, else --noenable_bzlmod and --enable_workspace.
id: set_bzlmod_flag
shell: bash
run: |
echo "common ${{ inputs.bzlmodEnabled == 'true' && '--enable_bzlmod' || '--noenable_bzlmod' }}" >> .bazelrc.user
echo "bzlmod_flag=${{ inputs.bzlmodEnabled == 'true' && '--enable_bzlmod' || '--noenable_bzlmod' }}" >> $GITHUB_OUTPUT
echo "common ${{ inputs.bzlmodEnabled == 'true' && '--enable_bzlmod' || '--noenable_bzlmod --enable_workspace' }}" >> .bazelrc.user
echo "bzlmod_flag=${{ inputs.bzlmodEnabled == 'true' && '--enable_bzlmod' || '--noenable_bzlmod --enable_workspace' }}" >> $GITHUB_OUTPUT
- name: Configure documentation generation
if: inputs.folder == '.' && inputs.targetPattern == '//...'
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ archive_override(
module_name = "toolchains_buildbuddy",
integrity = "sha256-UA+poYaWFbPxgtoA2re4mX89c3/8yYchpKwr4pvvGOw=",
strip_prefix = "buildbuddy-toolchain-ffd296b7a9821174cdb2188d1373fd262cacb09d",
urls = "https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/ffd296b7a9821174cdb2188d1373fd262cacb09d.tar.gz",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/ffd296b7a9821174cdb2188d1373fd262cacb09d.tar.gz"],
)

buildbuddy = use_extension(
Expand Down
14 changes: 14 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ zig_register_toolchains(
zig_versions = TOOL_VERSIONS.keys(),
)

# rules_java dependencies
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")

rules_java_dependencies()

load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility

proto_bazel_features(name = "proto_bazel_features")

load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

rules_java_toolchains()

# buildbuddy_toolchain dependencies
load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps")

buildbuddy_deps()
Expand Down
2 changes: 1 addition & 1 deletion e2e/workspace/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ archive_override(
module_name = "toolchains_buildbuddy",
integrity = "sha256-UA+poYaWFbPxgtoA2re4mX89c3/8yYchpKwr4pvvGOw=",
strip_prefix = "buildbuddy-toolchain-ffd296b7a9821174cdb2188d1373fd262cacb09d",
urls = "https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/ffd296b7a9821174cdb2188d1373fd262cacb09d.tar.gz",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/ffd296b7a9821174cdb2188d1373fd262cacb09d.tar.gz"],
)

buildbuddy = use_extension(
Expand Down
20 changes: 20 additions & 0 deletions e2e/workspace/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ aspect_bazel_lib_dependencies()

aspect_bazel_lib_register_toolchains()

http_archive(
name = "rules_java",
sha256 = "a64ab04616e76a448c2c2d8165d836f0d2fb0906200d0b7c7376f46dd62e59cc",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/8.6.2/rules_java-8.6.2.tar.gz",
],
)

load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")

rules_java_dependencies()

load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility

proto_bazel_features(name = "proto_bazel_features")

load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

rules_java_toolchains()

http_archive(
name = "io_buildbuddy_buildbuddy_toolchain",
sha256 = "8cb7ccd18c226647fda5a98a0ae187d4857d134c7db25e2eb239de11d8a82a73",
Expand Down
8 changes: 8 additions & 0 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ def http_file(name, **kwargs):

def rules_zig_internal_deps():
"Fetch deps needed for local development"
http_archive(
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/8.6.2/rules_java-8.6.2.tar.gz",
],
sha256 = "a64ab04616e76a448c2c2d8165d836f0d2fb0906200d0b7c7376f46dd62e59cc",
)

http_archive(
name = "io_bazel_rules_go",
sha256 = "0936c9bc3c4321ee372cb8f66dd972d368cb940ed01a9ba9fd7debcf0093f09b",
Expand Down
4 changes: 3 additions & 1 deletion zig/tests/integration_tests/workspace/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module(name = "integration_tests")

bazel_dep(name = "rules_zig", version = "0.0.0")
bazel_dep(name = "platforms", version = "0.0.6")

Expand Down Expand Up @@ -25,7 +27,7 @@ archive_override(
module_name = "toolchains_buildbuddy",
integrity = "sha256-UA+poYaWFbPxgtoA2re4mX89c3/8yYchpKwr4pvvGOw=",
strip_prefix = "buildbuddy-toolchain-ffd296b7a9821174cdb2188d1373fd262cacb09d",
urls = "https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/ffd296b7a9821174cdb2188d1373fd262cacb09d.tar.gz",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/ffd296b7a9821174cdb2188d1373fd262cacb09d.tar.gz"],
)

buildbuddy = use_extension(
Expand Down
2 changes: 2 additions & 0 deletions zig/tests/integration_tests/workspace/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
workspace(name = "integration_tests")

local_repository(
name = "rules_zig",
path = "../../../..",
Expand Down
2 changes: 1 addition & 1 deletion zig/tests/integration_tests/workspace/runfiles/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn main() !void {

const r = r_.withSourceRepo(bazel_builtin.current_repository);

const rpath = "__main__/runfiles/data.txt";
const rpath = "integration_tests/runfiles/data.txt";

const file_path = try r.rlocationAlloc(allocator, rpath) orelse {
std.log.err("Runfiles location '{s}' not found", .{rpath});
Expand Down

0 comments on commit 2385047

Please sign in to comment.