Bug 2245445

Summary: Review Request: rust-logos-codegen - Implementation details for logos-codegen and logos-derive
Product: [Fedora] Fedora Reporter: Seth Maurice-Brant <fedoraproject.kwudj>
Component: Package ReviewAssignee: Fabio Valentini <decathorpe>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: decathorpe, package-review
Target Milestone: ---Flags: decathorpe: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://crates.io/crates/logos-codegen
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-03 23:43:26 UTC Type: ---
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:    
Bug Blocks: 2245450, 2245451    
Attachments:
Description Flags
The .spec file difference from Copr build 6577368 to 6591542 none

Description Seth Maurice-Brant 2023-10-21 14:46:05 UTC
Spec URL: https://gitlab.com/iSaluki/fedora-rust-logos-codegen/-/raw/main/rust-logos-codegen.spec
SRPM URL: https://gitlab.com/iSaluki/fedora-rust-logos-codegen/-/raw/main/rust-logos-codegen-0.13.0-1.fc39.src.rpm
Description: Implementation details for logos-codegen and logos-derive
Fedora Account System Username: saluki

Passing Koji build: https://koji.fedoraproject.org/koji/taskinfo?taskID=107882800

Comment 1 Fabio Valentini 2023-10-22 10:26:41 UTC
Package looks good, except that upstream doesn't ship license files.
Including license files in (re)distributed sources is mandatory for MIT and Apache-2.0.

Please file a ticket with the upstream project to include license files in published crates.
You can look at https://github.com/alexcrichton/ssh2-rs/issues/289 that I filed for the same issue in a different crate.

Until this is resolved upstream, you can include the files as additional sources from the upstream git repo.
Here's a package that can serve as an example of how to do that:
https://src.fedoraproject.org/rpms/rust-unic-locale/blob/rawhide/f/rust-unic-locale.spec

Comment 2 Seth Maurice-Brant 2023-10-22 12:43:16 UTC
Gotcha.

I've opened an issue regarding the licensing problem here: https://github.com/maciejhirsz/logos/issues/343

I have also mentioned other crates stored in that repository that have the same licence issue. Two of these are also pending review, blocked by this request. Hopefully we can get them all sorted together.

I will address the licensing issue with my package and then update you here once that is done.

Comment 3 Fedora Review Service 2023-10-23 13:00:42 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6557793
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2245445-rust-logos-codegen/srpm-builds/06557793/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 5 Fedora Review Service 2023-10-23 13:13:17 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6557877
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2245445-rust-logos-codegen/srpm-builds/06557877/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 6 Fabio Valentini 2023-10-25 18:09:12 UTC
Looks like there's some issues:

> %license %{crate_instdir}/LICENSE-APACHE
> %license %{crate_instdir}/LICENSE-MI

These are in the wrong subpackage, they should be under "%files devel".
There's also a typo (trailing "T" missing from "LICENSE-MIT".

You also didn't add the files to the package anywhere - they need to be separate "Source" entries, and need to be copied into the build directory in the %prep scriptlet.

Comment 7 Seth Maurice-Brant 2023-10-28 10:44:19 UTC
Thanks for the help Fabio. Looks like I managed to botch this one a bit. 

Anyway, here is a fixed version.

Spec: https://gitlab.com/fedora-pkgs/rust-logos-codegen/-/raw/main/rust-logos-codegen.spec
SRPM:https://gitlab.com/fedora-pkgs/rust-logos-codegen/-/raw/main/rust-logos-codegen-0.13.0-1.fc40.src.rpm

Comment 8 Fedora Review Service 2023-10-29 01:41:35 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6577368
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2245445-rust-logos-codegen/fedora-rawhide-x86_64/06577368-rust-logos-codegen/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 9 Fabio Valentini 2023-10-31 12:50:41 UTC
> Source1:		%{crate_instdir}/LICENSE-APACHE
> Source2:		%{crate_instdir}/LICENSE-MIT

How is this supposed to work? Source and Patch lines are about telling RPM where to find files *before* building the package.
These are absolute paths, and they don't exist.

You will need to replace these two lines with something like this, to tell RPM that these files don't come from an absolute path on the filesystem, but insead come from URLs and can be referenced by relative path:

Source1:  https://github.com/maciejhirsz/logos/raw/v0.13/LICENSE-APACHE
Source2:  https://github.com/maciejhirsz/logos/raw/v0.13/LICENSE-MIT

Additionally, please don't mix tabs and spaces in spec files. And since rust2rpm defaults to spaces, please use spaces for indenting. :)

Looks like you also made a small mistake when updating the %files list here:

> %files          devel
> %doc %{crate_instdir}/README.md
> %{crate_instdir}/
> %license %{crate_instdir}/LICENSE-APACHE
> %license %{crate_instdir}/LICENSE-MIT
> %{crate_instdir}/

The %{crate_instdir}/ should not be listed twice, it should be something like:

%files          devel
%license %{crate_instdir}/LICENSE-APACHE
%license %{crate_instdir}/LICENSE-MIT
%doc %{crate_instdir}/README.md
%{crate_instdir}/

This matches what rust2rpm would produce if the files were included in the upstream sources.

Please also take care not to introduce additional whitespace / newlines when making manual changes. They will only result in additional non-useful "diff" output when updating the package in the future.

Comment 10 Seth Maurice-Brant 2023-11-02 13:13:28 UTC
Thank you for this feedback. It definitely cleared up some confusion I had.

here are my ammended files:

Spec: https://gitlab.com/fedora-pkgs/rust-logos-codegen/-/raw/main/rust-logos-codegen.spec
SRPM:https://gitlab.com/fedora-pkgs/rust-logos-codegen/-/raw/main/rust-logos-codegen-0.13.0-2.fc40.src.rpm

Comment 11 Fedora Review Service 2023-11-02 13:25:55 UTC
Created attachment 1996718 [details]
The .spec file difference from Copr build 6577368 to 6591542

Comment 12 Fedora Review Service 2023-11-02 13:25:58 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6591542
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2245445-rust-logos-codegen/fedora-rawhide-x86_64/06591542-rust-logos-codegen/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 13 Fabio Valentini 2023-11-03 21:33:54 UTC
Thank you, looks good to me now!

===

Package was generated with rust2rpm, simplifying the review.

- package builds and installs without errors on rawhide
- test suite is run and all unit tests pass
- latest version of the crate is packaged
- license matches upstream specification (MIT OR Apache-2.0) and is acceptable for Fedora
- license files are included with %license in %files (included manually from upstream repo)
- package complies with Rust Packaging Guidelines

Package APPROVED.

===

Recommended post-import rust-sig tasks:

- set up package on release-monitoring.org:
  project: $crate
  homepage: https://crates.io/crates/$crate
  backend: crates.io
  version scheme: semantic
  version filter: alpha;beta;rc;pre
  distro: Fedora
  Package: rust-$crate

- add @rust-sig with "commit" access as package co-maintainer
  (should happen automatically)

- set bugzilla assignee overrides to @rust-sig (optional)

- track package in koschei for all built branches
  (should happen automatically once rust-sig is co-maintainer)

Comment 14 Fedora Admin user for bugzilla script actions 2023-11-03 23:13:12 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/rust-logos-codegen

Comment 15 Fedora Update System 2023-11-03 23:41:16 UTC
FEDORA-2023-0797a6b19d has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-0797a6b19d

Comment 16 Fedora Update System 2023-11-03 23:43:26 UTC
FEDORA-2023-0797a6b19d has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.