forked from zhongfly/mpv-winbuild
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
_
committed
Jan 26, 2025
1 parent
7292844
commit 3292efd
Showing
6 changed files
with
462 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
pgo: | ||
description: "Build llvm with PGO" | ||
required: false | ||
default: false | ||
default: true | ||
type: boolean | ||
no_save_cache: | ||
description: "Don't save caches after success build" | ||
|
@@ -17,24 +17,23 @@ on: | |
trigger_toolchain: | ||
description: "Trigger toolchain build action after success build" | ||
required: false | ||
default: true | ||
default: false | ||
type: boolean | ||
build_target: | ||
description: "Toolchain build target" | ||
required: false | ||
default: "all-64bit" | ||
type: choice | ||
options: | ||
- 32bit | ||
- 64bit | ||
- 64bit-v3 | ||
- 64bit-v4 | ||
- aarch64 | ||
- all-64bit | ||
- all | ||
trigger_build: | ||
description: "Trigger mpv build action after toolchain build" | ||
required: false | ||
default: true | ||
default: false | ||
type: boolean | ||
release: | ||
description: "Publish a release after mpv build" | ||
|
@@ -50,7 +49,7 @@ jobs: | |
name: Build LLVM | ||
runs-on: ubuntu-latest | ||
container: | ||
image: archlinux/archlinux:base-devel | ||
image: cachyos/cachyos-v3:latest | ||
steps: | ||
- name: suffix | ||
id: suffix | ||
|
@@ -59,8 +58,8 @@ jobs: | |
echo "cache_suffix=$cache_suffix" >> "$GITHUB_OUTPUT" | ||
- name: Install Dependencies | ||
run: | | ||
sudo pacman -Syu --noconfirm | ||
sudo pacman -S --noconfirm --needed git ninja cmake meson wget mimalloc go | ||
sudo bash -c 'yes y|pacman -Syu' | ||
sudo bash -c 'yes y|pacman -Sy --needed base-devel dash zlib-ng-compat git ninja cmake meson wget mimalloc go ccache' | ||
mkdir -p /home/opt/7zip | ||
wget -qO - https://www.7-zip.org/a/7z2301-linux-x64.tar.xz | tar -xJf - -C /home/opt/7zip 7zzs | ||
sudo ln -s /home/opt/7zip/7zzs /usr/bin/7z | ||
|
@@ -76,26 +75,26 @@ jobs: | |
- name: Checkout toolchain | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: shinchiro/mpv-winbuild-cmake | ||
repository: Andarwinux/mpv-winbuild-cmake | ||
path: mpv-winbuild-cmake | ||
fetch-depth: 0 | ||
|
||
- name: Build LLVM | ||
uses: ./action/build_toolchain | ||
with: | ||
bit: "64-v3" | ||
bit: "64-v4" | ||
compiler: "clang" | ||
command: "ninja -C $buildroot/build$bit llvm" | ||
extra_option: "${{ inputs.pgo && '-DLLVM_ENABLE_PGO=GEN -DLLVM_PROFILE_DATA_DIR=$PWD/profiles/'}}" | ||
command: "ninja -C $buildroot/build$bit toolchain-download || true ; ninja -C $buildroot/build$bit toolchain-download && ninja -C $buildroot/build$bit llvm-host-libcxx && ninja -C $buildroot/build$bit llvm && ninja -C $buildroot/build$bit toolchain-removebuild" | ||
extra_option: "${{ inputs.pgo && '-DCREL_AVAILABLE=OFF -DCUSTOM_LIBCXX=ON -DCUSTOM_COMPILER_RT=OFF -DLLVM_ENABLE_PGO=GEN -DLLVM_ENABLE_LTO=Thin -DLLVM_PROFILE_DATA_DIR=$PWD/profiles/'}}" | ||
|
||
- name: Training LLVM | ||
uses: ./action/build_toolchain | ||
if: ${{ inputs.pgo }} | ||
with: | ||
bit: "64-v3" | ||
bit: "64-v4" | ||
compiler: "clang" | ||
command: "ninja -C $buildroot/build$bit rebuild_cache && cmake --build $buildroot/build$bit --target llvm-download && ninja -C $buildroot/build$bit llvm-clang" | ||
extra_option: "-DLLVM_ENABLE_PGO=GEN -DLLVM_PROFILE_DATA_DIR=$buildroot/profiles/" | ||
command: "ninja -C $buildroot/build$bit rebuild_cache && ninja -C $buildroot/build$bit toolchain-download && ninja -C $buildroot/build$bit llvm-clang && ninja -C $buildroot/build$bit aria2" | ||
extra_option: "-DCREL_AVAILABLE=OFF -DCUSTOM_LIBCXX=ON -DCUSTOM_COMPILER_RT=OFF -DLLVM_ENABLE_PGO=GEN -DLLVM_ENABLE_LTO=Thin -DCLANG_PACKAGES_LTO=ON -DENABLE_CCACHE=ON -DLLVM_PROFILE_DATA_DIR=$buildroot/profiles/" | ||
|
||
- name: Merging profdata | ||
if: ${{ inputs.pgo }} | ||
|
@@ -110,10 +109,18 @@ jobs: | |
uses: ./action/build_toolchain | ||
if: ${{ inputs.pgo }} | ||
with: | ||
bit: "64-v3" | ||
bit: "64-v4" | ||
compiler: "clang" | ||
command: "ninja -C $buildroot/build$bit llvm && rm -rf clang_root/llvm-thinlto || true" | ||
extra_option: "-DLLVM_ENABLE_PGO=USE -DLLVM_ENABLE_LTO=Thin -DLLVM_PROFDATA_FILE=$buildroot/llvm.profdata" | ||
command: "ninja -C $buildroot/build$bit toolchain-removebuild && ninja -C $buildroot/build$bit llvm-host-compiler-rt-builtin && ninja -C $buildroot/build$bit llvm-host-libcxx && ninja -C $buildroot/build$bit llvm && rm -rf clang_root/llvm-thinlto || true && llvm-strip -s clang_root/bin/llvm-{strings,cvtres} || true" | ||
extra_option: "-DCREL_AVAILABLE=OFF -DCUSTOM_LIBCXX=ON -DCUSTOM_COMPILER_RT=ON -DLLVM_ENABLE_PGO=USE -DLLVM_ENABLE_LTO=Thin -DLLVM_PROFDATA_FILE=$buildroot/llvm.profdata" | ||
|
||
- name: Test | ||
run: | | ||
file mpv-winbuild-cmake/clang_root/bin/llvm | ||
ldd mpv-winbuild-cmake/clang_root/bin/llvm | ||
ls -alh mpv-winbuild-cmake/clang_root/bin/llvm | ||
llvm-readobj --headers --notes mpv-winbuild-cmake/clang_root/bin/llvm | ||
./mpv-winbuild-cmake/clang_root/bin/llvm clang -v | ||
- name: Save llvm cache | ||
uses: actions/cache/[email protected] | ||
|
@@ -133,6 +140,16 @@ jobs: | |
with: | ||
name: llvm_logs | ||
path: logs.7z | ||
- name: "release llvm" | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
prerelease: false | ||
artifacts: mpv-winbuild-cmake/clang_root/bin/llvm | ||
replacesArtifacts: true | ||
tag: llvm | ||
name: llvm | ||
allowUpdates: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
trigger: | ||
|
Oops, something went wrong.