snapd should provide a means to access package license information

Bug #1662951 reported by Joseph Wakeling
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Medium
Unassigned

Bug Description

Snap packages should ideally include licensing information. Good practice can be encouraged here if the `snap` command supports an option to get that licensing information, and `snapcraft` provides a standardized way to include it in the snap.

I would suggest that `snapcraft` request that a `license.txt` file be placed in the `snap/` dir of the package definition alongside `snapcraft.yaml`, with a deprecation message if it is not present. `snapcraft` could then place that file in the `meta/` directory of the resulting snap package.

The `snap` command could then provide either a separate `license` command to output the license.txt file, or a flag to `snap info` to provide/append the license information.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Yes, we definitely want to track license information inside the snap format in a proper location. We want to support both basic cases such as just listing a well known name, custom licenses, and all the way up to requiring an explicit agreement with the provided text.

We're not there yet, but this is in our short to medium term roadmap for sure.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Joseph Wakeling (webdrake) wrote :

Thanks Gustavo -- makes sense.

I think from my point of view what I'm concerned about is that if I include a license.txt in the snap package definition (presumably in the `snap/` directory), it _will_ end up in the snap package, and this will happen automatically.

My interest here was sparked when I misinterpreted snapcraft deprecation notice 2 (introduced in snapcraft 2.26) and assumed that the license.txt file would also have to be moved from the `setup/` directory to the newly-required `snap/` directory (probably because I kept getting the deprecation message as long as the `setup/` dir existed).

However, I then noticed that the license.txt file seemed to be ending up in the snap package only by accident, as a consequence of the fact that the `snap/` directory winds up there (which is a bug). I'd like to make sure that the provided license.txt file still ends up in the snap package automatically, even when https://bugs.launchpad.net/snapcraft/+bug/1660890 is fixed.

As I recall, if I left `license.txt` in the old `setup/` directory, then it didn't get included in the snap package at all.

I understand if you want to push for the more general solution you outline above, and just require manual license-file solutions in the meantime, but just want to make sure that my main concern is understood.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

There is ongoing work on this bug. The relevant snapd APIs will now return the SPDX expression describing one of stock licenses. We are discussing how to represent non-stock licenses, both in the snap itself and in the license expression. The discussions are taking place on the forum.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.