Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ jobs:
os: linux-x64-gh
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Debug"
- lto_flag: ""
label: bun-webkit-linux-amd64-musl-debug-asan
os: linux-x64-gh
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Debug"
ENABLE_SANITIZERS: "address,undefined"
- lto_flag: ""
label: bun-webkit-linux-arm64-musl-debug
os: linux-arm64-gh
Expand Down Expand Up @@ -329,9 +335,11 @@ jobs:
with:
install: true
- name: Run
env:
ENABLE_SANITIZERS: ${{matrix.ENABLE_SANITIZERS}}
run: |
rm -rf ${{runner.temp}}/bun-webkit ${{runner.temp}}/bun-webkit.tar.gz
WEBKIT_RELEASE_TYPE=${{matrix.CMAKE_BUILD_TYPE}} CPU="native" cpu=native LTO_FLAG="${{matrix.lto_flag}}" temp=${{runner.temp}} bash musl-release.sh
WEBKIT_RELEASE_TYPE=${{matrix.CMAKE_BUILD_TYPE}} CPU="native" cpu=native LTO_FLAG="${{matrix.lto_flag}}" temp=${{runner.temp}} ENABLE_SANITIZERS="${{matrix.ENABLE_SANITIZERS}}" bash musl-release.sh
cd ${{runner.temp}}
echo "#define BUN_WEBKIT_VERSION \"${{ inputs.build_ref }}\"" >> bun-webkit/include/cmakeconfig.h
echo '{ "name": "${{matrix.label}}", "version": "0.0.1-${{ inputs.build_ref }}", "os": ["linux"], "cpu": ["${{matrix.package_json_arch}}"], "repository": "https://github.com/${{github.repository}}" }' > bun-webkit/package.json
Expand Down Expand Up @@ -452,6 +460,10 @@ jobs:
with:
name: bun-webkit-linux-amd64-musl-debug
path: ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug
- uses: actions/download-artifact@v4
with:
name: bun-webkit-linux-amd64-musl-debug-asan
path: ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug-asan
- uses: actions/download-artifact@v4
with:
name: bun-webkit-linux-arm64-musl-debug
Expand Down Expand Up @@ -480,6 +492,7 @@ jobs:
mv ${{runner.temp}}/bun-webkit-linux-amd64-debug/bun-webkit.tar.gz ./out/bun-webkit-linux-amd64-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-debug/bun-webkit.tar.gz ./out/bun-webkit-linux-arm64-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug/bun-webkit.tar.gz ./out/bun-webkit-linux-amd64-musl-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug-asan/bun-webkit.tar.gz ./out/bun-webkit-linux-amd64-musl-debug-asan.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-musl-debug/bun-webkit.tar.gz ./out/bun-webkit-linux-arm64-musl-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-asan/bun-webkit.tar.gz ./out/bun-webkit-linux-amd64-asan.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-asan/bun-webkit.tar.gz ./out/bun-webkit-linux-arm64-asan.tar.gz
Expand Down Expand Up @@ -529,6 +542,7 @@ jobs:
./out/bun-webkit-linux-amd64-musl-lto.tar.gz
./out/bun-webkit-linux-arm64-musl-lto.tar.gz
./out/bun-webkit-linux-amd64-musl-debug.tar.gz
./out/bun-webkit-linux-amd64-musl-debug-asan.tar.gz
./out/bun-webkit-linux-arm64-musl-debug.tar.gz

- uses: softprops/action-gh-release@v1
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile.musl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG CPU=native
ARG LTO_FLAG="-flto=full -fwhole-program-vtables -fforce-emit-vtables "
ARG LLVM_VERSION="19"
ARG DEFAULT_CFLAGS="-mno-omit-leaf-frame-pointer -g -fno-omit-frame-pointer -ffunction-sections -fdata-sections -faddrsig -fno-unwind-tables -fno-asynchronous-unwind-tables -DU_STATIC_IMPLEMENTATION=1 "
ARG ENABLE_SANITIZERS=""

