Repository: pypa/setuptools

Issue:
[BUG] win-arm64 platform is not detected
### setuptools version

latest

### Python version

any

### OS

Windows

### Additional environment information

Only relevant when `%VSCMD_ARG_TGT_ARCH%` is set to `arm64` (for example, in a configured build environment).

### Description

For other values (`x86`, `x64`, `arm`), the `VSCMD_ARG_TGT_ARCH` variable is used to select the platform specifier (see setuptools/_distutils/util.py line 100ish). There is no value for `arm64`, and so it builds for the current platform rather than cross-compiling.

### Expected behavior

When the value is `arm64`, it should select platform `win-arm64`. This allows later steps to select the correct build tools and cross-compile.

Note that you also need to [obtain and] ensure that setuptools will find the ARM64 compatible .lib files for Python. Putting them into a venv's `libs` directory works fine (provided you make sure the build happens in that venv, which is not hard).

### How to Reproduce

1. Open regular command prompt
2. `set VSCMD_ARG_TGT_ARCH=arm64`
3. `pip wheel --no-binary :all: --no-deps --no-cache --no-build-isolation markupsafe` (or any other simple module with native code)

The generated wheel will be for the same platform as the Python it was run with, rather than respecting the target architecture.

If you `set VSCMD_ARG_TGT_ARCH=arm` without getting the right libs, the compilation fails and it generates a `none-any` wheel because markupsafe knows how to handle this. Other packages will just hard fail.

### Output

```console
Collecting markupsafe                                                                                                   
  Downloading MarkupSafe-2.0.1.tar.gz (18 kB)                                                                           
Building wheels for collected packages: markupsafe                                                                      
  Building wheel for markupsafe (setup.py) ... done                                                                     
  Created wheel for markupsafe: filename=MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl size=17214 sha256=cd682d318cfd3a5805c032fa6b1d9e40def490f62be7b4057fcd67cf4f6cc1dc                                                                            
  Stored in directory: C:\...\Temp\pip-ephem-wheel-cache-lgs8awq4\wheels\9f\6d\c8\1f59b07cf85ae842908006ec28f4477f7e4578df72c3eb0e46                                                                                     
Successfully built markupsafe                                                                                           
```

Note that the wheel platform is `win32` or `win_amd64`, and not `win_arm64`.

### Code of Conduct

- [X] I agree to follow the PSF Code of Conduct
[BUG] win-arm64 platform is not detected
### setuptools version

latest

### Python version

any

### OS

Windows

### Additional environment information

Only relevant when `%VSCMD_ARG_TGT_ARCH%` is set to `arm64` (for example, in a configured build environment).

### Description

For other values (`x86`, `x64`, `arm`), the `VSCMD_ARG_TGT_ARCH` variable is used to select the platform specifier (see setuptools/_distutils/util.py line 100ish). There is no value for `arm64`, and so it builds for the current platform rather than cross-compiling.

### Expected behavior

When the value is `arm64`, it should select platform `win-arm64`. This allows later steps to select the correct build tools and cross-compile.

Note that you also need to [obtain and] ensure that setuptools will find the ARM64 compatible .lib files for Python. Putting them into a venv's `libs` directory works fine (provided you make sure the build happens in that venv, which is not hard).

### How to Reproduce

1. Open regular command prompt
2. `set VSCMD_ARG_TGT_ARCH=arm64`
3. `pip wheel --no-binary :all: --no-deps --no-cache --no-build-isolation markupsafe` (or any other simple module with native code)

The generated wheel will be for the same platform as the Python it was run with, rather than respecting the target architecture.

If you `set VSCMD_ARG_TGT_ARCH=arm` without getting the right libs, the compilation fails and it generates a `none-any` wheel because markupsafe knows how to handle this. Other packages will just hard fail.

### Output

```console
Collecting markupsafe                                                                                                   
  Downloading MarkupSafe-2.0.1.tar.gz (18 kB)                                                                           
Building wheels for collected packages: markupsafe                                                                      
  Building wheel for markupsafe (setup.py) ... done                                                                     
  Created wheel for markupsafe: filename=MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl size=17214 sha256=cd682d318cfd3a5805c032fa6b1d9e40def490f62be7b4057fcd67cf4f6cc1dc                                                                            
  Stored in directory: C:\...\Temp\pip-ephem-wheel-cache-lgs8awq4\wheels\9f\6d\c8\1f59b07cf85ae842908006ec28f4477f7e4578df72c3eb0e46                                                                                     
Successfully built markupsafe                                                                                           
```

Note that the wheel platform is `win32` or `win_amd64`, and not `win_arm64`.

### Code of Conduct

- [X] I agree to follow the PSF Code of Conduct


Discussion:

Resolving patch:
diff --git a/setuptools/_distutils/util.py b/setuptools/_distutils/util.py
--- a/setuptools/_distutils/util.py
+++ b/setuptools/_distutils/util.py
@@ -103,6 +103,7 @@ def get_platform():
             'x86' : 'win32',
             'x64' : 'win-amd64',
             'arm' : 'win-arm32',
+            'arm64': 'win-arm64',
         }
         return TARGET_TO_PLAT.get(os.environ.get('VSCMD_ARG_TGT_ARCH')) or get_host_platform()
     else:


Test patch: