[Bug 2104123] Review Request: rust-krunvm - Create microVMs from OCI images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2104123



--- Comment #3 from Fabio Valentini <decathorpe@xxxxxxxxx> ---
> I've used cargo-license for generating the license list

This might or might not be correct, depending on whether you have run this
against Fedora crates or against crates.io.
For example, some crates have changed their license between the version that is
packaged for Fedora and the latest compatible version on crates.io.

You have three options to generate the list of licenses for the versions that
will be used for the RPM build:

1) use a simple script that only queries RPMs

for i in $(rpm -qa | grep "rust-.*-devel"); do
   rpm -q $i --qf "%{LICENSE}\n";
done | sort | uniq

To use this, you would run a local mock build with "--without check" (since we
don't want dependencies that are only used for unit tests to show up in our
list), and then enter the mock chroot with "mock shell", and then run the bash
script. This will print the list of unique licenses that are present in your
Rust dependencies.

2) use a more complicated script that operates on the level of dnf / repository
metadata:

dnf repoquery --cacheonly "rust-*-devel" --installed --qf "%{LICENSE}:
%{source_name} %{version}"

This would require the same steps as 1) (running build with "--without check"),
but then also to install "dnf-utils" into the buildroot, which provides the
"repoquery" command for dnf.

Note that both 1) and 2) are slightly incorrect. They both only skip test-only
/ dev-dependencies, but will include build-only / build-dependencies, which are
not linked into final binaries, either.

3) query cargo itself during the build

I have not tested this approach yet, but it should work around the limitation
of 1) and 2).
I think you should be able to paste this snippet into the %build section of
your .spec file, run the build once to get its output, and then remove it
again:

cargo tree --workspace --offline --edges 'normal' --prefix none --format '{l}:
{p}#' | cut -d\# -f1 | grep -v "($PWD" | sort -u

This has also reminded me to open an issue with our Rust packaging tools to
include somethign like option 3), either by default, or as a macro, so I hope
that this problem will become simpler to handle in the near future.


-- 
You are receiving this mail because:
You are always notified about changes to this product and component
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2104123
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux