Skip to content

Pin the default ARM64 toolset explicitly in build_native.bat - #101

Open
sambvfx wants to merge 1 commit into
NVIDIAGameWorks:mainfrom
sambvfx:arm64-toolset-pin
Open

sambvfx wants to merge 1 commit into
NVIDIAGameWorks:mainfrom
sambvfx:arm64-toolset-pin

Conversation

@sambvfx

@sambvfx sambvfx commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

After #98, an ARM64 bridge build on a Visual Studio 2022 machine with a
side-by-side 14.44 toolset failed at link:

ARM64 toolset: 14.44.35207 (default)
Compiling remixbridge.dll for arm64 ...
remixbridge.cpp
LINK : fatal error LNK1104: cannot open file 'libcpmt.lib'

The same machine built ARM64 before #98, when the script pinned
-vcvars_ver=14.44.

:pick_arm64_toolset reads the default toolset from
Microsoft.VCToolsVersion.default.txt, and when that toolset has the ARM64
libraries it passes no -vcvars_ver. vcvarsall does not read that file
when Microsoft.VCToolsVersion.v143.default.txt exists: it takes its
default from the v143 file. On Visual Studio 2022 the two can differ:
default.txt names the newest installed toolset, while the v143 file keeps
the original one. On that machine the v143 default is most likely an older
toolset without ARM64 libraries: the picker approved 14.44, but vcvarsall
set up the older toolset, which has nothing to link against. Visual Studio
2026, as on the
GitHub release runner, keeps the two in step, which is why the release
workflow passed.

The picker now passes -vcvars_ver=<toolset> for the default toolset too,
so vcvarsall always loads the toolset whose libraries it checked. vcvarsall
accepts a full version when VC\Tools\MSVC\<version> exists. x64 builds
are unchanged.

Testing

  • On this machine (Visual Studio 2022), default.txt names 14.39.33519 and
    v143.default.txt names 14.38.33130. vcvarsall x64_arm64 with no
    -vcvars_ver loads 14.38.33130; with -vcvars_ver=14.39.33519 it loads
    14.39.33519 without errors.
  • The picker run against fake Visual Studio layouts, with the vcvarsall
    call echoed:
    • default.txt 14.44.35207 with ARM64 libraries, v143 default
      14.34.31933 without: before, no -vcvars_ver; now
      -vcvars_ver=14.44.35207.
    • Default without ARM64 libraries, 14.44 and 14.40 with them: picks
      14.44.35207, as before.
    • No toolset with ARM64 libraries: stops with the existing message.
    • x64: no -vcvars_ver, as before.
  • gradlew.bat compileNativeWin64 builds. compileNativeArm64 stops early
    here with the no-libraries message, because this machine has no ARM64
    libraries, so the ARM64 link itself still needs a machine that has them.

🤖 Generated with Claude Code

After NVIDIAGameWorks#98, an ARM64 bridge build on a Visual Studio 2022 machine with a
side-by-side 14.44 toolset failed at link:

```
ARM64 toolset: 14.44.35207 (default)
Compiling remixbridge.dll for arm64 ...
remixbridge.cpp
LINK : fatal error LNK1104: cannot open file 'libcpmt.lib'
```

The same machine built ARM64 before NVIDIAGameWorks#98, when the script pinned
`-vcvars_ver=14.44`.

`:pick_arm64_toolset` reads the default toolset from
`Microsoft.VCToolsVersion.default.txt`, and when that toolset has the ARM64
libraries it passes no `-vcvars_ver`. vcvarsall does not read that file
when `Microsoft.VCToolsVersion.v143.default.txt` exists: it takes its
default from the v143 file. On Visual Studio 2022 the two can differ:
`default.txt` names the newest installed toolset, while the v143 file keeps
the original one. On that machine the v143 default is most likely an older
toolset without ARM64 libraries: the picker approved 14.44, but vcvarsall
set up the older toolset, which has nothing to link against. Visual Studio
2026, as on the
GitHub release runner, keeps the two in step, which is why the release
workflow passed.

The picker now passes `-vcvars_ver=<toolset>` for the default toolset too,
so vcvarsall always loads the toolset whose libraries it checked. vcvarsall
accepts a full version when `VC\Tools\MSVC\<version>` exists. x64 builds
are unchanged.

**Testing**
- On this machine (Visual Studio 2022), `default.txt` names 14.39.33519 and
  `v143.default.txt` names 14.38.33130. `vcvarsall x64_arm64` with no
  `-vcvars_ver` loads 14.38.33130; with `-vcvars_ver=14.39.33519` it loads
  14.39.33519 without errors.
- The picker run against fake Visual Studio layouts, with the vcvarsall
  call echoed:
  - `default.txt` 14.44.35207 with ARM64 libraries, v143 default
    14.34.31933 without: before, no `-vcvars_ver`; now
    `-vcvars_ver=14.44.35207`.
  - Default without ARM64 libraries, 14.44 and 14.40 with them: picks
    14.44.35207, as before.
  - No toolset with ARM64 libraries: stops with the existing message.
  - x64: no `-vcvars_ver`, as before.
- `gradlew.bat compileNativeWin64` builds. `compileNativeArm64` stops early
  here with the no-libraries message, because this machine has no ARM64
  libraries, so the ARM64 link itself still needs a machine that has them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Sam Bourne <sbourne@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant