-
Notifications
You must be signed in to change notification settings - Fork 333
[Release] Unify local build scripts to use cibuildwheel and reduce size of sdist
#1171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
360cfa9
update exclude in sdist
oraluben ac1c8c3
reuse cibw workflow in maint
oraluben 668299b
update
oraluben fc71a20
fix
oraluben 271f965
fmt
oraluben a81e30e
upload artifacts for [Release] PRs
oraluben ff58bf2
dot-prefix version file
oraluben 52d07d3
Merge remote-tracking branch 'upstream/main' into update-maint-release
oraluben 25a9814
update
oraluben 703e63c
Merge remote-tracking branch 'upstream/main' into update-maint-release
oraluben 54ff485
Merge remote-tracking branch 'upstream/main' into update-maint-release
oraluben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,70 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| set -euxo pipefail | ||
|
|
||
| IMAGE="tilelang-builder:manylinux" | ||
|
|
||
| HOST_UNAME=$(uname -m) | ||
| case "$HOST_UNAME" in | ||
| x86_64) TARGETARCH=amd64 ;; | ||
| aarch64|arm64) TARGETARCH=arm64 ;; | ||
| *) echo "Unsupported architecture: $HOST_UNAME" >&2; exit 1 ;; | ||
| esac | ||
|
|
||
| if docker buildx version >/dev/null 2>&1; then | ||
| if docker info >/dev/null 2>&1; then | ||
| docker run --rm --privileged tonistiigi/binfmt --install amd64,arm64 >/dev/null 2>&1 || true | ||
| fi | ||
|
|
||
| if ! docker buildx inspect multi >/dev/null 2>&1; then | ||
| docker buildx create --name multi --driver docker-container --use >/dev/null 2>&1 || true | ||
| else | ||
| docker buildx use multi >/dev/null 2>&1 || true | ||
| fi | ||
| docker buildx inspect --bootstrap >/dev/null 2>&1 || true | ||
|
|
||
| for ARCH in amd64 arm64; do | ||
| TAG_PLATFORM="linux/${ARCH}" | ||
| TAG_IMAGE="${IMAGE}-${ARCH}" | ||
|
|
||
| docker buildx build \ | ||
| --platform "${TAG_PLATFORM}" \ | ||
| --build-arg TARGETARCH="${ARCH}" \ | ||
| -f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" \ | ||
| -t "${TAG_IMAGE}" \ | ||
| --load \ | ||
| . | ||
|
|
||
| script="sh maint/scripts/local_distribution.sh" | ||
| docker run --rm \ | ||
| --platform "${TAG_PLATFORM}" \ | ||
| -v "$(pwd):/tilelang" \ | ||
| "${TAG_IMAGE}" \ | ||
| /bin/bash -lc "$script" | ||
|
|
||
| if [ -d dist ]; then | ||
| mv -f dist "dist-local-${ARCH}" | ||
| fi | ||
| done | ||
|
|
||
| else | ||
| echo "docker buildx not found; building only host arch: ${TARGETARCH}" >&2 | ||
| TAG_IMAGE="${IMAGE}-${TARGETARCH}" | ||
| TAG_PLATFORM="linux/${TARGETARCH}" | ||
|
|
||
| docker build \ | ||
| --build-arg TARGETARCH="$TARGETARCH" \ | ||
| -f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" \ | ||
| -t "${TAG_IMAGE}" \ | ||
| . | ||
|
|
||
| script="sh maint/scripts/local_distribution.sh" | ||
| docker run --rm \ | ||
| --platform "${TAG_PLATFORM}" \ | ||
| -v "$(pwd):/tilelang" \ | ||
| "${TAG_IMAGE}" \ | ||
| /bin/bash -lc "$script" | ||
|
|
||
| if [ -d dist ]; then | ||
| mv -f dist "dist-local-${TARGETARCH}" | ||
| fi | ||
| fi | ||
| # Build for local architecture | ||
| CIBW_BUILD='cp38-*' cibuildwheel . |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.