-
Notifications
You must be signed in to change notification settings - Fork 359
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
rpm-4.18.0 embeds build machine CPU count #2343
Comments
Right. This is very similar to the LTO case (7faf8ed), with probably a similar solution. The simple and sane solution is to have _smp_mflags expand to Which ... we already did for slightly different reasons, but apparently I completely forgot about it in the meanwhile 😆 - see 0576d24. We just need to backport it to 4.18. |
I tried ===================================================================
--- rpm-4.18.0.orig/platform.in
+++ rpm-4.18.0/platform.in
@@ -57,7 +57,7 @@
if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$RPM_BUILD_NCPUS" -gt "$ncpus_max" ]; then RPM_BUILD_NCPUS="$ncpus_max"; fi; \\\
echo "$RPM_BUILD_NCPUS";)
-%_smp_mflags -j%{_smp_build_ncpus}
+%_smp_mflags -j${RPM_BUILD_NCPUS}
# Maximum number of threads to use when building, 0 for unlimited
#%_smp_nthreads_max 0 But somehow I still get this diff -make -j4
+make -j1 the produced
Why is that? |
I checked git log and found some related commits. |
As mentioned in the PR, |
Right something writes it into ~/.rpmmacros . That is our problem then and the |
Ack. rpmdev-setuptree < 8.6 liked to put a value in there, but that was dropped in 2015 so it's a fairly old thing, something else seems more likely. |
Note, it's |
I have it with |
Oh. That's installplatform being over-eager ( |
This is probably |
Yes. It came from https://github.com/openSUSE/obs-build/blob/master/build-recipe#L234 |
There are four .spec files in openSUSE, that use Maybe instead of 0576d24, we could redefine |
That would break the macro for anybody using it outside the build scriptlets, which is an entirely legit use. You'll need to fix those specs instead. |
It seems, |
Backport |
Yep, it's not exactly a big change: d97d7b7 |
because with rpm-4.18 that ends up expanded into .src.rpm headers rpm-software-management/rpm#2343
Found another problematic case:
Edit: submitted https://build.opensuse.org/request/show/1061850 |
And more trouble from |
Ugh, I hadn't realized the src.rpm header md5 (another ugh) ends up in the binary headers too. It only happens with -ba (iirc) so not all build-systems exhibit that, but still. This would be nice case for placing the parsed spec outside the checksummed part of the header, but that in turn causes other problems... |
The reported and most glaring issue with %{_smp_mflags} was addressed in 4.18.x, closing but acknowledging that we may need something further around this. |
Found another reproducibility problem with expanded .spec in %{expand: %%global options %(mktemp /tmp/texlive-opts.XXXXXXXX)} |
found another breakage: |
Yes, there will be any number of ways the parsed spec inclusion can trip up bit-for-bit differences. "Breakage" is a strange and strong word for it, another angle to look at it is to use it as a tool to help reproducability: if the parsed spec (which is what the build will actually use, after all) differs it's acts as a warning that requires investigation. Some of which will be false positives, like mktemp. |
because some usages of macros are hard to make reproducible Fixes rpm-software-management#2343
because some usages of macros are hard to make reproducible Fixes rpm-software-management#2343 This patch was done while working on reproducible builds for openSUSE.
While working on reproducible builds for openSUSE, I found that the recent upgrade to rpm-4.18.0
with #2047 / #1241 caused spec files with
make %{?_smp_mflags}
to embed the build machine CPU count into .src.rpm files, making them hard to bit-reproduce.
binary rpm files embed the .src.rpm header checksum, so suffer as well.
It might also introduce other hard-to-reproduce details, but I have not looked for these, yet.
The text was updated successfully, but these errors were encountered: