Skip to content

Commit

Permalink
Update llvm/clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Feb 5, 2024
1 parent 08f8811 commit 862a498
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ jobs:
settings:
- host: macos-14
target: 'x86_64-apple-darwin'
setup: brew install nasm
setup: brew install nasm llvm
build: |
rustc --print target-cpus
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
yarn build --target x86_64-apple-darwin
strip -x skia.darwin-x64.node
downloadTarget: ''
- host: windows-latest
build: yarn build --target x86_64-pc-windows-msvc
Expand All @@ -39,10 +40,7 @@ jobs:
target: 'x86_64-unknown-linux-gnu'
downloadTarget: ''
docker: ghcr.io/brooooooklyn/canvas/ubuntu-builder:jammy
build: >-
set -e &&
yarn build --target x86_64-unknown-linux-gnu &&
strip skia.linux-x64-gnu.node
build: yarn build --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
downloadTarget: 'x86_64-unknown-linux-musl'
target: 'x86_64-unknown-linux-musl'
Expand All @@ -52,20 +50,22 @@ jobs:
export LIB_AOM_STATIC_LIB_PATH=/usr/lib &&
export LIB_AOM_INCLUDE_PATH=/usr/include/aom/aom &&
export LIB_AOM_PKG_CONFIG_PATH=/usr/lib/pkgconfig &&
yarn build --target x86_64-unknown-linux-musl &&
strip skia.linux-x64-musl.node
yarn build --target x86_64-unknown-linux-musl
- host: macos-14
downloadTarget: 'aarch64-apple-darwin'
target: 'aarch64-apple-darwin'
setup: |
brew install llvm
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
export MACOSX_DEPLOYMENT_TARGET='11.0'
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
yarn build --target aarch64-apple-darwin
strip -x skia.darwin-arm64.node
- host: ubuntu-latest
downloadTarget: 'aarch64-unknown-linux-gnu'
target: 'aarch64-unknown-linux-gnu'
Expand All @@ -74,8 +74,7 @@ jobs:
set -e &&
rustup toolchain install $(cat ./rust-toolchain) &&
rustup target add aarch64-unknown-linux-gnu &&
yarn build --target aarch64-unknown-linux-gnu &&
llvm-strip-16 skia.linux-arm64-gnu.node
yarn build --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: 'aarch64-unknown-linux-musl'
downloadTarget: 'aarch64-unknown-linux-musl'
Expand All @@ -88,8 +87,7 @@ jobs:
export LIB_AOM_PKG_CONFIG_PATH=/usr/aarch64-alpine-linux-musl/aom/lib/pkgconfig/aom.pc &&
export LIB_AOM_INCLUDE_PATH=/usr/aarch64-alpine-linux-musl/aom/include &&
export LIB_AOM_STATIC_LIB_PATH=/usr/aarch64-alpine-linux-musl/aom/lib &&
yarn build --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip skia.linux-arm64-musl.node
yarn build --target aarch64-unknown-linux-musl
- host: ubuntu-latest
target: 'armv7-unknown-linux-gnueabihf'
downloadTarget: 'armv7-unknown-linux-gnueabihf'
Expand All @@ -103,9 +101,7 @@ jobs:
sudo docker cp ubuntu-jammy-armv7:/usr/lib/llvm-14/lib /usr/arm-linux-gnueabihf/lib/llvm-14/lib
sudo docker cp ubuntu-jammy-armv7:/usr/lib/llvm-14/include /usr/arm-linux-gnueabihf/lib/llvm-14/include
docker stop ubuntu-jammy-armv7
build: |
yarn build --target armv7-unknown-linux-gnueabihf --zig --zig-link-only --zig-abi-suffix=2.18
arm-linux-gnueabihf-strip skia.linux-arm-gnueabihf.node
build: yarn build --target armv7-unknown-linux-gnueabihf --zig --zig-link-only --zig-abi-suffix=2.18
- host: ubuntu-latest
target: 'aarch64-linux-android'
downloadTarget: 'aarch64-linux-android'
Expand All @@ -115,7 +111,6 @@ jobs:
chmod 777 "${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/${CLANG_VERSION}/lib/linux/aarch64/libgcc.a"
echo "INPUT(-lunwind)" > "${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/${CLANG_VERSION}/lib/linux/aarch64/libgcc.a"
yarn build --target aarch64-linux-android
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip skia.android-arm64.node
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/skia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
shell: bash

- name: Install tools on macOS
run: brew install ninja
run: brew install ninja llvm
if: matrix.os == 'macos-14'

- name: Install tools on Windows
Expand Down Expand Up @@ -83,6 +83,8 @@ jobs:
env:
PYTHONHTTPSVERIFY: 0
run: |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
node ./scripts/build-skia.js
- name: Compile skia
Expand Down Expand Up @@ -128,10 +130,13 @@ jobs:
shell: bash

- name: Install tools on macOS
run: brew install ninja
run: brew install ninja llvm

- name: Compile skia
run: node ./scripts/build-skia.js --target=aarch64-apple-darwin
run: |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang --version
node ./scripts/build-skia.js --target=aarch64-apple-darwin
env:
MACOSX_DEPLOYMENT_TARGET: '11.0'

Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ mimalloc-rust = { version = "0.2", features = ["local-dynamic-tls"] }
[build-dependencies]
cc = "1"
napi-build = "2"

[profile.release]
lto = true
codegen-units = 1
strip = "symbols"

1 comment on commit 862a498

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 862a498 Previous: c0be5da Ratio
Draw house#skia-canvas 29 ops/sec (±0.47%) 29.51 ops/sec (±0.36%) 1.02
Draw house#node-canvas 38 ops/sec (±0.71%) 37.26 ops/sec (±0.59%) 0.98
Draw house#@napi-rs/skia 30 ops/sec (±0.65%) 29.52 ops/sec (±0.8%) 0.98
Draw gradient#skia-canvas 28 ops/sec (±0.25%) 28.5 ops/sec (±0.25%) 1.02
Draw gradient#node-canvas 36 ops/sec (±0.54%) 36.3 ops/sec (±0.53%) 1.01
Draw gradient#@napi-rs/skia 29 ops/sec (±0.44%) 28.3 ops/sec (±0.64%) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.