1. Overview

As package build process is controlled by distutils (superseded by setuptools), it’s important to know the current status of distutils and setuptools, why there are mutiple instances of an installation, how it’s possible that different packages uses different versions and understand what is the win-arm64 current support of them and what could be expected in short and long term.

2. Important issues

https://github.com/pypa/setuptools/issues/2372

https://www.python.org/dev/peps/pep-0632/

3. Different distutils instances

3.1. Built-in lib in Python interpreter

3.2. Within stand-alone setuptools package

4. WoA (win-arm64) support

Limitation of the cross-compilation

4.1. Built-in lib in Python interpreter

Test

Test command:
    python setup.py build_ext

CPython(3.10_rc1)/distutils (old)
SETUPTOOLS_USE_DISTUTILS=
    x64
        VSCMD_ARG_TGT_ARCH=
            self.plat_name: win32
            get_platform() win32
            get_host_platform() win32
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x86\cl.exe        
        VSCMD_ARG_TGT_ARCH=arm64
            self.plat_name: win32
            get_platform() win32
            get_host_platform() win32
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x86\cl.exe
            
            Can't build for win-arm64!

    win-arm64
        VSCMD_ARG_TGT_ARCH=
            self.plat_name: win-arm64
            get_platform() win-arm64
            get_host_platform() win-arm64
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\ARM64\cl.exe

        VSCMD_ARG_TGT_ARCH=arm64
            self.plat_name: win-arm64
            get_platform() win-arm64
            get_host_platform() win-arm64
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\ARM64\cl.exe        
        
        Tested projects:
            Cython: successful
            numpy:  successful

4.2. Within stand-alone setuptools package

Test

Test command:
    python setup.py build_ext

setuptools-57.4.0/distutils (new)
SETUPTOOLS_USE_DISTUTILS=local
    x64
        VSCMD_ARG_TGT_ARCH=
            self.plat_name: win32
            get_platform() win32
            get_host_platform() win32
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x86\cl.exe
        VSCMD_ARG_TGT_ARCH=arm64
            self.plat_name: win-arm64
            get_platform() win-arm64
            get_host_platform() win32
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\ARM64\cl.exe

            Tested projects:
                Cython: successful
                numpy:  failed (as numpy relies on old distutils)
    win-arm64
        VSCMD_ARG_TGT_ARCH=
            self.plat_name: win-arm64
            get_platform() win-arm64
            get_host_platform() win-arm64
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\ARM64\cl.exe
        VSCMD_ARG_TGT_ARCH=arm64
            self.plat_name: win-arm64
            get_platform() win-arm64
            get_host_platform() win-arm64
            self.cc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\ARM64\cl.exe

        Tested projects:
            Cython: successful
            numpy:  failed (as numpy relies on old distutils)