Skip to content

Commit

Permalink
Remove arm64 mac targets in release, add stdlib publish to ado
Browse files Browse the repository at this point in the history
  • Loading branch information
idavis committed May 30, 2024
1 parent ea536a8 commit 324ce41
Show file tree
Hide file tree
Showing 11 changed files with 2,873 additions and 1,868 deletions.
3 changes: 2 additions & 1 deletion .ado/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ jobs:
python -m pip install -U pip
python -m pip install -r pip/requirements.txt
python -m pip install -r pip/requirements-manylinux.txt
python -m pip --verbose wheel --verbose --wheel-dir target/raw-wheels ./pip
python -m build --verbose --wheel --outdir target/raw-wheels ./pip
python -m build --verbose --sdist --outdir target/wheels ./pip
auditwheel repair --plat $(AUDITWHEEL_TAG) --wheel-dir target/wheels target/raw-wheels/*.whl
displayName: Build Python packages
Expand Down
86 changes: 35 additions & 51 deletions .ado/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
imageName: 'macOS-latest'
arch: x86_64
ARCHFLAGS: '-arch x86_64'
mac_aarch64:
imageName: 'macOS-latest'
arch: aarch64
ARCHFLAGS: '-arch arm64'
mac_universal:
imageName: 'macOS-latest'
arch: universal
ARCHFLAGS: '-arch arm64 -arch x86_64'
windows:
imageName: 'windows-latest'
arch: x86_64
Expand All @@ -45,16 +37,6 @@ jobs:
cratesIoFeedOverride: $(cratesIoFeedOverride)
toolchainFeed: $(toolchainFeed)
displayName: Install Rust toolchain
condition: ne(variables['Agent.OS'], 'Darwin')

- task: RustInstaller@1
inputs:
rustVersion: ms-$(RUST_TOOLCHAIN_VERSION)
additionalTargets: aarch64-apple-darwin
cratesIoFeedOverride: $(cratesIoFeedOverride)
toolchainFeed: $(toolchainFeed)
displayName: Install Rust toolchain (Mac)
condition: eq(variables['Agent.OS'], 'Darwin')

- script: |
rustc --version
Expand All @@ -68,14 +50,9 @@ jobs:
# prerequisites for building

- pwsh: |
Write-Host "##vso[task.setvariable variable=MACOSX_DEPLOYMENT_TARGET;]10.9"
Write-Host "##vso[task.setvariable variable=MACOSX_DEPLOYMENT_TARGET;]10.12"
displayName: Configure Environment (MACOSX_DEPLOYMENT_TARGET x86_64)
condition: and(eq(variables['Agent.OS'], 'Darwin'), eq(variables['arch'], 'x86_64'))
- pwsh: |
Write-Host "##vso[task.setvariable variable=MACOSX_DEPLOYMENT_TARGET;]11.0"
displayName: Configure Environment (MACOSX_DEPLOYMENT_TARGET aarch64/universal)
condition: and(eq(variables['Agent.OS'], 'Darwin'), ne(variables['arch'], 'x86_64'))
condition: eq(variables['Agent.OS'], 'Darwin')
- template: llvm.yml
parameters:
Expand All @@ -90,40 +67,32 @@ jobs:
- script: |
cargo build -vv --release
displayName: Build (non-Mac)
condition: and(succeeded(), ne(variables['Agent.OS'], 'Darwin'))
- script: |
env ARCHFLAGS="$(ARCHFLAGS)" cargo build -vv --release
displayName: Build (Mac)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
condition: succeeded()
# test the project

- script: |
cargo test -vv --release -- --nocapture
displayName: Test (non-Mac)
condition: and(succeeded(), ne(variables['Agent.OS'], 'Darwin'))
- script: |
env ARCHFLAGS="$(ARCHFLAGS)" cargo test -vv --release -- --nocapture
displayName: Test (Mac x86_64 and universal)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), ne(variables['arch'], 'aarch64'))
condition: succeeded()
# package the project

- script: |
python -m pip install -U pip
python -m pip install -r pip/requirements.txt
displayName: Install Python packages
condition: succeeded()
- script: |
python -m pip --verbose wheel --verbose --wheel-dir target/wheels ./pip
python -m build --verbose --wheel --outdir target/wheels ./pip
displayName: Create Non-Linux Python wheel
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
- script: |
python -m pip install -r pip/requirements-manylinux.txt
python -m pip --verbose wheel --verbose --wheel-dir target/raw-wheels ./pip
python -m build --verbose --wheel --outdir target/raw-wheels ./pip
python -m build --verbose --sdist --outdir target/wheels ./pip
auditwheel repair --plat $(AUDITWHEEL_TAG) --wheel-dir target/wheels target/raw-wheels/*.whl
displayName: Create Linux Python wheel and run Auditwheel
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
Expand All @@ -135,7 +104,7 @@ jobs:
python -m pip install --force-reinstall --no-index --find-links=target/wheels qirrunner
python -m pytest --verbose pip
displayName: Test Python packages
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), ne(variables['arch'], 'aarch64'))
condition: succeeded()
# publish the python artifacts

Expand Down Expand Up @@ -164,6 +133,30 @@ jobs:
displayName: Upload Python Artifacts Linux
condition: eq(variables['Agent.OS'], 'Linux')

# Publish stdlib

- pwsh: |
New-Item -Path $(Build.SourcesDirectory)/target/stdlib -ItemType Directory -Force
Copy-Item -Path $(Build.SourcesDirectory)/stdlib/include/qir_stdlib.h -Destination $(Build.SourcesDirectory)/target/stdlib -Force
Copy-Item -Path $(Build.SourcesDirectory)/runner/NOTICE.txt -Destination $(Build.SourcesDirectory)/target/stdlib -Force
Copy-Item -Path $(Build.SourcesDirectory)/LICENSE -Destination $(Build.SourcesDirectory)/target/stdlib -Force
displayName: Organize qir-stdlib artifacts (all platforms)
- pwsh: |
Copy-Item -Path $(Build.SourcesDirectory)/target/release/libqir_stdlib.a -Destination $(Build.SourcesDirectory)/target/stdlib -Force
displayName: Organize qir-stdlib artifacts (Linux/Mac)
condition: ne(variables['Agent.OS'], 'Windows_NT')
- pwsh: |
Copy-Item -Path $(Build.SourcesDirectory)/target/release/libqir_stdlib.lib -Destination $(Build.SourcesDirectory)/target/stdlib -Force
Copy-Item -Path $(Build.SourcesDirectory)/stdlib/include/libqir_stdlib.def -Destination $(Build.SourcesDirectory)/target/stdlib -Force
displayName: Organize qir-stdlib artifacts (Windows)
condition: eq(variables['Agent.OS'], 'Windows_NT')
- publish: $(System.DefaultWorkingDirectory)/target/stdlib
artifact: qir-stdlib-${{ variables['Agent.OS'] }}-${{ variables['arch'] }}
displayName: Upload stdlib Artifacts

- job: "Merge"
dependsOn:
- Build
Expand All @@ -179,25 +172,16 @@ jobs:
artifact: Wheels.Mac.x86_64
displayName: Download Python Artifacts Mac

- download: current
artifact: Wheels.Mac.aarch64
displayName: Download Python Artifacts Mac

- download: current
artifact: Wheels.Mac.universal
displayName: Download Python Artifacts Mac

- download: current
artifact: Wheels.Linux.x86_64
displayName: Download x86_64 Python Artifacts Linux

- script: |
mkdir -p target/wheels
mv ../Wheels.Linux.x86_64/*manylinux*.whl target/wheels
mv ../Wheels.Linux.x86_64/*.tar.gz target/wheels
mv ../Wheels.Win.x86_64/*.whl target/wheels
mv ../Wheels.Mac.x86_64/*.whl target/wheels
mv ../Wheels.Mac.aarch64/*.whl target/wheels
mv ../Wheels.Mac.universal/*.whl target/wheels
ls target/wheels/*
displayName: Move Py Artifacts to Publishing Dir
Expand Down Expand Up @@ -234,7 +218,7 @@ jobs:

- script: |
mkdir -p target/wheels
mv ../wheels/*.whl target/wheels
mv ../wheels/*.* target/wheels
ls target/wheels/*
displayName: Move Py Artifacts to Publishing Dir
Expand Down
138 changes: 32 additions & 106 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
version: "14.0"
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2

- name: cargo fmt
run: cargo fmt -v --all -- --check
Expand All @@ -51,7 +50,7 @@ jobs:
run: python -m black --check pip

- name: Publish Docs as Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: docs
path: target/doc
Expand All @@ -60,58 +59,19 @@ jobs:
name: Benches
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2

- name: cargo bench
run: cargo bench --workspace

build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build -vv --release
- name: Test
run: cargo test -vv --release -- --nocapture

nightly:
name: Build Nightly
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
components: rustfmt, clippy, llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Build Nightly
run: cargo build -vv --release
- name: Test Nightly
run: cargo test -vv --release -- --nocapture

release:
name: Release
CI:
name: CI
runs-on: ${{ matrix.config.os }}
env: ${{ matrix.config.env }}
strategy:
Expand All @@ -121,17 +81,12 @@ jobs:
- { os: "ubuntu-20.04", arch: "amd64", env: { AUDITWHEEL_TAG: "manylinux_2_31_x86_64" } }
- { os: "ubuntu-22.04", arch: "amd64", env: { AUDITWHEEL_TAG: "manylinux_2_35_x86_64" } }
- { os: "windows-2019", arch: "amd64", env: {} }
- { os: "macos-11", arch: "amd64", env: { MACOSX_DEPLOYMENT_TARGET: 10.9 } }
- { os: "macos-11", arch: "amd64", env: { MACOSX_DEPLOYMENT_TARGET: 10.12 } }
- { os: "macos-14", arch: "arm64", env: {} }
- { os: "macos-14", arch: "universal", env: { ARCHFLAGS: "-arch arm64 -arch x86_64" } }
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
run: rustup show
- shell: pwsh
run: |
rustup target add x86_64-apple-darwin
if: ${{ (matrix.config.os == 'macos-14') && (matrix.config.arch == 'universal') }}
- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
Expand All @@ -157,77 +112,48 @@ jobs:
python -m pip install -r pip/requirements-manylinux.txt
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }}
- name: Package Non-Linux
run: python -m pip --verbose wheel --verbose --wheel-dir target/wheels ./pip
run: python -m build --verbose --wheel --sdist --outdir target/wheels ./pip
if: ${{ matrix.config.os != 'ubuntu-20.04' && matrix.config.os != 'ubuntu-22.04' }}
- name: Package Linux
run: python -m pip --verbose wheel --verbose --wheel-dir target/raw-wheels ./pip
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }}
- name: Auditwheel
run: auditwheel repair --plat $AUDITWHEEL_TAG --wheel-dir target/wheels target/raw-wheels/*.whl
run: |
python -m build --verbose --sdist --outdir target/wheels ./pip
python -m build --verbose --wheel --outdir target/raw-wheels ./pip
auditwheel repair --plat $AUDITWHEEL_TAG --wheel-dir target/wheels target/raw-wheels/*.whl
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }}
- name: Install Test Python packages
run: python -m pip install -r pip/requirements-test.txt
- name: Test Wheel
run: |
python -m pip install -r pip/requirements-test.txt
python -m pip install --force-reinstall --no-index --find-links=target/wheels qirrunner
python -m pytest --verbose pip
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }}
- name: uninstall qirrunner
run: python -m pip uninstall -y qirrunner
- name: Test sdist
run: |
python -m pip install ./target/wheels/qirrunner*.tar.gz
python -m pytest --verbose pip
# qir-stdlib Artifact
- name: qir-stdlib Artifact (Library)
if: ${{ matrix.config.os != 'windows-2019' }}
uses: actions/upload-artifact@v3
with:
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: target/release/libqir_stdlib.a
- name: qir-stdlib Artifact (Library on Windows)
if: ${{ matrix.config.os == 'windows-2019' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: target/release/qir_stdlib.lib
path: |
target/release/libqir_stdlib.a
stdlib/include/qir_stdlib.h
runner/NOTICE.txt
LICENSE
- name: qir-stdlib Artifact (Definition file)
if: ${{ matrix.config.os == 'windows-2019' }}
uses: actions/upload-artifact@v3
with:
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: stdlib/include/qir_stdlib.def
- name: qir-stdlib Artifact (Header file)
uses: actions/upload-artifact@v3
with:
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: stdlib/include/qir_stdlib.h
- name: qir-stdlib Artifact (Notice file)
uses: actions/upload-artifact@v3
with:
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: runner/NOTICE.txt
- name: qir-stdlib Artifact (License file)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: LICENSE
# qir-runner Artifact
- name: Artifacts executable
if: ${{ matrix.config.os != 'windows-2019' }}
uses: actions/upload-artifact@v3
with:
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: target/release/qir-runner
- name: Artifacts executable (Windows)
if: ${{ matrix.config.os == 'windows-2019' }}
uses: actions/upload-artifact@v3
with:
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: target/release/qir-runner.exe
- name: Artifacts Notice file
uses: actions/upload-artifact@v3
with:
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: runner/NOTICE.txt
- name: Artifacts License file
uses: actions/upload-artifact@v3
with:
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: LICENSE
path: |
target/release/qir_stdlib.lib
stdlib/include/qir_stdlib.def
stdlib/include/qir_stdlib.h
runner/NOTICE.txt
LICENSE
- name: Wheel Artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -246,7 +172,7 @@ jobs:
runs-on: "ubuntu-22.04"
needs: fmt
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download Build Artifacts
uses: actions/download-artifact@v2
with:
Expand Down
Empty file modified notice.ps1
100644 → 100755
Empty file.
Loading

0 comments on commit 324ce41

Please sign in to comment.