Bug 1872373 (rust-prost-build)
| Summary: | Review Request: rust-prost-build - Protocol Buffers implementation for the Rust Language | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Peter Robinson <pbrobinson> |
| Component: | Package Review | Assignee: | Robert-André Mauchin 🐧 <eclipseo> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | eclipseo, package-review |
| Target Milestone: | --- | Flags: | eclipseo:
fedora-review+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-09-11 16:33:12 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1872372 | ||
| Bug Blocks: | 1862796 | ||
|
Description
Peter Robinson
2020-08-25 15:26:15 UTC
I've got this error at the end of the build:
RPM build errors:
error: Arch dependent binaries in noarch package
Arch dependent binaries in noarch package
- You shouldn't bundle protobuf and shouldn't install it in a noarch package ll builddir/build/BUILDROOT/rust-prost-build-0.6.1-1.fc34.x86_64/usr/share/cargo/registry/prost-build-0.6.1/third-party/protobuf/ total 28472 -rw-r--r--. 1 mockbuild mock 1732 Jun 13 2019 LICENSE drwxr-xr-x. 1 mockbuild mock 12 Aug 25 23:48 include -rwxr-xr-x. 1 mockbuild mock 4974596 Jan 12 2020 protoc-linux-aarch_64 -rwxr-xr-x. 1 mockbuild mock 4684564 Aug 25 23:50 protoc-linux-x86_32 -rwxr-xr-x. 1 mockbuild mock 5068568 Aug 25 23:50 protoc-linux-x86_64 -rwxr-xr-x. 1 mockbuild mock 11773784 Jan 12 2020 protoc-osx-x86_64 -rwxr-xr-x. 1 mockbuild mock 2639360 Jan 12 2020 protoc-win32.exe Also the protobuf code is BSD and we can't ship precompiled binary The build.rs is helpful:
//! Finds the appropriate `protoc` binary and Protobuf include directory for this host, and outputs
//! build directives so that the main `prost-build` crate can use them.
//!
//! The following locations are checked for `protoc` in decreasing priority:
//!
//! 1. The `PROTOC` environment variable.
//! 2. The bundled `protoc`.
//! 3. The `protoc` on the `PATH`.
//!
//! If no `protoc` binary is available in these locations, the build fails.
//!
//! The following locations are checked for the Protobuf include directory in decreasing priority:
//!
//! 1. The `PROTOC_INCLUDE` environment variable.
//! 2. The bundled Protobuf include directory.
You should BR protobuf-compiler and protobuf-devel then define
export PROTOC=%{_bindir}/protoc
export PROTOC_INCLUDE=%{_includedir}
Not sure if the devel package should also Requires: protobuf-compiler to work correctly.
You also need to exclude third_party in the Cargo.toml
# prost-build-fix-metadata.diff
============================================================================
--- prost-build-0.6.1/Cargo.toml 1970-01-01T00:00:00+00:00
+++ prost-build-0.6.1/Cargo.toml 2020-08-25T22:22:26.646471+00:00
@@ -20,6 +20,7 @@
readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/danburkert/prost"
+exclude = ["/third-party"]
[dependencies.bytes]
version = "0.5"
============================================================================
And:
Source: %{crates_source}
# Initial patched metadata
# - exclude /third-party from install
Patch0: prost-build-fix-metadata.diff
It should:
Requires: protobuf-compiler
to work correctly.
And the crate depending on this one should also specify
export PROTOC=%{_bindir}/protoc
SPEC: https://pbrobinson.fedorapeople.org/rust-prost-build.spec SRPM: https://pbrobinson.fedorapeople.org/rust-prost-build-0.6.1-2.fc32.src.rpm koji: https://koji.fedoraproject.org/koji/taskinfo?taskID=50959288 Robert I think the latest update fixes everything. - always add a comment above patch to explain what changes you made: # Fix XXXX Patch1: prost-build-fix-metadata.diff Package approved. (fedscm-admin): The Pagure repository was created at https://src.fedoraproject.org/rpms/rust-prost-build |