lux icon indicating copy to clipboard operation
lux copied to clipboard

Add support for deterministic build

Open avtobiff opened this issue 2 years ago • 1 comments

Enable reproducible builds by creating a deterministic build environment.

  • Create a deterministic build environment with the new configure option --enable-deterministic-build.

Deterministic builds:

  • Replaces +debug_info erlc flag with +deterministic.

  • Strips runpty from non-deterministic data.

avtobiff avatar Sep 08 '22 20:09 avtobiff

This patch enables deterministic builds for binaries.

Testing reproducible builds by

# git clone lux.git
cp -a lux lux2
for d in lux lux2; do
    mkdir -p /tmp/$d
    cd $d
    autoconf;
    ./configure --enable-deterministic-build
    make DESTDIR=/tmp/$d all install
    cd ..
done;
diffoscope /tmp/lux /tmp/lux2

Now diffoscope only returns timestamps as difference, trivial to fix.

However if the docs are rebuilt the build path is included in the resulting lux.html file, since lux generates log directories automatically from the invocation path and a sub directory containing timestamp.

It is possibly to remedy this by running the examples for the docs with

lux --log_dir /tmp/lux_logs examples

It might look a bit weird, to not have the default path lux uses. Perhaps the docs aren't recreated at build anyway, but just installed as is and recreated when needed?

avtobiff avatar Sep 08 '22 20:09 avtobiff