Tips and tricks for porting to win-arm64

This page doesn’t try to be a complete porting guide, just a collection of the learnt approaches during porting Python packages and 3rd party libraries.

Common issues

 

  • Do you have an executable that doesn’t start to run and you don’t see any error messages?

    • If you see this in console, try in GUI (Explorer) again, probably you’ll see some error pop-up window.

    • Do you see this as a CMake error that some simple C or C++ test is not able to run, so the build is aborted?

    • There is a good chance you hit this issue:

 

  • Does the build fail in a very early phrase, reporting there are no C/C++ compiler found?

    • Try to invoke vcvars manually, then repeat it.

      • Powershell

        cmd /k '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_arm64.bat" & powershell'
      • cmd

        "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_arm64.bat"
    • If it’s fixed, you’d need to find where the environment should be set properly by the build process.

 

  • Does any of a dependant external library fail for win-arm64?

    • Check whether there is a newer release for that library.

      • There is a chance it’s already ported, just not donwstreamed.

    • Example:

 

Python related tips

  • Tests

    • Is there a test folder with test pythons scripts, but no hint how to run them?

      • Try install pytest and run this:

 

  • Is vcvars.bat called some of the inner scripts and not setuptools or distutils?

    • Example: Example:

    • Don’t you find where is it defined?

      • Try to search for vcvars or vc_arch

 

  • Do you want to change the invoked toolchain (for example try x64/arm64 instead of the default x86/arm64) and it’s not set by the project?

    • Keep in mind, that even if you’re working within venv, still the installed Python directory is used for setuptools and distutils