-
Notifications
You must be signed in to change notification settings - Fork 258
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
Improvements of the Makefile distribution targets #3003
Conversation
The dist tarball (dist/$(name)-$(distversion).tar.gz) has been considered always up to date by make, and thus not remade when any of the files changed. This has caused "make srpm" (and other targets depending on the dist tarball - "make rpm", "make deb" etc.) to build packages without newer changes to the sources. Fix by marking dist/$(name)-$(distversion).tar.gz as a phony target that will be always rebuilt.
The source RPM has been specified as a glob pattern: dist/$(name)-$(version)-*.src.rpm This breaks when there are multiple source RPMs under dist/ - leftovers from previous builds. It forces us to use clean or package-clean always before using "make rpm", which is not ideal. Fix by determining the actual full package name (with the dist tag) by parsing the spec file and using that. Use the full name also for an informational message on terminal.
Define it on the command line in Makefile instead. Allows us to eliminate one sed transform of the spec file. Keep `%define debug_package %{nil}`, it needs to be set when building the RPM without the Makefile.
@schlomo, I think you touched the Makefile and especially the package generation recently, can you please have a look? |
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.
About always rebuilding the tar.gz archive: I disabled that because I wanted to build all the distro packages off the same tar.gz and save some time when running tools/run-in-docker -- make package
.
Can you find a way to keep that "feature"?
Sorry, I did now know that it was intentional. Can you please point me to the commit where you made the change? I don't see anything related in the commit messages. |
I'm not yet as good with my commit messages... It was when I returned the makefile for the package build GH action |
Make it depend on all its files instead.
@schlomo I think it is a bit unusual - the autotools - generated Makefiles also always rebuild the dist tarball. But I am trying. Please test the latest commit. |
@schlomo can you please test whether the latest commit resolves your concern? |
@schlomo why are you merging 'master' into this branch, is there some particular new feature there that you want to test together with my change? |
@pcahyna can you have a look at https://github.com/pcahyna/rear/actions/runs/5176475050 please? It doesn't work with your change, while https://github.com/rear/rear/actions/runs/5176703833 worked (current In general, for any change to the
Yes, I removed Fedora Rawhide from the list of distros as that was broken and prevented the Build Packages GH Action from working and your change needs to be tested against that. |
@schlomo sure, looking. Could you please add this GitHub action to the CI somehow? Right now I see |
There is no guarantee that "make srpm" will trigger rebuild of the dist tarball dist/$(name)-$(distversion).tar.gz - the file may already exist. In this case the temporary file does not get saved. Extract the spec file from the dist tarball instead.
do you mean that all the OSes should have the same .tar.gz ? How to check that? |
Anyway @schlomo please have a look at the last commit again, the GH action now passes. |
@pcahyna much better, only CentOS 6 is still acting up (as usual): The binary RPM was not generated, here is the log for it:
Can you please try to fix this? The reason it is not part of the CI checks is 1) it runs very long and 2) I want to see it stabilize more before adding it. I thought to maybe run it nightly instead of after every commit, I'll also add support to publish the resulting binaries via GH. |
Oh, and you can use the wrapped up build area for CentOS 6 to look into it, maybe it helps debugging |
The required |
Then why do I see a green check mark ✔️ in pcahyna@1a842d2 ? Something is wrong with error reporting in your GitHub action (there is that error hidden deep in the logs indeed, but it does not affect the visible result). |
It is more elegant than rpm, as it can print the source package information, which is what we are interested in. Unfortunately, it does not exist on EL 6 yet.
I believe it should be fixed now. |
I saw it running for half a hour, which is not that long.
Agreed. |
https://github.com/pcahyna/rear/actions/runs/5187314401/jobs/9349534521#step:7:31 (sorry for again pointing to the logs) has changed in the dist archive name, this indicates that there was a change in the source tree that is not committed to git. The ls -lR step is good for a quick check: There should be no tar.gz archives on the top level and in every subdirectory there should be the same tar.gz (at least of the same size). See https://github.com/rear/rear/actions/runs/5186427841/jobs/9347522192#step:7:38 for a "good" example. Maybe I should add more sanity checks to it, to automatically validate the stuff I just said? |
Do you know what the change is? The previous commit did not have this problem and I don't see what in the last commit could have broken it. |
I see this difference:
in https://github.com/pcahyna/rear/actions/runs/5181590712/jobs/9337304522#step:5:30
in https://github.com/pcahyna/rear/actions/runs/5187314401/jobs/9349534521#step:5:30 so, the modified file might be just the manual page. |
Yes, I'd love to change the way how we generate the man page so that it doesn't happen accidentally when we don't need it. |
I suspect this is just random, depending on the relative order of timestamp on |
rerunning to confirm. |
Sure, although I would not consider it a priority if you are willing to help me debugging this PR manually, I suspect we won't touch the Makefile for some time after we finish this. |
Happy to help here of course. I think that before making the build packages workflow part of the CI I should upgrade it to better check for errors and explain them so that other have a fair chance of quickly fixing it. |
@schlomo the rerun https://github.com/pcahyna/rear/actions/runs/5187314401/jobs/9351273206 seems OK (please check again), so the problem is not reproducible indeed and I believe it has not been caused by my changes. |
Thanks a lot for this improvement, I especially like how you create the dependency via the |
I home the dependency won't break anything, it does not seem very standard.
What's the problem with Fedora Rawhide by the way? |
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/RIIOCKWR2MBYARJNKVZXT3YLXBYGRJAF/ it seems you can use images from another registry. |
Pull Request Details:
Type: Bug Fix
Impact: Low
Reference to related issue (URL):
How was this pull request tested?
make srpm
andmake rpm
Brief description of the changes in this pull request:
Several improvements to the Makefile targets that generate distribution packages:
dist/$(name)-$(distversion).tar.gz
) has been considered always up to date by make, and thus not remade when any of the files changed. This has caused "make srpm" (and other targets depending on the dist tarball - "make rpm", "make deb" etc.) to build packages without newer changes to the sources.Fix by marking
dist/$(name)-$(distversion).tar.gz
as a phony target that will be always rebuilt.dist/$(name)-$(version)-*.src.rpm
. This breaks when there are multiple source RPMs under dist/ - leftovers from previous builds. It forces us to use clean or package-clean always before using "make rpm", which is not ideal.Fix by determining the actual full package name (with the dist tag) by parsing the spec file and using that.
%define
rpmrelease in the spec file, define it on the command line in Makefile instead. Allows us to eliminate onesed
transform of the spec file to set rpmrelease to the desired value.