Skip to content

Commit

Permalink
Merge pull request #80: Add build for osx-arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored Feb 5, 2025
2 parents 9d24e20 + ae05e8c commit d7d23af
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
matrix:
os:
- ubuntu-22.04
- macos-13
- macos-13 # x86_64
- macos-14 # arm64

name: build and test (os=${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -86,6 +87,7 @@ jobs:
nextstrain-base
- name: Generate summary
continue-on-error: true
run: |
./devel/download-latest
./devel/diff-pkgs nextstrain-base-*.conda build/locked/*/nextstrain-base-*.conda \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To build this package locally, run:

The final built package will be written to
`build/locked/<arch>/nextstrain-base-*.conda`, where `<arch>` is a Conda
subdir, e.g. `linux-64` or `osx-64`.
subdir, i.e. `linux-64`, `osx-64` or `osx-arm64`.

[CI][] builds store the entire `build/` and `locked/` directories as an
artifact attached to each CI run. You can download the artifacts to inspect
Expand Down
4 changes: 1 addition & 3 deletions devel/build
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ main() {
export PATH="$env/bin:$PATH"
export VERSION="${VERSION:-$(./devel/generate-version)}"

# Set CONDA_SUBDIR unless it's already set. This helps macOS users on
# arm64 chips use and produce osx-64 Conda packages instead of osx-arm64
# packages (which we don't yet support).
# Set CONDA_SUBDIR unless it's already set.
CONDA_SUBDIR="${CONDA_SUBDIR:-$(./devel/conda-subdir)}"
export CONDA_SUBDIR

Expand Down
2 changes: 1 addition & 1 deletion devel/conda-subdir
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ case "$kernel/$machine" in
echo "osx-64";;

Darwin/arm64)
echo "osx-64";;
echo "osx-arm64";;

*)
echo "unsupported kernel/machine: $kernel/$machine" >&2
Expand Down
4 changes: 3 additions & 1 deletion devel/download-latest
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ export PATH="$env/bin:$PATH"
CONDA_SUBDIR="${CONDA_SUBDIR:-$("$repo"/devel/conda-subdir)}"
export CONDA_SUBDIR

wget "$(
url="$(
curl -fsSL https://api.anaconda.org/package/nextstrain/nextstrain-base/files | jq -r '
map(select(.labels|index("main")))
| map(select(.attrs.subdir == env.CONDA_SUBDIR))
| if length == 0 then ("error: download-latest: no packages found\n" | halt_error) else . end
| max_by([.version, .attrs.build_number])
| .download_url
| if startswith("//") then "https:\(.)" else . end
'
)"
wget "$url"
2 changes: 1 addition & 1 deletion devel/extract-pkg-info
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() {
package="$1"
file="$2"

unzip -p "$package" "info-$(basename "$package" .conda).tar.zst" \
7z e -so "$package" "info-$(basename "$package" .conda).tar.zst" \
| unzstd --stdout \
| tar --extract --to-stdout "info/$file"
}
Expand Down
2 changes: 1 addition & 1 deletion devel/setup
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ create() {
yq

# for extracting files from .conda packages
p7zip
tar
unzip
zstd

# to get gnu `date` on macOS
Expand Down

0 comments on commit d7d23af

Please sign in to comment.