Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include dependency licences in distribution bundle #113

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

kyllingstad
Copy link
Member

This is something from the old conanfile.txt that I forgot to include in conanfile.py when I upgraded to Conan 2.x (#109). Basically, it copies everything that looks like a licence or otherwise copyright-related file to the doc/licences/<dependency_name> directories in the installation bundle.

@eidekrist
Copy link
Member

While examining one of the build artifacts resulting from this branch (Windows Release with proxyfmu) I found something strange.
By all accounts it seems we are using openssl/1.1.1s. OpenSSL's website describing licenses states that the the dual OpenSSL and SSLeay license applies for this release. The build artifact contains two license files for openssl (doc/licenses/openssl/LICENSE (GPL 1) and doc/licenses/openssl/LICENSE.txt (Apache 2.0)). These don't match the licenses described on the OpenSSL website. What gives?

@kyllingstad
Copy link
Member Author

kyllingstad commented Mar 6, 2024

It looks like conan.tools.files.copy() is a bit more eager than I had anticipated. Two of the patterns I have included – licenses/* and license* – cause the entire licenses/ subdirectory of the dependency package directory to be copied recursively. And for OpenSSL, that directory contains licenses/external/perl/Text-Template-1.56/LICENSE which is the GPL. But I'm pretty sure that doesn't apply to us.

I'll change the patterns to something a bit more restrictive.

@kyllingstad
Copy link
Member Author

I've implemented what I hope is a slightly more sophisticated method for importing licences now.

If a dependency has a licenses/ directory, which virtually all Conan-center packages do, then it is copied recursively into deps/doc/licenses/<package_name>. In the case of OpenSSL that we discussed earlier, this will still include the GPL licence, but it will now be in deps/doc/licenses/openssl/external/perl/Text-Template-1.56/LICENSE, making it a bit more clear that it does not apply to OpenSSL per se.

For packages that do not conform to the Conan-center layout (just our own, really) the function will copy anything that looks like it contains licence, author, and copyright info. There may be some false positives down the line, but I think that is better than missing some.

Copy link
Member

@eidekrist eidekrist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@kyllingstad kyllingstad merged commit 9f16131 into master Mar 6, 2024
8 checks passed
@kyllingstad kyllingstad deleted the bugfix/include-dep-licences branch March 6, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants