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
rehex build results vary from parallelism #129
Comments
|
Can you provide the exact make commands and environment variables being used? The version.o object is built as part of making the main rehex binary and also the test suite, from the looks of the commands you're seeing I think some additional flags (optimisations, warnings) are being set for the 'all' target, but not the 'check' target. The same thing could possibly cause differences in the other .o files. |
|
https://code.opensuse.org/package/rehex/blob/master/f/rehex.spec#_53 has our build instructions. We dont run 'check', but I see, CFLAGS is not set for install. |
|
OTOH, switching the build section to non-parallel makes results deterministic. I'll build non-parallel with strace to maybe see where the 2nd call comes from. |
|
So setting same C(XX)FLAGS on make install, makes results reproducible again. |
Normal Makefile rules that specify multiple targets are interpreted as a rule that produces each of those files individually, so Make would execute these rules in parallel to produce the same file multiple times, invalidating already-built targets that depended on the files and potentially corrupting the output files too. The correct fix would be grouped targets, but they only exist in bleeding-edge versions of GNU Make, so we have this horrible hacky thing instead...
|
I think I've fixed it on master. Does it work for you? |
|
Yes, d321dff also fixed it in our setup. |
While working on reproducible builds for openSUSE, I found that
our rehex package varies between builds using -j1 and -j4
When building without LTO, there are only 4 .o files differing:
res/version.o
res/license.o
src/lua-bindings/rehex_bind.o
src/lua-plugin-preload.o
For
version.oI found with filterdiffand that probably comes from the fact that in the
-j1case, it is compiled twice with different options (no CFLAGS in 2nd call)while in the -j4 build only the first call happens.
I think, this indicates that there is something wrong with the dependencies or rules defined in the build system.
The text was updated successfully, but these errors were encountered: