Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Apr 30, 2024
1 parent 76c8edb commit 6f12b90
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 48 deletions.
67 changes: 33 additions & 34 deletions .github/workflows/distro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ jobs:
LLVM_PROJECT_COMMIT=${{ needs.get_llvm_project_commit.outputs.LLVM_PROJECT_COMMIT }}
mv llvm-project-$LLVM_PROJECT_COMMIT llvm-project
# build

- name: cibuildwheel
if: ${{ matrix.OS != 'ubuntu-20.04' || matrix.ARCH != 'aarch64' }}
# you need the parens here because of the != and something about yaml???
if: (!contains(matrix.OS, 'ubuntu') || matrix.ARCH != 'aarch64')
shell: bash
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
Expand All @@ -191,7 +190,7 @@ jobs:
cibuildwheel --output-dir wheelhouse
- name: build aarch ubuntu wheel
if: ${{ matrix.OS == 'ubuntu-20.04' && matrix.ARCH == 'aarch64' }}
if: contains(matrix.OS, 'ubuntu') && contains(matrix.ARCH, 'aarch64')
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
Expand All @@ -211,6 +210,28 @@ jobs:
PIP_FIND_LINKS="https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest" \
pip wheel . -v -w wheelhouse
- name: Download cache from container ubuntu
if: contains(matrix.OS, 'ubuntu') && contains(matrix.ARCH, 'x86_64') && (success() || failure())
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
ccache -s
HOST_CCACHE_DIR="$(ccache --get-config cache_dir)"
rm -rf $HOST_CCACHE_DIR
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- name: Reset datetime ccache
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
ccache --print-stats
HOST_CCACHE_DIR="$(ccache --get-config cache_dir)"
find $HOST_CCACHE_DIR -exec touch -a -m -t "${{ needs.get_llvm_project_commit.outputs.DATETIME }}00" {} \;
- name: Clean llvm-project
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
Expand All @@ -220,7 +241,7 @@ jobs:
rm -rf build
- name: Docker prune
if: contains(inputs.MATRIX_OS, 'ubuntu')
if: contains(matrix.OS, 'ubuntu')
shell: bash
run: |
docker system prune -a -f
Expand All @@ -234,43 +255,21 @@ jobs:
WHL=$(ls wheelhouse/mlir-*whl)
echo "MLIR_WHEEL_VERSION=$(python -c "import pkginfo; w = pkginfo.Wheel('$WHL'); print(w.version.split('+')[0] + '+' + w.version.split('+')[1].rsplit('.', 1)[-1])")" | tee -a $GITHUB_OUTPUT
- name: Download cache from container ubuntu
if: (matrix.OS == 'ubuntu-20.04' && matrix.ARCH == 'x86_64') && (success() || failure())
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
ccache -s
HOST_CCACHE_DIR="$(ccache --get-config cache_dir)"
rm -rf $HOST_CCACHE_DIR
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- name: Reset datetime ccache
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
ccache --print-stats
HOST_CCACHE_DIR="$(ccache --get-config cache_dir)"
find $HOST_CCACHE_DIR -exec touch -a -m -t "${{ needs.get_llvm_project_commit.outputs.DATETIME }}00" {} \;
- name: rename non-windows
if: ${{ matrix.OS == 'ubuntu-20.04' || matrix.OS == 'macos-12' }}
if: contains(matrix.OS, 'ubuntu') || contains(matrix.OS, 'macos')
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
rename 's/cp310-cp310/py3-none/' wheelhouse/mlir-*whl
rename 's/cp311-cp311/py3-none/' wheelhouse/mlir-*whl
if [ x"${{ matrix.OS }}" == x"ubuntu-20.04" ] && [ x"${{ matrix.ARCH }}" == x"aarch64" ]; then
if [[ ${{ matrix.OS }} == *"ubuntu"* ]] && [ x"${{ matrix.ARCH }}" == x"aarch64" ]; then
rename 's/x86_64/aarch64/' wheelhouse/mlir-*whl
fi
- name: rename windows
if: ${{ matrix.OS == 'windows-2019' }}
if: contains(matrix.OS, 'windows')
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ls wheelhouse/mlir-*whl | Rename-Item -NewName {$_ -replace 'cp310-cp310', 'py3-none' }
Expand All @@ -283,17 +282,17 @@ jobs:
run: |
for TOOL in "llvm-tblgen" "mlir-tblgen" "mlir-linalg-ods-yaml-gen" "mlir-pdll" "llvm-config" "FileCheck"; do
if [ x"${{ matrix.OS }}" == x"windows-2019" ]; then
if [[ ${{ matrix.OS }} == *"windows"* ]]; then
TOOL="$TOOL.exe"
fi
unzip -j wheelhouse/mlir-*whl "mlir/bin/$TOOL" -d native_tools/
done
if [ x"${{ matrix.OS }}" == x"ubuntu-20.04" ]; then
if [[ ${{ matrix.OS }} == *"ubuntu"* ]]; then
PLAT="linux"
elif [ x"${{ matrix.OS }}" == x"macos-12" ]; then
elif [[ ${{ matrix.OS }} == *"macos"* ]]; then
PLAT="macosx_12_0"
elif [ x"${{ matrix.OS }}" == x"windows-2019" ]; then
elif [[ ${{ matrix.OS }} == *"windows"* ]]; then
PLAT="win"
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
popd
- name: Download cache from container ubuntu
if: matrix.OS == 'ubuntu-20.04' && (success() || failure())
if: contains(matrix.OS, 'ubuntu') && (success() || failure())
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
shell: bash
run: |
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
MATRIX_ARCH: ${{ matrix.ARCH }}

