indygreg / indygreg/PyOxidizer

Builds do not work for Apple M1 target in GitHub Actions

Open
#566 14 comments 0 reactions 0 assignees View on GitHub
bug need-info
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

```
resolving 1 targets
resolving target exe
error[PYOXIDIZER_BUILD]: could not find default Python distribution for x86_64-apple-darwin
--> app/pyoxidizer.bzl:6:12
|
6 | dist = default_python_distribution(flavor="standalone_static")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ default_python_distribution()

error: could not find default Python distribution for x86_64-apple-darwin
```

```
resolving 1 targets
resolving target exe
error[PYOXIDIZER_BUILD]: could not find default Python distribution for aarch64-apple-darwin
--> app/pyoxidizer.bzl:6:12
|
6 | dist = default_python_distribution(flavor="standalone_static")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ default_python_distribution()

error: could not find default Python distribution for aarch64-apple-darwin
```

```yaml
name: build

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
PYTHON_VERSION: "3.10"

jobs:
apple-intel:
name: Build standalone executable for macOS Intel
runs-on: macos-10.15

env:
TARGET: "x86_64-apple-darwin"
MACOSX_DEPLOYMENT_TARGET: "10.15"

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install PyOxidizer
run: python -m pip install --upgrade pyoxidizer

- name: Install Rust target
run: rustup target add ${{ env.TARGET }}

- name: Build executable
run: pyoxidizer build exe --path app --release --target-triple ${{ env.TARGET }}

- name: Strip binary
run: strip app/build/${{ env.TARGET }}/release/exe/devenv

- name: Setup artifact directory
run: |
mv app/build/${{ env.TARGET }}/release targets
mv targets/exe targets/${{ env.TARGET }}

- uses: actions/upload-artifact@v3
with:
name: artifacts
path: targets
if-no-files-found: error
apple-m1:
name: Build standalone executable for macOS M1
runs-on: ubuntu-20.04

env:
TARGET: "aarch64-apple-darwin"
MACOSX_DEPLOYMENT_TARGET: "11.0"

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Install PyOxidizer
run: python -m pip install --upgrade pyoxidizer

- name: Install Rust target
run: rustup target add ${{ env.TARGET }}

- name: Build executable
run: pyoxidizer build exe --path app --release --target-triple ${{ env.TARGET }}

- name: Strip binary
run: strip app/build/${{ env.TARGET }}/release/exe/devenv

- name: Setup artifact directory
run: |
mv app/build/${{ env.TARGET }}/release targets
mv targets/exe targets/${{ env.TARGET }}

- uses: actions/upload-artifact@v3
with:
name: artifacts
path: targets
if-no-files-found: error
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with app/pyoxidizer.bzl at line 6 and the GitHub Actions jobs for the x86_64-apple-darwin and aarch64-apple-darwin targets. Check how PyOxidizer resolves Python distributions and how the Rust targets and QEMU setup are used; done means both Apple builds complete and their artifacts are uploaded successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python, rust
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.