Skip to content

Commit

Permalink
Try to build with mold linker.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Apr 8, 2024
1 parent 3170aad commit cd732a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_build-musl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
ref: ${{ github.base_ref }}

- name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: ${{ matrix.arch }}
Expand Down
8 changes: 6 additions & 2 deletions packages/lychee/compile-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ apk add \
build-base \
cargo \
cargo-auditable \
lld \
mold \
openssl-dev \
;

Expand All @@ -34,9 +36,11 @@ cd "lychee-${PKG_VER}/" || true
cargo fetch --target="${EARCH}-unknown-linux-musl" --locked
# cargo test --frozen

# Different build settings for aarch64 vs x86_64.
# The `mold` linker is MUCH faster than `ld` or `lld`.
case "${ARCH}" in
"arm64") cargo auditable build --jobs 1 --frozen --release ;; # Slower, but scales better.
"amd64") cargo auditable build --frozen --release ;;
"arm64") mold -run cargo auditable build --timings --frozen --release --jobs 1 ;; # Slower, but scales better.
"amd64") mold -run cargo auditable build --timings --frozen --release ;;
*) echo "Unknown architecture: ${ARCH}" && exit 1 ;;
esac

Expand Down

0 comments on commit cd732a3

Please sign in to comment.