Closed jaskij closed 2 months ago
@acozzette Is this a side-effect of the monorepo merge?
Is this a side-effect of the monorepo merge?
To add more context: it works up until 3.20.3. It seems I didn't push my changes, but I was updating this dockerfile over the weekend, and 3.20.3 worked just fine. 25.2 gave me more trouble than I wanted to deal with at the time. I didn't check version inbetween.
I get this error when I try to install
Versioning changed with 3.21 per https://protobuf.dev/news/2022-05-06/
The first instance of this new versioning scheme is the new version of the Python API, 4.21.0, which follows the preceding version, 3.20.1. Other language APIs will be released as 3.21.0.
In your Dockerfile, you're currently using the same version number for both C++ and Python:
PROTOBUF_CPP_FILE=protobuf-cpp-${PROTOBUF_VERSION}.tar.gz \
PROTOBUF_PY_FILE=protobuf-python-${PROTOBUF_VERSION}.tar.gz \
So you'll have to use ARG PROTOBUF_VERSION=25.2
and then prefix appropriately:
PROTOBUF_CPP_FILE=protobuf-cpp-3.${PROTOBUF_VERSION}.tar.gz \
PROTOBUF_PY_FILE=protobuf-python-4.${PROTOBUF_VERSION}.tar.gz \
@pdecks the error shows up in local builds on my host machine, where I'm not using Docker at all. Just plain download the file and try to build with Bazel.
I am aware of the versioning change. Packaging has also changed, if you look at version 25.2 there is now only one archive with ${PROTOBUF_VERSION}.tar.gz
, skipping the major version name. There are no per-language archives. I probably shouldn't have linked that Dockerfile, it's a bit of a red herring here.
Ah yeah, thanks for clarifying. I did indeed get distracted by the Dockerfile. Confirming I see the same behavior when trying to build 25.3 with bazel 7.0.2 via bazel build :protoc :protobuf
.
This is related https://github.com/bazelbuild/bazel/issues/19973, and I just verified that I was able to successfully build protobuf 25.3 with bazel 6.5.0.
Thanks for finding that, seems like the issue lies a little deeper. When I get back to the topic, using an older version of Bazel could be a viable workaround.
That said, one of the comments ( https://github.com/bazelbuild/bazel/issues/19973#issuecomment-1787964362 ) in the Bazel issue seems to suggest a workaround for Protobuf?
@pdecks tested just now with 26.0 and Bazel 7.1.1, don't know what changed, but it seems to build now.
At least bazel build :protoc :protobuf
doesn't throw an error. I still have no clue how to get libprotobuf.so
, but that's a different issue.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive
because the last activity was over 90 days ago.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive
label was added.
What version of protobuf and what language are you using? Version: 25.2 Language: C++ (?)
What operating system (Linux, Windows, ...) and version?
Arch Linux, up to date
What runtime / compiler are you using (e.g., python version or gcc version)
What did you do? Steps to reproduce the behavior:
protobuf-25.2.tar.gz
bazel build :protobuf
What did you expect to see
A successful build
What did you see instead?