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

Multiple README.md and LICENSE.md files from 140 modules breaks RPM building #348

Open
nkadel opened this issue Dec 2, 2021 · 12 comments
Open

Comments

@nkadel
Copy link

nkadel commented Dec 2, 2021

I've built up some tools to publish an "ansible" RPM with ansible-5.0.0. Unfortunately, the use of multiple README.md and LICENSE.md files from the variety of modules creates a problem: recent versions of "rpmbuild", such as those in RHEL 8 and in Fedora, try to copy those all as /usr/share/doc/ansible-5.0.0/README.md and /usr/share/doc/ansible-5.0.0/LICENSE.md.

I doubt I can rewrite or revise RPM to handle this better, this seems to be a new standard to reduce directory clutter under /usr/share/doc/ . How painful would it be to stuff a process in antsibull to preface the README.md and LICENSE.md filenames with the module name to avoid these conflicts?

@felixfontein
Copy link
Collaborator

I'm not sure whether we can modify collection content (from a legal point of view). Someone would have to clear that with RedHat legal. (CC @dmsimard @gundalow)

Please note that some collections also have README.md files in other directories (in particular if they contain roles), so simply prepending them with collection names isn't enough.

Maybe it's also worth filing a bug with rpmbuild, if it doesn't allow to work around this?

@dmsimard
Copy link
Contributor

dmsimard commented Dec 2, 2021

I don't have a solution for this (yet) but I do want to point out we are also wondering about this in fedora packaging land: https://src.fedoraproject.org/rpms/ansible/pull-request/19#comment-90841

@nkadel
Copy link
Author

nkadel commented Dec 2, 2021 via email

@nkadel
Copy link
Author

nkadel commented Dec 7, 2021

I filed a bug report for rpm itself about this. The problem is simply not apparent with other software because they typically publish submodules as distinct RPMs built from distinct tarballs, as Fedora is effectively doing for ansible-collections modules.

I'd also note that if you can't rename README.md or LICENSE.md files from the modules to something similar but unique, it's not open source or free software and does not belong in the published ansible tarball.

@felixfontein
Copy link
Collaborator

I'd also note that if you can't rename README.md or LICENSE.md files from the modules to something similar but unique, it's not open source or free software and does not belong in the published ansible tarball.

I don't think the problem has anything to do with open source, but more with the fact that if you modify something, the legal situation changes, since you are no longer simply distributing a copy of the original, but a modified copy. I am not a lawyer so I can't tell you whether renaming something creates legal tripmines or not.

@nkadel
Copy link
Author

nkadel commented Dec 7, 2021

I don't think the problem has anything to do with open source, but more with the fact that if you modify something, the legal situation changes

If I may quote you, that is precisely the point of free software licenses and most open source licenses, that you are permitted to modify them.

@nkadel
Copy link
Author

nkadel commented Dec 15, 2021

I have a pair of working .spec files, for 4.10.0 and 5.0.1. The full suite of needed python modules for ansible-core 2.11.7 and ansible core 2.12.0, and for ansibl-4.10. These work around the overlapping, path-stripped README.md and LICENSE files by pre-staging them with this kind of syntax, and staging licenses separately from docs.

rsync -a --prune-empty-dirs ansible_collections/
--exclude=docs/
--include=/
--include=README
--include=readme
--exclude=

docs/

I also included updated .spec files for ansible-core for RHEL 7 and RHEL 8.

I also lowered the ansible-core dependency for ansible-5.0.1, since it works with with ansible-core-2.11.7 on RHEL 7 and RHEL 8.

@felixfontein
Copy link
Collaborator

I also lowered the ansible-core dependency for ansible-5.0.1, since it works with with ansible-core-2.11.7 on RHEL 7 and RHEL 8.

I don't think you should call the resulting package "Ansible 5" then. Ansible 5 does have the modules/plugins contained in ansible-core 2.12, and ansible-core 2.11 does not have these.

@nkadel
Copy link
Author

nkadel commented Dec 15, 2021 via email

@felixfontein
Copy link
Collaborator

If you are installing ansible from pip without dependencies, you are not installing Ansible. Ansible is ansible-core + collections. I also feel like I'm a broken record here.

@nkadel
Copy link
Author

nkadel commented Dec 16, 2021

You're right. That's because the ansible tarball is mislabeled and does not, in fact, contain the python modules or scripts for ansible itself. Ordinarily, I'd not be so concerned, but using my .spec files or using this works well.

  • pip3 install --user --upgrade ansible-core # installs ansible-core 2.11.7 on RHEL 7 and RHEL 8, compatible with python 3.6
  • pip3 install --user --upgrade --no-deps ansible # skips stated ansib-core 2.12.0 dependency uses working 2.11.7 succesfully, and successfully ignores python 3.8 requirement,

Normally I'd not have made such a big deal, but if I'm publishing .spec files I want them to work as broadly as possible. There are compelling reasons that many .spec files use "BuildRequires" that have been manually altered from the "requirements.txt".

@nkadel
Copy link
Author

nkadel commented Apr 29, 2022

The fix is present in my published .spec files, which I've updated to ansible 5.7.0. Using rsync to copy only the README and similar documentation files to the target document directory is efficient and easier to script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants