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
Make the generated pkgconfig files reproducible. #3211
Conversation
|
It looks like there are |
e428206
to
61bf457
Compare
|
@sarum9in Thanks for the heads-up; indeed, the pub_libs can contain |
|
@sarum9in There you go :) |
|
Yes, changing |
|
I didn't find |
|
@lamby I'm not sure, but IIRC when doing static link when libfoo uses symbols from libbar and you do "-lfoo -lbar" when it will add libfoo it won't have symbols from libbar yet and it will fail to link. |
|
@sarum9in I would suggest (but I'm not sure at all!) to just keep the first. At least that would be reproductible and probably what you need 99% of the time. I think there are corner cases where it could still fail, but in that case I would say just don't use the pkgconfig.generate() and do your pc file by hand. Does that make sense? |
|
@xclaesse I am slightly more concerned about a case when we use some parameters like |
61bf457
to
7cd4e6d
Compare
|
Thank you all for the quick feedback. I've pushed a another revision here, just seeing if all the tests pass.. |
mesonbuild/modules/pkgconfig.py
Outdated
| @@ -167,12 +174,12 @@ def generate_pkgconfig_file(self, state, deps, subdirs, name, description, | |||
| ofile.write('URL: %s\n' % url) | |||
| ofile.write('Version: %s\n' % version) | |||
| if len(deps.pub_reqs) > 0: | |||
| ofile.write('Requires: {}\n'.format(' '.join(deps.pub_reqs))) | |||
| ofile.write('Requires: {}\n'.format(' '.join(sorted(deps.pub_reqs)))) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of doing _fn() if you still call sorted() here? I think the idea to avoid set()/sorted() was to keep original order and remove duplicates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an error to keep this sorted.
Whilst working on the Reproducible Builds effort [0], we noticed that meson creates non-reproducible pkgconfig files as it relies on Python set ordering. This was originally filed in Debian as #892515 [1]. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/892515
7cd4e6d
to
d097b2d
Compare
|
Updated :) |
|
We currently have a more urgent pkg-config emergency on our hands so unfortunately this will have to wait until that has been solved. |
Oh? :) |
|
I'll merge this as it fixes the issue and does not change behaviour. However as discussed above the dedup logic itself is probably broken for static linking and other stuff. We may need to change that to work properly. However that is an issue for another PR. Thanks. |
|
Thanks! |
Whilst working on the Reproducible Builds effort [0], we noticed
that meson creates non-reproducible pkgconfig files as it iterates
over Python sets.
This was originally filed in Debian as #892515 [1].
[0] https://reproducible-builds.org/
[1] https://bugs.debian.org/892515