Skip to content

Establish minimum compatible Bazel, dep versions #1726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Apr 27, 2025

Description

Separates the latest dependency versions that we test against from the minimum required versions and bumps protobuf to v30.2. Part of #1482.

Adds scala/latest_deps.bzl for WORKSPACE and deps/latest for Bzlmod, used by our internal test repos.

Tests used to validate these dependency versions will land in a future change.

Also:

  • Fixes a bug in the failure message of _default_platform() in protoc_toolchains.bzl by calling string.join() on the HOST_CONSTRAINTS list.

  • Downloads the win64 build for Windows ARM64.

Motivation

This avoids forcing users to upgrade to the latest versions that rules_scala tests against.

Inspired by a thread in the #bzlmod channel of the Bazel Slack workspace on 2025-01-01 indicating that rules should require the minumum versions possible:

I didn't notice the _default_platform() error until building on Windows ARM64, since there's not yet a binary protobuf release for that platform. The win64 workaround fixes the actual error, since Windows ARM64 can execute x86 and x64 binaries:

@mbland mbland requested review from liucijus and simuons as code owners April 27, 2025 02:36
@mbland
Copy link
Contributor Author

mbland commented Apr 27, 2025

Hmm, at this point I can't tell if the Windows breakage is a fluke or not. I can't reproduce it on my local Windows ARM64 VM because of rules_java's dependency on rules_python that I mentioned in #1482 (comment). (i.e., The build break before the failing test target even buiilds.)

Perhaps #1724 should land first (to add --test_output=errors), then I can rebase this pull request and try again. If it's not a fluke, we'll see it then.

@simuons
Copy link
Collaborator

simuons commented Apr 28, 2025

Hi, @mbland, I've just merged #1724 could you please try rebasing.

Separates the latest dependency versions that we test against from the
minimum required versions and bumps `protobuf` to v30.2. Part of bazel-contrib#1482.

Adds `scala/latest_deps.bzl` for `WORKSPACE` and `deps/latest` for
Bzlmod, used by our internal test repos.

Tests used to validate these dependency versions will land in a future
change.

Also:

- Fixes a bug in the failure message of `_default_platform()` in
  `protoc_toolchains.bzl` by calling `string.join()` on the
  `HOST_CONSTRAINTS` list.

- Downloads the `win64` build for Windows ARM64.

---

This avoids forcing users to upgrade to the latest versions that
`rules_scala` tests against.

Inspired by a thread in the #bzlmod channel of the Bazel Slack workspace
on 2025-01-01 indicating that rules should require the minumum versions
possible:

- https://bazelbuild.slack.com/archives/C014RARENH0/p1743597941149639

I didn't notice the `_default_platform()` error until building on
Windows ARM64, since there's not yet a binary `protobuf` release for
that platform. The `win64` workaround fixes the actual error, since
Windows ARM64 can execute x86 and x64 binaries:

- https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x86-emulation
@mbland mbland force-pushed the minimum-dependency-versions branch from 0f5961c to 68ad128 Compare April 28, 2025 11:21
@mbland
Copy link
Contributor Author

mbland commented Apr 28, 2025

Hi, @mbland, I've just merged #1724 could you please try rebasing.

Done. The build is passing now. It seems that previous test failure on Windows was some kind of fluke, or perhaps this change depended on #1724, #1727, or #1728 in some way after all.

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mbland for the PR and for the pointers (was a good read as usual)

@simuons simuons merged commit 84e3f44 into bazel-contrib:master Apr 29, 2025
2 checks passed
@mbland mbland deleted the minimum-dependency-versions branch April 29, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants