diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b747550..4f18610 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: uses: beeware/.github/.github/workflows/app-build-verify.yml@main with: python-version: ${{ matrix.python-version }} - runner-os: windows-latest + runner-os: ${{ matrix.runs-on }} framework: ${{ matrix.framework }} target-platform: windows target-format: VisualStudio @@ -40,10 +40,21 @@ jobs: matrix: python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ] framework: [ "toga", "pyside6", "pygame", "console" ] - # Pygame hasn't published 3.14 wheels yet. - # Toga is waiting on a release of Python.net for 3.14 + runs-on: ["windows-latest", "windows-11-arm"] exclude: + # Github Actions doesn't provide Windows/ARM64 builds for Python 3.10 + - python-version: "3.10" + runs-on: "windows-11-arm" + # Pygame hasn't published 3.14 wheels. - python-version: "3.14" framework: pygame + # Pygame hasn't published any Windows/ARM64 wheels. + - framework: pygame + runs-on: windows-11-arm + # Toga is waiting on a release of Python.net for 3.14 - python-version: "3.14" framework: toga + # Toga tests won't run on Windows/ARM64 until + # https://github.com/actions/partner-runner-images/issues/174 is resolved + - framework: "toga" + runs-on: windows-11-arm diff --git a/.github/workflows/update-binary.yml b/.github/workflows/update-binary.yml index 575378d..1567f8a 100644 --- a/.github/workflows/update-binary.yml +++ b/.github/workflows/update-binary.yml @@ -21,18 +21,18 @@ jobs: python-version: [ "3.11", "3.12", "3.13", "3.14" ] config: - runner: windows-latest - arch: x64 - suffix: '-amd64' + vscode_arch: x64 + arch: amd64 - runner: windows-11-arm - arch: ARM64 - suffix: '-arm64' + vscode_arch: ARM64 + arch: arm64 include: # GitHub doesn't provide ARM64 binaries for Python 3.10 - python-version: "3.10" config: runner: windows-latest - arch: x64 - suffix: '-amd64' + vscode_arch: x64 + arch: amd64 runs-on: ${{ matrix.config.runner }} steps: @@ -67,13 +67,13 @@ jobs: cd stub briefcase build windows visualstudio - echo "Build ${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }} console stub artefact" - mv "./build/console-stub/windows/visualstudio/${{ matrix.config.arch }}/Release/console-stub.exe" ./Stub.exe - 7z a Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip Stub.exe + echo "Build ${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }} console stub artefact" + mv "./build/console-stub/windows/visualstudio/${{ matrix.config.vscode_arch }}/Release/console-stub.exe" ./Stub.exe + 7z a Console-Stub-${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }}.zip Stub.exe - echo "Build ${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }} GUI stub artefact" - mv "./build/gui-stub/windows/visualstudio/${{ matrix.config.arch }}/Release/GUI Stub.exe" ./Stub.exe - 7z a GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip Stub.exe + echo "Build ${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }} GUI stub artefact" + mv "./build/gui-stub/windows/visualstudio/${{ matrix.config.vscode_arch }}/Release/GUI Stub.exe" ./Stub.exe + 7z a GUI-Stub-${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }}.zip Stub.exe echo "Stub binaries:" ls -1 *.zip @@ -88,5 +88,5 @@ jobs: python -m pip install -U setuptools python -m pip install awscli - aws s3 cp stub/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}${{ matrix.config.suffix }}.zip - aws s3 cp stub/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}${{ matrix.config.suffix }}.zip + aws s3 cp stub/Console-Stub-${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/Console-Stub-${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }}.zip + aws s3 cp stub/GUI-Stub-${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/GUI-Stub-${{ env.PYTHON_TAG }}-${{ matrix.config.arch }}-${{ env.BUILD_NUMBER }}.zip diff --git a/.gitignore b/.gitignore index 7b5f52d..d89dfb8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ venv/ stub/build/ stub/dist/ stub/logs/ +*.zip +*.exe diff --git a/{{ cookiecutter.format }}/briefcase.toml b/{{ cookiecutter.format }}/briefcase.toml index 8e146ab..2305743 100644 --- a/{{ cookiecutter.format }}/briefcase.toml +++ b/{{ cookiecutter.format }}/briefcase.toml @@ -12,9 +12,9 @@ extras_path = "extras" {{ { "3.10": "support_revision = 11", "3.11": "support_revision = 9", - "3.12": "support_revision = 9", - "3.13": "support_revision = 8", - "3.14": "support_revision = 0", + "3.12": "support_revision = 10", + "3.13": "support_revision = 13", + "3.14": "support_revision = 4", }.get(cookiecutter.python_version|py_tag, "") }} icon = "{{ cookiecutter.formal_name }}/icon.ico" diff --git a/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}/Main.cpp b/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}/Main.cpp index 45a7f00..96f6f04 100644 --- a/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}/Main.cpp +++ b/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}/Main.cpp @@ -389,13 +389,20 @@ void setup_stdout(FileVersionInfo^ version_info) { // Python uses the CRT for I/O, and it requires the descriptors are reopened. // Windows GUI apps return to the prompt immediately, so console output from // this app is able to contaminate output from other commands being executed; - // but that's better than not seeing console output at all. + // but that's better than not seeing console output at all. However, we can't + // do this in test mode, because it prevents Briefcase seeing test output. FILE *new_stdin; FILE *new_stdout; FILE *new_stderr; - freopen_s(&new_stdin, "CONIN$", "r", stdin); - freopen_s(&new_stdout, "CONOUT$", "w", stdout); - freopen_s(&new_stderr, "CONOUT$", "w", stderr); + wchar_t *app_module_str; + size_t size; + + _wdupenv_s(&app_module_str, &size, L"BRIEFCASE_MAIN_MODULE"); + if (!app_module_str) { + freopen_s(&new_stdin, "CONIN$", "r", stdin); + freopen_s(&new_stdout, "CONOUT$", "w", stdout); + freopen_s(&new_stderr, "CONOUT$", "w", stderr); + } } debug_log("Log started: %S\n", wstr(DateTime::Now.ToString("yyyy-MM-dd HH:mm:ssZ")));