Skip to content

Commit bc7e4af

Browse files
committed
Refactor
1 parent 2f6cf92 commit bc7e4af

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

dist.sh

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,29 @@
44
# the `dist` directory as `mold-$version-$arch-linux.tar.gz` (e.g.
55
# `mold-2.40.0-x86_64-linux.tar.gz`).
66
#
7-
# This script aims to produce reproducible outputs. That means if you run
8-
# the script twice on the same git commit, it should produce bit-for-bit
9-
# identical binary files. This property is crucial as a countermeasure
10-
# against supply chain attacks. With it, you can verify that the binary
11-
# files distributed on the GitHub release pages were created from the
12-
# commit with release tags by rebuilding the binaries yourself.
7+
# This script aims to produce reproducible outputs. That means each time
8+
# it's run on the same git commit, it generates a bit-for-bit identical
9+
# binary file regardless of when or where it's executed. This property
10+
# serves as a strong safeguard against supply chain attacks. With a
11+
# reproducible build, anyone can independently verify that the binary
12+
# files published on our GitHub release page were built from the git
13+
# commit tagged for release by rebuilding the binaries themselves.
1314
#
1415
# Debian provides snapshot.debian.org to host all historical binary
15-
# packages. We use it to construct Podman images pinned to a
16+
# packages. We use it to construct a container image pinned to a
1617
# particular timestamp. snapshot.debian.org is known to be very slow,
1718
# but that shouldn't be a big problem for us because we only need that
1819
# site the first time.
1920
#
2021
# The mold executable created by this script is statically linked to
21-
# libstdc++, but dynamically linked to libc, libm and a few other
22-
# libraries, as these libraries are almost always available on any
23-
# Linux system. We can't statically link libc because doing so would
24-
# disable dlopen(), which is required to load the LTO linker plugin.
22+
# libstdc++, but dynamically linked to glibc, libm and a few other
23+
# libraries, as these libraries are almost always available on any Linux
24+
# system. We can't statically link glibc because doing so would disable
25+
# dlopen(), which is required to load the LTO linker plugin.
2526
#
26-
# We aim to use a reasonably old Debian version because we'll dynamically
27-
# link glibc to mold, and a binary linked against a newer version of glibc
28-
# won't work on a system with an older version of glibc.
27+
# We use a reasonably old Debian version for the build environment because
28+
# a binary dynamically linked against a newer version of glibc won't work
29+
# on a system with an older version of glibc.
2930
#
3031
# We prefer to build mold with Clang rather than GCC because mold's
3132
# Identical Code Folding works best with the LLVM address significance
@@ -79,14 +80,15 @@ case $arch in
7980
x86_64)
8081
# Debian 9 (Stretch) released in June 2017.
8182
#
82-
# We use a Google-provided mirror (gcr.io) of the official Docker hub
83-
# (docker.io) because docker.io has a strict rate limit policy.
83+
# We use a Google-provided mirror (gcr.io) instead of the official Docker
84+
# Hub (docker.io) because docker.io has a strict rate limit policy.
8485
#
8586
# The toolchain in Debian 9 is too old to build mold, so we rebuild it
8687
# from source. We download source archives from official sites and build
87-
# them locally, rather than using pre-built binaries, to avoid relying
88-
# on unverifiable third-party binary blobs. Podman caches the result of
89-
# each RUN command, so rebuilding is done only once per host.
88+
# them locally, rather than downloading pre-built binaries from somewhere
89+
# else, to avoid relying on unverifiable third-party binary blobs. Podman
90+
# caches the result of each RUN command, so rebuilding is done only once
91+
# per host.
9092
cat <<EOF | $image_build
9193
FROM mirror.gcr.io/library/debian:stretch@sha256:c5c5200ff1e9c73ffbf188b4a67eb1c91531b644856b4aefe86a58d2f0cb05be
9294
ENV DEBIAN_FRONTEND=noninteractive TZ=UTC

0 commit comments

Comments
 (0)