- name: Set up QEMU
if: ${{ matrix.OS == 'ubuntu-20.04' && matrix.ARCH == 'aarch64' }}
if: contains(matrix.OS, 'ubuntu') && contains(matrix.ARCH, 'aarch64')
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.ARCH }}
Expand Down
20 changes: 10 additions & 10 deletions actions/setup_base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ runs:
detached: ${{ inputs.DEBUG_DETACHED }}

- uses: ilammy/[email protected]
if: ${{ inputs.MATRIX_OS == 'windows-2019' }}
if: contains(inputs.MATRIX_OS, 'windows')

- name: Set up Visual Studio shell
if: ${{ inputs.MATRIX_OS == 'windows-2019' }}
if: contains(inputs.MATRIX_OS, 'windows')
uses: egor-tensin/vs-shell@v2
with:
arch: x64

- name: MS Build
if: ${{ inputs.MATRIX_OS == 'windows-2019' }}
if: contains(inputs.MATRIX_OS, 'windows')
uses: microsoft/[email protected]

- name: Free disk space
Expand All @@ -74,7 +74,7 @@ runs:

- name: Install cross-compilation toolchain
shell: bash
if: ${{ inputs.MATRIX_OS == 'ubuntu-20.04' && inputs.MATRIX_ARCH == 'aarch64' }}
if: contains(inputs.MATRIX_OS, 'ubuntu') && inputs.MATRIX_ARCH == 'aarch64'
run: |
sudo apt-get update
Expand All @@ -86,22 +86,22 @@ runs:
run: pip install cibuildwheel wheel

- name: install rename
if: ${{ inputs.MATRIX_OS == 'ubuntu-20.04' || inputs.MATRIX_OS == 'macos-12' }}
if: contains(inputs.MATRIX_OS, 'ubuntu') || contains(inputs.MATRIX_OS, 'macos')
shell: bash
run: |
if [ x"${{ inputs.MATRIX_OS }}" == x"macos-12" ]; then
if [[ ${{ inputs.MATRIX_OS }} == *"macos"* ]]; then
brew install rename
else
sudo apt-get install -y rename
fi
- run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
if: ${{ inputs.MATRIX_OS == 'windows-2019' }}
if: contains(inputs.MATRIX_OS, 'windows')
shell: pwsh

- run: echo "TEMP=/tmp" >> $GITHUB_ENV
if: ${{ inputs.MATRIX_OS == 'ubuntu-20.04' || inputs.MATRIX_OS == 'macos-12' }}
if: contains(inputs.MATRIX_OS, 'ubuntu') || contains(inputs.MATRIX_OS, 'macos')
shell: bash

- name: Set workspace root
Expand All @@ -110,7 +110,7 @@ runs:
working-directory: ${{ env.TEMP }}
run: |
if [ x"${{ inputs.MATRIX_OS }}" == x"windows-2019" ]; then
if [[ ${{ inputs.MATRIX_OS }} == *"windows"* ]]; then
WORKSPACE_ROOT="/C/a"
else
WORKSPACE_ROOT=$GITHUB_WORKSPACE
Expand All @@ -124,7 +124,7 @@ runs:
git clone -b ${{ github.head_ref || github.ref_name }} https://github.com/${{ github.repository }}.git "$WORKSPACE_ROOT"
ls "$WORKSPACE_ROOT"
if [ x"${{ inputs.MATRIX_OS }}" == x"windows-2019" ]; then
if [[ ${{ inputs.MATRIX_OS }} == *"windows"* ]]; then
WORKSPACE_ROOT="C:\a"
fi
Expand Down
2 changes: 1 addition & 1 deletion actions/setup_ccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
shell: bash
run: |
if [ x"${{ contains(inputs.MATRIX_OS, 'macos') }}" == x"true" ]; then
if [[ ${{ inputs.MATRIX_OS }} == *"macos"* ]]; then
echo "/usr/local/opt/ccache/libexec:/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH
else
echo "/usr/lib/ccache:/usr/lib64/ccache:/usr/lib/ccache/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_vulkan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -xe

if [[ x"$BUILD_VULKAN" == x"true" ]]; then
if [ x"$MATRIX_OS" == x"macos-12" ]; then
if [[ $MATRIX_OS == *"macos"* ]]; then
if [ ! -f vulkansdk-macos-1.3.239.0.dmg ]; then
wget -q https://sdk.lunarg.com/sdk/download/1.3.239.0/mac/vulkansdk-macos-1.3.239.0.dmg
sudo hdiutil attach vulkansdk-macos-1.3.239.0.dmg
Expand Down

0 comments on commit 6f12b90

Please sign in to comment.