Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-FileCopyrightText: 2021 The meson-python developers
#
# SPDX-License-Identifier: MIT

name: debug

on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-11-arm
python: '3.14'
architecture: x64
- os: windows-11-arm
python: '3.14'
architecture: arm64
- os: windows-latest
python: '3.14'
- os: windows-latest
python: '3.14'
architecture: x86

steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}
allow-prereleases: true

- run: python -m pip install .

- run: |
import platform
import mesonpy
print('interpreter:', mesonpy._windows_interpreter_arch())
print('platform:', platform.machine().lower())
shell: python
19 changes: 19 additions & 0 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ def _showwarning(message: Union[Warning, str], category: Type[Warning], filename
_log(f'{style.WARNING}meson-python: warning:{style.RESET} {message}')


def _windows_interpreter_arch() -> str:
"""Return the Windows architecture for which the Python interpreter has been compiled."""
match sysconfig.get_platform():
case 'win32':
return 'x86'
case 'win-amd64':
return 'amd64'
case 'win-arm64':
return 'arm64'
raise ValueError


class _clicounter:
def __init__(self, total: int) -> None:
self._total = total
Expand Down Expand Up @@ -846,6 +858,13 @@ def __init__(self,
self._meson_cross_file.write_text(cross_file_data, encoding='utf-8')
self._meson_args['setup'].extend(('--cross-file', os.fspath(self._meson_cross_file)))

elif sys.platform == 'win32':
arch = _windows_interpreter_arch()
nativearch = platform.machine().lower()

if arch != nativearch:
pass

# write the native file
native_file_data = textwrap.dedent(f'''
[binaries]
Expand Down
Loading