FROM alpine:3.21 as base

Expand All @@ -13,6 +14,7 @@ ARG CPU
ARG LTO_FLAG
ARG LLVM_VERSION
ARG DEFAULT_CFLAGS
ARG ENABLE_SANITIZERS

RUN apk update
RUN apk add --no-cache cmake make clang19 clang19-static clang19-dev llvm19-dev llvm19-static musl-dev git lld libgcc gcc g++ libstdc++ build-base lld-dev llvm19-libs libc-dev xz zlib zlib-dev libxml2 libxml2-dev
Expand Down Expand Up @@ -41,6 +43,7 @@ ARG CPU
ARG LTO_FLAG
ARG LLVM_VERSION
ARG DEFAULT_CFLAGS
ARG ENABLE_SANITIZERS

RUN apk add --no-cache cpio curl tar

Expand All @@ -65,6 +68,7 @@ ARG CPU
ARG LTO_FLAG
ARG LLVM_VERSION
ARG DEFAULT_CFLAGS
ARG ENABLE_SANITIZERS

RUN apk add --no-cache cpio curl file gnupg ninja ruby unzip rsync perl python3 openssl-dev openssl linux-headers

Expand All @@ -80,7 +84,11 @@ COPY --from=build_icu /output /icu
RUN --mount=type=tmpfs,target=/webkitbuild \
export CFLAGS="${DEFAULT_CFLAGS} $CFLAGS $LTO_FLAG -ffile-prefix-map=/webkit/Source=vendor/WebKit/Source -ffile-prefix-map=/webkitbuild/=. " && \
export CXXFLAGS="${DEFAULT_CFLAGS} $CXXFLAGS $LTO_FLAG -fno-c++-static-destructors -ffile-prefix-map=/webkit/Source=vendor/WebKit/Source -ffile-prefix-map=/webkitbuild/=. " && \
export ENABLE_ASSERTS="AUTO" && \
export LDFLAGS="-fuse-ld=lld $LDFLAGS " && \
if [ -n "$ENABLE_SANITIZERS" ]; then \
export ENABLE_ASSERTS="ON"; \
fi && \
cd /webkitbuild && \
cmake \
-DPORT="JSCOnly" \
Expand All @@ -100,6 +108,8 @@ RUN --mount=type=tmpfs,target=/webkitbuild \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DICU_ROOT=/icu \
-DENABLE_SANITIZERS="$ENABLE_SANITIZERS" \
-DENABLE_ASSERTS="$ENABLE_ASSERTS" \
-G Ninja \
/webkit && \
cd /webkitbuild && \
Expand Down
4 changes: 3 additions & 1 deletion musl-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ if [ "$WEBKIT_RELEASE_TYPE" == "relwithdebuginfo" ]; then
CONTAINER_NAME=bun-webkit-linux-$BUILDKIT_ARCH-dbg
fi

export ENABLE_SANITIZERS=${ENABLE_SANITIZERS:-}

mkdir -p $temp
rm -rf $temp/bun-webkit

docker buildx build -f Dockerfile.musl -t $CONTAINER_NAME --build-arg LTO_FLAG="$LTO_FLAG" --build-arg WEBKIT_RELEASE_TYPE=$WEBKIT_RELEASE_TYPE --progress=plain --platform=linux/$BUILDKIT_ARCH --target=artifact --output type=local,dest=$temp/bun-webkit .
docker buildx build -f Dockerfile.musl -t $CONTAINER_NAME --build-arg ENABLE_SANITIZERS="$ENABLE_SANITIZERS" --build-arg LTO_FLAG="$LTO_FLAG" --build-arg WEBKIT_RELEASE_TYPE="$WEBKIT_RELEASE_TYPE" --progress=plain --platform=linux/$BUILDKIT_ARCH --target=artifact --output type=local,dest=$temp/bun-webkit .