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

Upgrade rules python #23730

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

comius
Copy link
Contributor

@comius comius commented Sep 24, 2024

Failures:


$ bazel mod deps --lockfile_mode=update
ERROR: Traceback (most recent call last):
	File "/usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/external/rules_rust+/crate_universe/extension.bzl", line 348, column 37, in _crate_impl
		_generate_hub_and_spokes(module_ctx, cargo_bazel, cfg, annotations, packages = packages)
	File "/usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/external/rules_rust+/crate_universe/extension.bzl", line 139, column 16, in _generate_hub_and_spokes
		cargo_bazel([
	File "/usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/external/rules_rust+/crate_universe/private/module_extensions/cargo_bazel_bootstrap.bzl", line 55, column 17, in run
		fail("%s returned with exit code %d:\n%s" % (pretty_args, result.return_code, result.stderr))
Error in fail: /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/cargo-bazel generate --cargo-lockfile /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/crates/splicing-output/Cargo.lock --config /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/crates/config.json --splicing-manifest /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/crates/splicing_manifest.json --repository-dir /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/crates --metadata /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/crates/splicing-output/metadata.json --repin --lockfile /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/modextwd/rules_rust++crate/crates/lockfile.json --cargo /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/external/rules_rust++rust_host_tools+rust_host_tools/bin/cargo --rustc /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/external/rules_rust++rust_host_tools+rust_host_tools/bin/rustc returned with exit code 101:
thread 'main' panicked at src/utils.rs:48:22:
Could not rename paths: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR: error evaluating module extension crate in @@rules_rust+//crate_universe:extension.bzl. Type 'bazel help mod' for syntax and help.
    Fetching module extension crate in @@rules_rust+//crate_universe:extension.bzl; starting
$ bazel run //src/test/tools/bzlmod:update_default_lock_file
ERROR: no such package '@@[unknown repo 'maven' requested from @@protobuf+]//': The repository '@@[unknown repo 'maven' requested from @@protobuf+]' could not be resolved: No repository visible as '@maven' from repository '@@protobuf+'
ERROR: /usr/local/google/home/ilist/.cache/bazel/_bazel_ilist/e9eba874c4fa4205502c6d2768696dfb/external/protobuf+/java/util/BUILD.bazel:8:13: no such package '@@[unknown repo 'maven' requested from @@protobuf+]//': The repository '@@[unknown repo 'maven' requested from @@protobuf+]' could not be resolved: No repository visible as '@maven' from repository '@@protobuf+' and referenced by '@@protobuf+//java/util:util'
ERROR: Analysis of target '//src/test/tools/bzlmod:update_default_lock_file' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.348s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

PiperOrigin-RevId: 678166065
Change-Id: Ibe4c5e9c674da5ea0f6c3d4c963f88bf21ff82b0
@comius
Copy link
Contributor Author

comius commented Sep 24, 2024

cc @meteorcloudy @Wyverald

Yelp, please...

I tried upgrading rules_python, which I need to remove Python rules from Bazel. I ended up upgrading bunch of dependencies, now I'm stuck on rules_rust and maven.

@meteorcloudy
Copy link
Member

Upgrading protobuf and grpc is going to be annoying, @Wyverald is trying to address that #22719

Can you try to pin protobuf and grpc at the old versions and see if it'll work?

@meteorcloudy
Copy link
Member

Also abseil-cpp as mentioned in the issue...

@comius
Copy link
Contributor Author

comius commented Sep 24, 2024

I actually had no intend of upgrading protobuf. I started with rules_python, that needed protobuf 24.4, that needed newer grpc, but the newer grpc didn't really work with it, so I ended up upgrading protobuf and bunch of other deps on demand.

I'm worried because of the second message `'@@[unknown repo 'maven' requested from @@protobuf+]//'. The @maven repo is defined in my overwritten MODULE.bazel for protobuf, but it's not picked up. I tried renaming it, to maven_protobuf, but it still doesn't work. What's going on? Is this a known problem? I saw bazel-contrib/rules_jvm_external#1104 and buildfarm/buildfarm#1812 (but there's no resolution in the ticket).

I'm worried, because I have no indication that @maven will work with protobuf cut at head. Do single_version_overrides behave somewhat differently?

Also the problem with rules_rust was reported: bazel-contrib/rules_jsonnet#194

@meteorcloudy
Copy link
Member

The @maven repo is defined in my overwritten MODULE.bazel for protobuf

Patching MODLE.bazel file with single_version_override never worked, but @fmeum has a fix #23536. You can use archive overrider or git override to point to a newer protobuf.

Or just pin protobuf to the original version and hopefully rules_python still work?

@meteorcloudy
Copy link
Member

Let's see if #23735 works

@meteorcloudy
Copy link
Member

@Wyverald @comius It is very concerning rules_rust is fetched anyway even though Bazel doesn't use it. Since protobuf will be a default dependency for any Bazel project, I think we have to address this issue. Maybe by stripping down the MODULE.bazel file of protobuf in BCR?

@meteorcloudy
Copy link
Member

Otherwise, it's gonna be very hard to upgrade protobuf in src/MODULE.tools

@comius
Copy link
Contributor Author

comius commented Sep 24, 2024

Thanks @meteorcloudy, I think I have enough ammunition now, to make another attempt (a working override and removing rules_rust). I'll continue tomorrow.

@comius
Copy link
Contributor Author

comius commented Sep 24, 2024

rules_rust, my thoughts are, that if protobuf didn't register rust toolchains / didn't need to register toolchains, it wouldn't be fetched... I'll check if this is something we could achieve (either in protobuf or in rules_rust)

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