Skip to content

Support for aarch64/arm64 ubuntu-24.04-arm runner#83

Merged
jwlawson merged 3 commits intojwlawson:masterfrom
tomjakubowski:aarch64
Jan 23, 2026
Merged

Support for aarch64/arm64 ubuntu-24.04-arm runner#83
jwlawson merged 3 commits intojwlawson:masterfrom
tomjakubowski:aarch64

Conversation

@tomjakubowski
Copy link
Copy Markdown
Contributor

Add support for aarch64 Linux installs of cmake, and add CI test coverage for the ubuntu-24.04-arm runner in particular.

To implement this change, I changed a bit how universal binaries are handled internally on Darwin. On Mac runs, packages marked with the universal tag are presumed compatible. If a universal package is not available, then x86_64 packages are used. This behavior should support both x86_64 and arm runners for all currently tested releases of cmake.

@tomjakubowski
Copy link
Copy Markdown
Contributor Author

Note that one of the Win32 checks seems to be failing. This is suspicious as I've made changes to architecture detection code. However, from debug logs on my fork, it seems that:

  1. The expected version of cmake is downloaded and installed: win32/i386. See https://github.com/tomjakubowski/actions-setup-cmake/actions/runs/19951066015/job/57210869452
  2. Opening a PR with an empty commit on master has the same error. See test tomjakubowski/actions-setup-cmake#2

So, I think this test failure is preëxisting and is unrelated to my change.

Copy link
Copy Markdown
Owner

@jwlawson jwlawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for looking into this.

For the windows test it seems there's something odd with the shell matching the empty expected version string. Could probably just ignore or exclude that test for now.

Comment thread src/setup-cmake.ts Outdated
Comment thread src/version.ts Outdated
Comment on lines +210 to +217
if (process.platform === 'darwin') {
return ['universal', 'x86_64'];
}
if (process.arch === 'x64') {
return use_32bits ? ['x86'] : ['x86_64', 'x86'];
} else if (process.arch === 'arm64') {
return use_32bits ? ['arm'] : ['aarch64', 'arm'];
} else {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests that more or less cover all these branches? If not is it straightforward to add them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests cover some but I don't think all of these cases. I'll give it an audit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed getArchCandidates() slightly to be a pure function and added unit tests for all of the branches. It would probably better to write more integration tests to cover these branches instead, but I think until then there is some value in having some unit tests for it.

Copy link
Copy Markdown
Contributor Author

@tomjakubowski tomjakubowski Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like cmake doesn't actually release 32-bit arm packages for Linux: https://github.com/Kitware/CMake/releases/tag/v4.2.1

So I think it would make sense to ignore use_32bits when arch === 'arm64' and just always return aarch64. Will update

tomjakubowski added a commit to tomjakubowski/perspective that referenced this pull request Dec 9, 2025
- Use fork of actions-setup-cmake install until arm support is
  upstreamed <jwlawson/actions-setup-cmake#83>
- Add arm runner to matrix + use manylinux container
- Upload built artifacts
tomjakubowski added a commit to tomjakubowski/perspective that referenced this pull request Dec 9, 2025
- Use fork of actions-setup-cmake install until arm support is
  upstreamed <jwlawson/actions-setup-cmake#83>
- Add arm runner to matrix + use manylinux container
- Upload built artifacts

Signed-off-by: Tom Jakubowski <[email protected]>
Add support for aarch64 Linux installs of cmake, and add CI test
coverage for the ubuntu-24.04-arm runner in particular.

To implement this change, I changed a bit how universal binaries are
handled internally on Darwin.  On Mac runs, packages marked with the
`universal` tag are presumed compatible.  If a universal package is not
available, then `x86_64` packages are used.  This behavior should
support both x86_64 and arm runners for all currently tested releases of
cmake.
value: 'linux',
});
expect(process.platform).toBe('linux');
it.each(['arm64', 'x64'] as NodeJS.Architecture[])(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new test case here: testing both arm64 and x64 darwin (they both behave identically in this case)

x86_nock_done: true,
aarch64_nock_done: false,
},
{
Copy link
Copy Markdown
Contributor Author

@tomjakubowski tomjakubowski Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test here for arm64 linux. The nock_done stuff is a little awkward, happy to take suggestions on making that better

}
);

it.each(['x64', 'arm64'] as NodeJS.Architecture[])(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new test case for arm64 darwin (like above, both cases behave identically)

Comment thread tsconfig.json
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
Copy link
Copy Markdown
Contributor Author

@tomjakubowski tomjakubowski Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts-server was complaining that named capture groups in regexes aren't supported in the es5 target. I think this should be a safe change but happy to back it out

- Convert some string types to string literal union types to emphasize
  the distinction between Node's `platform.arch` and the architecture
  values used internally for package selection.
- Internally, `process.platform` and `process.arch` are now only used in
  "top level" invocations.  Internal functions accept platform/arch
  parameters where needed.  This simplifies some setup-cmake tests which
  had previously been monkey-patching the value of `process.platform`,
  and makes it easier to test different arches too.
- The setup-cmake tests had previously been using fixed values for arch
  candidates.  In some cases, these values drifted from what
  getArchCandidates() returned. These tests now invoke
  getArchCandidates() and assert its return value in each case.
- Some setup-cmake tests are now parameterized by arch using
  `test.each()`
@tomjakubowski
Copy link
Copy Markdown
Contributor Author

tomjakubowski commented Dec 18, 2025

I updated the failing win32 CI job to only check whether cmake --version succeeds or not, which should make it turn green while still testing that cmake is installed.

@ds5678
Copy link
Copy Markdown

ds5678 commented Jan 19, 2026

Can this pull request be merged?

@jwlawson jwlawson merged commit af5f669 into jwlawson:master Jan 23, 2026
25 checks passed
tomjakubowski added a commit to tomjakubowski/perspective that referenced this pull request Feb 24, 2026
The change we needed from my fork has been merged:

<jwlawson/actions-setup-cmake#83>

So reverting back away from my fork to the main repo for this action.

Signed-off-by: Tom Jakubowski <[email protected]>
tomjakubowski added a commit to tomjakubowski/perspective that referenced this pull request Feb 24, 2026
The change we needed from my fork to support aarch64 Linux has been
merged:

<jwlawson/actions-setup-cmake#83>

Reverting back away from my fork to the main repo for this action.

Signed-off-by: Tom Jakubowski <[email protected]>
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.

3 participants