Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

musl libc builds (docker) #1407

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -121,7 +121,7 @@ jobs:
key:
cargo-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
restore-keys:
cargo-${{ matrix.config.target }}-${{ matrix.config.variant }}-
cargo-${{ matrix.config.target }}-${{ matrix.config.variant }}-1

# It seems that the 'target' directory does not always get restored
# from cache correctly on MacOS. In the build log we see the following:
Expand Down Expand Up @@ -164,6 +164,13 @@ jobs:
. $basename/sccache --start-server
echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Build Musl
if: matrix.config.target == 'x86_64-unknown-linux-gnu'
run: |
docker run -v "$PWD":/usr/src/rusty_v8 -w /usr/src/rusty_v8 rust:alpine3.16 ./musl-build.sh ${{ env.CARGO_VARIANT_FLAG }}
docker cp $(docker ps -lq):/usr/src/rusty_v8/target/${{ matrix.config.variant }}/gn_out/obj/librusty_v8.a target/librusty_v8_${{ matrix.config.variant }}_x86_64-unknown-linux-musl.a
sudo chown $(id -u):$(id -g) /home/runner/work/rusty_v8/rusty_v8/target/debug/

- name: Test
env:
SCCACHE_IDLE_TIMEOUT: 0
Expand Down
2 changes: 1 addition & 1 deletion build
35 changes: 35 additions & 0 deletions musl-build.sh
@@ -0,0 +1,35 @@
#!/bin/sh

apk add git \
gcc \
ninja \
python3 \
clang \
g++ \
pkgconfig \
glib-dev \
llvm13-dev \
binutils-gold \
sccache
ln -s /usr/bin/python3 /usr/bin/python

export V8_FROM_SOURCE="yes"
export CLANG_BASE_PATH="/usr"
export SCCACHE_DIR="./target/sccache"
export SCCACHE="/usr/bin/sccache"
export GN_ARGS="use_custom_libcxx=false use_lld=false v8_enable_backtrace=false v8_enable_debugging_features=false"
GN="$(pwd)/gn/out/gn"
export GN

# Bulid GN
if [ ! -d "./gn" ]; then
git clone https://gn.googlesource.com/gn
(
cd gn || exit
python3 build/gen.py
ninja -C out
)
fi

# Build rusty_v8 and pass through the arguments
cargo build -vv $@