Skip to content

Commit

Permalink
CI hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
bylaws committed Jun 26, 2024
1 parent 8ee5325 commit 5eecf4c
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 808 deletions.
522 changes: 10 additions & 512 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

83 changes: 1 addition & 82 deletions .github/workflows/msvcrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,92 +84,11 @@ jobs:
llvm-mingw-*.tar.xz
retention-days: 7

linux-cross-windows:
needs: [linux-msvcrt, prepare]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { arch: i686, crt: msvcrt }
- { arch: x86_64, crt: msvcrt }
steps:
- uses: actions/download-artifact@v3
with:
name: linux-${{matrix.crt}}-x86_64-toolchain
- name: Unpack cross toolchain
run: |
tar -Jxf llvm-mingw-*.tar.xz
rm llvm-mingw-*.tar.xz
sudo mv llvm-mingw* /opt/llvm-mingw
echo /opt/llvm-mingw/bin >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
- name: Build
env:
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}}
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}}
PYTHON_VERSION_MINGW: ${{needs.prepare.outputs.PYTHON_VERSION_MINGW}}
TAG: ${{needs.prepare.outputs.TAG}}
run: |
sudo apt-get update && sudo apt-get install autoconf-archive ninja-build
./build-cross-tools.sh /opt/llvm-mingw $(pwd)/install/llvm-mingw ${{matrix.arch}} --with-python
.github/workflows/store-version.sh install/llvm-mingw/versions.txt
cd install
NAME=llvm-mingw-$TAG-${{matrix.crt}}-${{matrix.arch}}
mv llvm-mingw $NAME
zip -9rq ../$NAME.zip $NAME
- uses: actions/upload-artifact@v3
with:
name: windows-${{matrix.crt}}-${{matrix.arch}}-toolchain
path: |
llvm-mingw-*.zip
retention-days: 7

