diff --git a/.dockerignore b/.dockerignore index 110a7f3e..f55d05ee 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ * !Cargo.* !gui/Cargo.* -!contrib/docker/cargo_config.toml +!contrib/reproducible/docker/cargo_config.toml diff --git a/contrib/reproducible/README.md b/contrib/reproducible/README.md new file mode 100644 index 00000000..0ca04d6b --- /dev/null +++ b/contrib/reproducible/README.md @@ -0,0 +1,17 @@ +# Liana reproducible builds + +Releases of Liana are built in a reproducible manner, providing an assurance the binary a user is +going to run corresponds to the sources published. It enables the possibility for the user, or a +third party, to audit the code being ran. + +For Linux binaries (and hopefully soon for all hosts) we go further and provide bootstrappable +builds, where the toolchain used to compile the source code reproducibly is itself built +reproducibly from source. + +Learn more about reproducible builds [here](https://reproducible-builds.org/), and bootstrappable +builds [here](https://bootstrappable.org/). + +For instructions on bootstrappable builds of Linux releases, see the [`guix`](./guix) folder. + +For instructions on reproducible builds of Windows and MacOS releases, see the [`docker`](./docker) +folder. diff --git a/contrib/docker/README.md b/contrib/reproducible/docker/README.md similarity index 97% rename from contrib/docker/README.md rename to contrib/reproducible/docker/README.md index f046b340..7d939cbe 100644 --- a/contrib/docker/README.md +++ b/contrib/reproducible/docker/README.md @@ -29,5 +29,5 @@ path to the script by setting the `XCODE_PATH` env var). Finally, run the script from the root of the repository: ``` -./contrib/docker/docker-build.sh +./contrib/reproducible/docker/docker-build.sh ``` diff --git a/contrib/docker/cargo_config.toml b/contrib/reproducible/docker/cargo_config.toml similarity index 100% rename from contrib/docker/cargo_config.toml rename to contrib/reproducible/docker/cargo_config.toml diff --git a/contrib/docker/docker-build.sh b/contrib/reproducible/docker/docker-build.sh similarity index 77% rename from contrib/docker/docker-build.sh rename to contrib/reproducible/docker/docker-build.sh index 5905f132..c97656f1 100755 --- a/contrib/docker/docker-build.sh +++ b/contrib/reproducible/docker/docker-build.sh @@ -7,10 +7,10 @@ TARGET_DIR="${TARGET_DIR:-"$PWD/deter_build_target"}" XCODE_PATH="${XCODE_PATH:-"$PWD/Xcode_12.2.xip"}" # Build (only) the Liana GUI on Windows. -docker build . -t liana_cross_win -f contrib/docker/windows.Dockerfile +docker build . -t liana_cross_win -f contrib/reproducible/docker/windows.Dockerfile docker run --rm -ti \ -v "$TARGET_DIR/gui":/liana/target \ - -v "$PWD/contrib/docker":/liana/docker \ + -v "$PWD/contrib/reproducible/docker":/liana/docker \ -v "$PWD/gui/src":/liana/src \ -v "$PWD/gui/static":/liana/static \ liana_cross_win @@ -22,11 +22,11 @@ if ! $(echo "28d352f8c14a43d9b8a082ac6338dc173cb153f964c6e8fb6ba389e5be528bd0 $( fi # Build both the Liana daemon and GUI on MacOS. -docker build . -t liana_cross_mac -f contrib/docker/macos.Dockerfile +docker build . -t liana_cross_mac -f contrib/reproducible/docker/macos.Dockerfile docker run --rm -ti \ -v "$TARGET_DIR":/liana/target \ -v "$TARGET_DIR/gui":/liana/gui/target \ - -v "$PWD/contrib/docker":/liana/docker \ + -v "$PWD/contrib/reproducible/docker":/liana/docker \ -v "$PWD/src":/liana/src \ -v "$PWD/gui/src":/liana/gui/src \ -v "$PWD/gui/static":/liana/gui/static \ diff --git a/contrib/docker/macos.Dockerfile b/contrib/reproducible/docker/macos.Dockerfile similarity index 95% rename from contrib/docker/macos.Dockerfile rename to contrib/reproducible/docker/macos.Dockerfile index e0eff2dd..b5dd0073 100644 --- a/contrib/docker/macos.Dockerfile +++ b/contrib/reproducible/docker/macos.Dockerfile @@ -46,8 +46,8 @@ RUN /liana/rust-1.65.0-x86_64-unknown-linux-gnu/cargo/bin/cargo vendor && \ cd .. # Cargo configuration for using the vendored dependencies during the builds. -COPY contrib/docker/cargo_config.toml /liana/.cargo/cargo_config.toml -COPY contrib/docker/cargo_config.toml /liana/gui/.cargo/cargo_config.toml +COPY contrib/reproducible/docker/cargo_config.toml /liana/.cargo/cargo_config.toml +COPY contrib/reproducible/docker/cargo_config.toml /liana/gui/.cargo/cargo_config.toml # For some reason, we can't just set the RUSTFLAGS environment variable to add `-L` for compiling dependencies. # This doesn't work: RUSTFLAGS="-L/liana/rust-1.65.0-x86_64-apple-darwin/rust-std-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/" diff --git a/contrib/docker/macos_cmd.sh b/contrib/reproducible/docker/macos_cmd.sh similarity index 100% rename from contrib/docker/macos_cmd.sh rename to contrib/reproducible/docker/macos_cmd.sh diff --git a/contrib/docker/windows.Dockerfile b/contrib/reproducible/docker/windows.Dockerfile similarity index 97% rename from contrib/docker/windows.Dockerfile rename to contrib/reproducible/docker/windows.Dockerfile index 057e596d..b658dc3e 100644 --- a/contrib/docker/windows.Dockerfile +++ b/contrib/reproducible/docker/windows.Dockerfile @@ -28,7 +28,7 @@ COPY gui/Cargo.toml gui/Cargo.lock /liana/ RUN /liana/rust-1.65.0-x86_64-unknown-linux-gnu/cargo/bin/cargo vendor # Cargo configuration for using the vendored dependencies during the build. -COPY contrib/docker/cargo_config.toml /liana/.cargo/cargo_config.toml +COPY contrib/reproducible/docker/cargo_config.toml /liana/.cargo/cargo_config.toml # For some reason, we can't just set the RUSTFLAGS environment variable to add `-L` for compiling dependencies. # This doesn't work: RUSTFLAGS="-L /liana/rust-1.65.0-x86_64-pc-windows-gnu/rust-std-x86_64-pc-windows-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/ -L /liana/rust-1.65.0-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/" diff --git a/contrib/docker/windows_cmd.sh b/contrib/reproducible/docker/windows_cmd.sh similarity index 100% rename from contrib/docker/windows_cmd.sh rename to contrib/reproducible/docker/windows_cmd.sh diff --git a/contrib/guix/README.md b/contrib/reproducible/guix/README.md similarity index 97% rename from contrib/guix/README.md rename to contrib/reproducible/guix/README.md index c6dacda9..3c41b364 100644 --- a/contrib/guix/README.md +++ b/contrib/reproducible/guix/README.md @@ -119,7 +119,7 @@ Override the default list of substitute servers by passing the guix --substitute-urls='https://guix.carldong.io https://ci.guix.gnu.org' ``` -For scripts under `./contrib/guix`, set the `SUBSTITUTE_URLS` environment +For scripts under `./contrib/reproducible/guix`, set the `SUBSTITUTE_URLS` environment variable: ```sh @@ -159,7 +159,7 @@ the `build.sh` script that will take care of building the dependencies and the p To start a build, simply run the `guix-build.sh` script from the root of the repository: ``` -$ ./contrib/guix/guix-build.sh +$ ./contrib/reproducible/guix/guix-build.sh ``` The script shouldn't contain any bash-ism, so it should work with other shells as well. diff --git a/contrib/guix/build.sh b/contrib/reproducible/guix/build.sh similarity index 100% rename from contrib/guix/build.sh rename to contrib/reproducible/guix/build.sh diff --git a/contrib/guix/guix-build.sh b/contrib/reproducible/guix/guix-build.sh similarity index 96% rename from contrib/guix/guix-build.sh rename to contrib/reproducible/guix/guix-build.sh index 816b3466..d08687b5 100755 --- a/contrib/guix/guix-build.sh +++ b/contrib/reproducible/guix/guix-build.sh @@ -60,7 +60,7 @@ for project_folder in "" "gui"; do PROJECT_ROOT="$PWD/$project_folder" PROJECT_VENDOR_DIR="$VENDOR_DIR/$project_folder" PROJECT_OUT_DIR="$OUT_DIR/$project_folder" - PROJECT_PATCHES_ROOT="$PWD/contrib/guix/patches/$project_folder" + PROJECT_PATCHES_ROOT="$PWD/contrib/reproducible/guix/patches/$project_folder" project_needs_patches() { test $(ls -A1q "$PROJECT_PATCHES_ROOT" |grep patch) @@ -122,7 +122,7 @@ for project_folder in "" "gui"; do --expose="$PWD/gui/static=/liana/static" \ --expose="$PROJECT_ROOT/Cargo.toml=/liana/Cargo.toml" \ --expose="$BUILD_ROOT/Cargo.lock=/liana/Cargo.lock" \ - --expose="$PWD/contrib/guix/build.sh=/liana/build.sh" \ + --expose="$PWD/contrib/reproducible/guix/build.sh=/liana/build.sh" \ --expose="$PROJECT_VENDOR_DIR=/vendor" \ --share="$PROJECT_OUT_DIR=/out" \ --cores="$JOBS" \ @@ -130,7 +130,7 @@ for project_folder in "" "gui"; do --pure \ --fallback \ --rebuild-cache \ - -m $PWD/contrib/guix/manifest.scm \ + -m $PWD/contrib/reproducible/guix/manifest.scm \ -- env CC=gcc VENDOR_DIR="$PROJECT_VENDOR_DIR" TARGET_DIR="$PROJECT_OUT_DIR" BINARY_NAME="$BINARY_NAME" JOBS="$JOBS" \ /bin/sh -c "cd /liana && ./build.sh" done diff --git a/contrib/guix/manifest.scm b/contrib/reproducible/guix/manifest.scm similarity index 100% rename from contrib/guix/manifest.scm rename to contrib/reproducible/guix/manifest.scm diff --git a/contrib/guix/patches/gui/iced_default_enum.patch b/contrib/reproducible/guix/patches/gui/iced_default_enum.patch similarity index 100% rename from contrib/guix/patches/gui/iced_default_enum.patch rename to contrib/reproducible/guix/patches/gui/iced_default_enum.patch