Skip to content
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

Toolchainize twitter_scrooge #1693

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Feb 6, 2025

Description

Adds twitter_scrooge to scala_toolchains(). Part of #1482 and #1652.

Motivation

This is the last of the toolchains to receive the "toolchainization" treatment prior to Bzlmodification, and moves twitter_scrooge() to twitter_scrooge/toolchain/toolchain.bzl for rules_java 8 compatibility.

This is the last of the toolchain to receive the "toolchainization"
treatment prior to Bzlmodification, and moves `twitter_scrooge()` to
`twitter_scrooge/toolchain/toolchain.bzl` for `rules_java` 8
compatibility. Part of bazelbuild#1482 and bazelbuild#1652.
jmh = False):
jmh = False,
twitter_scrooge = False,
libthrift = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could libthrift, scrooge_core, scrooge_generator, util_core and util_logging be passed as a twitter_scrooge_deps dict/struct?

I know it doesn't sound particularly nice but parameter list is getting quite big. It would kinda match scalafmt and scala_proto pattern where one parameter enables toolchain and next one passes some config.

I assume in bzl_mod each toolchain will get its own tag_class with proper attrs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Done in c90ec75.

Also, as I started doing this, I noticed these arguments were never really propagating properly. The new commit fixes that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, ./test_reproducibility.sh on macOS in build #5350 appears to have failed during git checkout. You might want to restart that task, but all the other builds seem fine.

cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
$ cd /usr/local/var/bazelbuild
# Updating existing repository mirror to find commit c90ec7567ec828e1d68303535b50104dbf5ae4ec
⚠️ Warning: Checkout failed! getting/updating git mirror: setting remote URL: exit status 71 (Attempt 1/3 Retrying in 2s)
# Removing /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
# Creating "/Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala"
$ cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
$ cd /usr/local/var/bazelbuild
# Updating existing repository mirror to find commit c90ec7567ec828e1d68303535b50104dbf5ae4ec
⚠️ Warning: Checkout failed! getting/updating git mirror: setting remote URL: exit status 71 (Attempt 2/3 Retrying in 2s)
# Removing /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
# Creating "/Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala"
$ cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
$ cd /usr/local/var/bazelbuild
# Updating existing repository mirror to find commit c90ec7567ec828e1d68303535b50104dbf5ae4ec
⚠️ Warning: Checkout failed! getting/updating git mirror: setting remote URL: exit status 71 (Attempt 3/3)
# Removing /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
# Creating "/Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala"
$ cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
🚨 Error: getting/updating git mirror: setting remote URL: exit status 71

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi. Could you please push a commit to trigger build (empty commit will do). It's a shame to say that but I don't have permissions retry builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh. Today I Learned about git commit --allow-empty. Done in 19db328, and all is passing now.

As requested by @simuons in bazelbuild#1693, `scala_toolchains` now receives
`twitter_scrooge` options as a `dict`. Since all of these options are
for alternative toolchain dependencies, I've called this new `dict`
argument `twitter_scrooge_deps`.

However, after looking closely at how the options propagated, I realized
they never made it to the toolchain generated by `scala_toolchains`. So
this change also passes these options all the way through to the
generated `BUILD` file and through the `setup_scala_toolchain()` call.
Seemingly spurious failure during `git checkout`:

- https://buildkite.com/organizations/bazel/pipelines/rules-scala-scala/builds/5350/jobs/0194f660-94eb-464a-a81d-9d1c576c2968/log

```txt
cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
$ cd /usr/local/var/bazelbuild
⚠️ Warning: Checkout failed! getting/updating git mirror: setting remote URL: exit status 71 (Attempt 1/3 Retrying in 2s)
$ cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
$ cd /usr/local/var/bazelbuild
⚠️ Warning: Checkout failed! getting/updating git mirror: setting remote URL: exit status 71 (Attempt 2/3 Retrying in 2s)
$ cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
$ cd /usr/local/var/bazelbuild
⚠️ Warning: Checkout failed! getting/updating git mirror: setting remote URL: exit status 71 (Attempt 3/3)
$ cd /Users/buildkite/builds/bk-macos-intel-ggrd/bazel/rules-scala-scala
🚨 Error: getting/updating git mirror: setting remote URL: exit status 71
```
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!

@simuons simuons merged commit 21f70db into bazelbuild:master Feb 13, 2025
2 checks passed
@mbland mbland deleted the bzlmod-toolchain-twitter-scrooge branch February 13, 2025 13:32
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