# Run llvm-mingw's tests on x86_64 and i686 with the cross-built corresponding
# toolchains from above.
test-toolchain:
needs: [linux-cross-windows]
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
include:
- { arch: i686, crt: msvcrt }
- { arch: x86_64, crt: msvcrt }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
install: >-
unzip
make
- uses: actions/download-artifact@v3
with:
name: windows-${{matrix.crt}}-${{matrix.arch}}-toolchain
- name: Unpack toolchain
run: |
unzip -q llvm-mingw-*.zip
rm llvm-mingw-*.zip
mv llvm-mingw-* /llvm-mingw
echo /llvm-mingw/bin >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
- name: Run tests
run: |
./run-tests.sh /llvm-mingw
./run-lldb-tests.sh /llvm-mingw
upload:
if: ${{inputs.upload}}
permissions:
contents: write
needs: [linux-msvcrt, linux-cross-windows, test-toolchain, prepare]
needs: [linux-msvcrt, prepare]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
- name: Rearrange files
run: |
rm -rf linux-asserts*
mv *-toolchain/*.zip *-toolchain/*.tar.xz .
mv *-toolchain/* .
unzip *.zip || true
find .
- name: Set environment
run: |
cat parameters/parameters.txt >> $GITHUB_ENV
Expand All @@ -65,7 +67,7 @@ jobs:
fi
cd repo
git config --global user.name "GitHub Actions"
git config --global user.email [email protected]
git config --global user.email [email protected]
git tag -a ${{inputs.tag}} -m "${{inputs.title}}"
# If the commit isn't the tip of a branch, and there are
# differences in workflow files compared with the tip of the
Expand All @@ -83,7 +85,7 @@ jobs:
prerelease="--prerelease"
fi
if ${{inputs.create_release}}; then
gh release create ${{inputs.tag}} --verify-tag $prerelease --title "${{inputs.title}}" --notes "" *.tar.xz *.zip -R ${{github.repository}}
gh release create ${{inputs.tag}} $prerelease --title "${{inputs.title}}" --notes "" *.tar.xz -R ${{github.repository}}
else
gh release upload ${{inputs.tag}} *.tar.xz *.zip --clobber -R ${{github.repository}}
gh release upload ${{inputs.tag}} *.tar.xz --clobber -R ${{github.repository}}
fi
101 changes: 0 additions & 101 deletions .github/workflows/test-libcxx.yml

This file was deleted.

93 changes: 0 additions & 93 deletions .github/workflows/test-llvm.yml

This file was deleted.

12 changes: 6 additions & 6 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ done

if [ -z "$NO_TOOLS" ]; then
./build-llvm.sh $PREFIX $LLVM_ARGS $HOST_ARGS
if [ -z "$NO_LLDB" ] && [ -z "$NO_LLDB_MI" ]; then
./build-lldb-mi.sh $PREFIX $HOST_ARGS
fi
if [ -z "$FULL_LLVM" ]; then
./strip-llvm.sh $PREFIX $HOST_ARGS
fi
# if [ -z "$NO_LLDB" ] && [ -z "$NO_LLDB_MI" ]; then
# ./build-lldb-mi.sh $PREFIX $HOST_ARGS
# fi
# if [ -z "$FULL_LLVM" ]; then
# ./strip-llvm.sh $PREFIX $HOST_ARGS
# fi
./install-wrappers.sh $PREFIX $HOST_ARGS
./build-mingw-w64-tools.sh $PREFIX $HOST_ARGS
fi
Expand Down
11 changes: 2 additions & 9 deletions build-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
# (Redoing a shallow fetch will refetch the data even if the commit
# already exists locally, unless fetching a tag with the "tag"
# argument.)
if git cat-file -e "$LLVM_VERSION" 2> /dev/null; then
# Exists; just check it out
git checkout "$LLVM_VERSION"
else
case "$LLVM_VERSION" in
llvmorg-*)
# If $LLVM_VERSION looks like a tag, fetch it with the
Expand All @@ -117,7 +113,6 @@ if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
git checkout FETCH_HEAD
;;
esac
fi
cd ..
fi

Expand Down Expand Up @@ -307,12 +302,10 @@ cmake \
${CMAKE_GENERATOR+-G} "$CMAKE_GENERATOR" \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=$ASSERTS \
-DLLVM_ENABLE_PROJECTS="$PROJECTS" \
-DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86;NVPTX" \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=$TOOLCHAIN_ONLY \
-DLLVM_ENABLE_ASSERTIONS=$ASSERTS \
-DLLVM_USE_SYMLINKS=False \
-DLLVM_LINK_LLVM_DYLIB=$LINK_DYLIB \
-DLLVM_TOOLCHAIN_TOOLS="llvm-ar;llvm-lib;llvm-ranlib;llvm-objdump;llvm-rc;llvm-cvtres;llvm-nm;llvm-strings;llvm-readobj;llvm-dlltool;llvm-pdbutil;llvm-objcopy;llvm-strip;llvm-cov;llvm-profdata;llvm-addr2line;llvm-symbolizer;llvm-windres;llvm-ml;llvm-readelf;llvm-size;llvm-cxxfilt" \
${HOST+-DLLVM_HOST_TRIPLE=$HOST} \
$CMAKEFLAGS \
..
Expand Down
5 changes: 5 additions & 0 deletions install-wrappers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,8 @@ if [ -n "$EXEEXT" ]; then
;;
esac
fi

ln -sf llvm-strip strip
ln -sf llvm-objcopy objcopy
ln -sf ar-wrapper.sh ar
ln -sf llvm-ranlib ranlib
2 changes: 1 addition & 1 deletion prepare-cross-toolchain-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
SRC="$1"
DEST="$2"

: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
: ${ARCHS:=${TOOLCHAIN_ARCHS-arm64ec}}

CLANG_RESOURCE_DIR="$("$SRC/bin/clang" --print-resource-dir)"
CLANG_VERSION=$(basename "$CLANG_RESOURCE_DIR")
Expand Down
Loading

0 comments on commit 5eecf4c

Please sign in to comment.