Support for aarch64/arm64 ubuntu-24.04-arm runner#83
Support for aarch64/arm64 ubuntu-24.04-arm runner#83jwlawson merged 3 commits intojwlawson:masterfrom
Conversation
|
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:
So, I think this test failure is preëxisting and is unrelated to my change. |
jwlawson
left a comment
There was a problem hiding this comment.
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.
| 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 { |
There was a problem hiding this comment.
Do we have tests that more or less cover all these branches? If not is it straightforward to add them?
There was a problem hiding this comment.
The tests cover some but I don't think all of these cases. I'll give it an audit
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
- 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
- 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.
cebfcce to
5fd7858
Compare
| value: 'linux', | ||
| }); | ||
| expect(process.platform).toBe('linux'); | ||
| it.each(['arm64', 'x64'] as NodeJS.Architecture[])( |
There was a problem hiding this comment.
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, | ||
| }, | ||
| { |
There was a problem hiding this comment.
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[])( |
There was a problem hiding this comment.
new test case for arm64 darwin (like above, both cases behave identically)
| /* 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'. */ |
There was a problem hiding this comment.
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()`
08dbf6e to
e50296c
Compare
7e4c92d to
4d7d827
Compare
|
I updated the failing win32 CI job to only check whether |
|
Can this pull request be merged? |
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]>
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]>
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
universaltag are presumed compatible. If a universal package is not available, thenx86_64packages are used. This behavior should support both x86_64 and arm runners for all currently tested releases of cmake.