Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 694454 - cargo.eclass needs to include a BIG FAT WARNING about LICENSE
Summary: cargo.eclass needs to include a BIG FAT WARNING about LICENSE
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-15 07:49 UTC by Michał Górny
Modified: 2024-02-11 06:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-15 07:49:58 UTC
Cargo bundles a lot of packages by design.  However, I haven't seen a *single* package in Gentoo that would set LICENSE appropriately.  This makes me believe that the eclass needs to include a BIG FAT WARNING telling developers that they need to include LICENSEs for all bundled crates.
Comment 1 Georgy Yakovlev archtester gentoo-dev 2019-09-16 01:07:54 UTC
most rust packages are created using cargo ebuild, it collects and writes down all crates and creates a template ebuild, but it's outdated and not maintained

https://github.com/cardoe/cargo-ebuild

cardoe has his packages reassigned recently.

I have a fork that works with new openssl support.
https://github.com/gyakovlev/cargo-ebuild?organization=gyakovlev&organization=gyakovlev

The original and the fork are not in the tree, but I can import my fork to ::gentoo and make it create ebuild template with warning. Maybe I can extract licenses from all the crates and put them in the template.

What I can do is add a warning in a eclass, but not sure where exactly and how to check if licenses contain only single entry (check for spaces maybe?).

Also repoman could check it, but I don't know it's internals yet.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-16 04:06:27 UTC
Here's a cheap hack that can help:

$ find -name 'Cargo.toml' -exec grep -h license {} + | sort -u

Note that sometimes people are using different spelling for the same things but I think you can cover most of it using a short list.  Note that some of the packages use '/' and 'OR, and some have 'AND', so don't be too lax.

There are also a few instances of license-file that require manual check.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2019-09-16 18:24:39 UTC
mgorny: wrt those rust crate licenses, I think only direct dependency licenses should be listed. so if foo requires a,b,c  and a requires x,y,z should I really add x,y,z licenses to ebuild?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-16 19:16:30 UTC
(In reply to Georgy Yakovlev from comment #3)
> mgorny: wrt those rust crate licenses, I think only direct dependency
> licenses should be listed. so if foo requires a,b,c  and a requires x,y,z
> should I really add x,y,z licenses to ebuild?

Since all crates are bundled as part of the ebuild, you should list all.
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2019-12-22 22:05:30 UTC
(In reply to Georgy Yakovlev from comment #1)
> most rust packages are created using cargo ebuild, it collects and writes
> down all crates and creates a template ebuild, but it's outdated and not
> maintained
> 
> https://github.com/cardoe/cargo-ebuild
> 
> cardoe has his packages reassigned recently.
> 
> I have a fork that works with new openssl support.
> https://github.com/gyakovlev/cargo-
> ebuild?organization=gyakovlev&organization=gyakovlev

I definitely still maintain the project. It's passively maintained as there's not much to do. Never seen an issue reported by you or received an email about you so I couldn't have possibly fixed any issues you've had.

Your fork is 1 commit head and 10 behind my version. I'm glad to take any improvements you've got.
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2019-12-23 03:04:09 UTC
(In reply to Michał Górny from comment #2)
> Here's a cheap hack that can help:
> 
> $ find -name 'Cargo.toml' -exec grep -h license {} + | sort -u
> 
> Note that sometimes people are using different spelling for the same things
> but I think you can cover most of it using a short list.  Note that some of
> the packages use '/' and 'OR, and some have 'AND', so don't be too lax.
> 
> There are also a few instances of license-file that require manual check.

At ebuild generation time the entire sources to all dependent crates is not available locally.