maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

make libmvndnative.* builds reproducible

Open hboutemy opened this issue 3 years ago • 4 comments

currently, when doing cd native ; make native-all, we see that on the 14 native libs built and stored in src/main/resources/org/mvndaemon/mvnd/nativ/, 11 are not reproducible = each run gives a different output, that will lead to a Git commit during a release even if there was no code change

ideally, such rebuilds should give reproducible output https://reproducible-builds.org/ , even if they use dockcross https://github.com/dockcross/dockcross

the non-reproducible targets are:

  • Linux for all arch (arm, arm64, armv6, armv7, ppc64, x86, x86_64)
  • Mac for x86 and x86_64 arch (arm64 arch is ok...)
  • Windows for all arch (x86, x86_64)

FreeBSD is already ok for all arch (x86, x86_64)

hboutemy avatar May 01 '22 08:05 hboutemy

#631 fixes the problem for me on windows, but on all other platforms, the builds are reproducible for me. This must be a docker environment issue similar to #627

gnodet avatar May 02 '22 13:05 gnodet

FYI, I just rebuilt the libs and even with #628 merged, I get a different dll than the one stored in Git

I'm curious to see how the GH release script in GH Actions rebuilding the libs will behave: get the same output or something different?

hboutemy avatar May 03 '22 06:05 hboutemy

@hboutemy this should be fixed if you want to have another look ....

gnodet avatar May 03 '22 18:05 gnodet

wow, really nice: I now have only 1 difference = src/main/resources/org/mvndaemon/mvnd/nativ/Linux/x86/libmvndnative.so I suppose this is due to the fact that it is my platform (I'm running Ubuntu), then my local build did not use the containerized build using diffoscope, I see

│ -  [     0]  GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
│ +  [     0]  GCC: (Debian 10.2.1-6) 10.2.1 20210110

last remaining issue: I still have 1 Mac arch and the 2 FreeBSD archs created as root in target, with the FreeBSD ones copied to src as root also:

$ ll target/
total 80
drwxrwxr-x 20 herve herve 4096 mai    4 09:02 ./
drwxrwxr-x  6 herve herve 4096 mai    4 09:01 ../
drwxr-xr-x  3 herve herve 4096 mai    4 09:01 classes/
drwxrwxr-x  6 herve herve 4096 mai    4 09:01 crossbuild/
drwxr-xr-x  7 herve herve 4096 mai    4 09:02 ducible/
drwxrwxr-x  4 herve herve 4096 mai    4 09:01 inc/
drwxr-xr-x  2 root  root  4096 mai    4 09:02 native-FreeBSD-x86/
drwxr-xr-x  2 root  root  4096 mai    4 09:02 native-FreeBSD-x86_64/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-arm/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-arm64/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-armv6/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-armv7/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-ppc64/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-x86/
drwxr-xr-x  2 herve herve 4096 mai    4 09:01 native-Linux-x86_64/
drwxr-xr-x  2 root  root  4096 mai    4 09:02 native-Mac-arm64/
drwxr-xr-x  2 herve herve 4096 mai    4 09:02 native-Mac-x86/
drwxr-xr-x  2 herve herve 4096 mai    4 09:02 native-Mac-x86_64/
drwxr-xr-x  2 herve herve 4096 mai    4 09:02 native-Windows-x86/
drwxr-xr-x  2 herve herve 4096 mai    4 09:02 native-Windows-x86_64/

$ ll src/main/resources/org/mvndaemon/mvnd/nativ/*/*
src/main/resources/org/mvndaemon/mvnd/nativ/FreeBSD/x86:
total 16
drwxrwxr-x 2 herve herve 4096 mai    4 09:02 ./
drwxrwxr-x 4 herve herve 4096 mai    4 09:01 ../
-rwxr-xr-x 1 root  root  4803 mai    4 09:02 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/FreeBSD/x86_64:
total 16
drwxrwxr-x 2 herve herve 4096 mai    4 09:02 ./
drwxrwxr-x 4 herve herve 4096 mai    4 09:01 ../
-rwxr-xr-x 1 root  root  6755 mai    4 09:02 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/arm:
total 16
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve 4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 7804 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/arm64:
total 20
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve 4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 8864 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/armv6:
total 20
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve 4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 8564 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/armv7:
total 16
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve 4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 7824 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/ppc64:
total 24
drwxr-xr-x 2 herve herve  4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve  4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 70304 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/x86:
total 24
drwxr-xr-x 2 herve herve  4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve  4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 15188 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Linux/x86_64:
total 20
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 9 herve herve 4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 8384 mai    4 09:01 libmvndnative.so*

src/main/resources/org/mvndaemon/mvnd/nativ/Mac/arm64:
total 60
drwxrwxr-x 2 herve herve  4096 mai    4 09:01 ./
drwxrwxr-x 5 herve herve  4096 mai    4 09:01 ../
-rwxrwxr-x 1 herve herve 50801 mai    4 09:02 libmvndnative.jnilib*

src/main/resources/org/mvndaemon/mvnd/nativ/Mac/x86:
total 20
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 5 herve herve 4096 mai    4 09:01 ../
-rwxrwxr-x 1 herve herve 9044 mai    4 09:02 libmvndnative.jnilib*

src/main/resources/org/mvndaemon/mvnd/nativ/Mac/x86_64:
total 20
drwxr-xr-x 2 herve herve 4096 mai    4 09:01 ./
drwxrwxr-x 5 herve herve 4096 mai    4 09:01 ../
-rwxrwxr-x 1 herve herve 9260 mai    4 09:02 libmvndnative.jnilib*

src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86:
total 96
drwxr-xr-x 2 herve herve  4096 mai    4 09:01 ./
drwxrwxr-x 4 herve herve  4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 87265 mai    4 09:02 mvndnative.dll*

src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86_64:
total 112
drwxr-xr-x 2 herve herve   4096 mai    4 09:01 ./
drwxrwxr-x 4 herve herve   4096 mai    4 08:58 ../
-rwxrwxr-x 1 herve herve 103015 mai    4 09:02 mvndnative.dll*

really nice work done, very good improvements

hboutemy avatar May 04 '22 07:05 hboutemy

Closing this one, I think the work has been done for 0.8.0. @hboutemy please reopen if needed.

gnodet avatar Sep 08 '22 05:09 gnodet