node plugin: dont crash when running on non-snap arm64 env
Metadata
Current evaluation
Closed unmerged; ARM64 npm-plugin support was fixed via merged PR #1311 in commit a20b49d1.
Resolution: closed resolved
Reason: PR #885 contained no changes and was closed unmerged. Merged PR #1311 addressed the failure through non-Java/Python plugin platform coverage and aarch64 architecture handling in commit a20b49d1.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
When building nodejs based snap in a docker container using snapcraft 8.4.3 the build fails with these logs
```
2024-10-19 13:36:25.195 Architecture "aarch64 ('64bit', '')" is not supported.
2024-10-19 13:36:25.199 Traceback (most recent call last):
2024-10-19 13:36:25.199 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/plugins/npm_plugin.py", line 151, in _get_architecture
2024-10-19 13:36:25.199 node_arch = _NODE_ARCH_FROM_PLATFORM[machine_type][architecture_type[0]]
2024-10-19 13:36:25.200 KeyError: 'aarch64'
2024-10-19 13:36:25.200
2024-10-19 13:36:25.200 The above exception was the direct cause of the following exception:
2024-10-19 13:36:25.200 Traceback (most recent call last):
2024-10-19 13:36:25.200 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_application/services/lifecycle.py", line 270, in run
2024-10-19 13:36:25.201 aex.execute(action, stdout=stream, stderr=stream)
2024-10-19 13:36:25.201 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 324, in execute
2024-10-19 13:36:25.201 self._executor.execute(actions, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.201 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 136, in execute
2024-10-19 13:36:25.201 self._run_action(act, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.201 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 211, in _run_action
2024-10-19 13:36:25.202 handler.run_action(action, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.202 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 171, in run_action
2024-10-19 13:36:25.202 state = handler(step_info, stdout=stdout, stderr=stderr)
2024-10-19 13:36:25.202 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 310, in _run_build
2024-10-19 13:36:25.202 self._run_step(
2024-10-19 13:36:25.202 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 493, in _run_step
2024-10-19 13:36:25.203 return step_handler.run_builtin()
2024-10-19 13:36:25.203 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 108, in run_builtin
2024-10-19 13:36:25.203 return handler()
2024-10-19 13:36:25.203 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 138, in _builtin_build
2024-10-19 13:36:25.203 build_commands = self._plugin.get_build_commands()
2024-10-19 13:36:25.204 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/plugins/npm_plugin.py", line 277, in get_build_commands
2024-10-19 13:36:25.204 arch = self._get_architecture()
2024-10-19 13:36:25.204 File "/snap/snapcraft/current/lib/python3.10/site-packages/craft_parts/plugins/npm_plugin.py", line 153, in _get_architecture
2024-10-19 13:36:25.204 raise InvalidArchitecture(
2024-10-19 13:36:25.204 craft_parts.errors.InvalidArchitecture: Architecture "aarch64 ('64bit', '')" is not supported.
2024-10-19 13:36:25.204 Make sure the architecture name is correct.
2024-10-19 13:36:25.205 Recommended resolution: Make sure the architecture name is correct.
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Closed unmerged; ARM64 npm-plugin support was fixed via merged PR #1311 in commit a20b49d1. | |
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged after the ARM64 node-plugin failure was addressed by merged craft-parts#1311 (commit a20b49d1), which expanded testing of non-Java/Python plugins. | |
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged; the ARM64 non-snap crash was addressed by merged PR #1311, which expanded plugin testing to ARM64. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without merging. The node plugin crash on non-snap arm64 environments was resolved in pull request #1311. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
10
Confidence:
85
|
close stale | Adds aarch64 mapping to npm plugin to prevent crashes on non-snap arm64 environments. PR has been inactive for over 1.7 years with no reviews or CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
92
Complexity:
12
Confidence:
85
|
close stale | Adds aarch64 mapping to _NODE_ARCH_FROM_PLATFORM in npm plugin to prevent crashes on non-snap arm64 environments. Currently inactive for over a year with no maintainer response. |
Update history
| Date | Change |
|---|---|
| closed | |
| updated |
Related work
-
Likely Fixed By:
canonical/craft-parts#1311
(confidence 100%)
Merged commit a20b49d1 added aarch64 handling and broader platform coverage for the npm plugin.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1616502 The nodejs plugin doesn't support the arm64 architecture | snapcraft (launchpad) | closed | Node.js plugin arm64 support was added by snapcore/snapcraft#753, commit 3273adca0, resolving the aarch64 unsupported-architecture error. | |
| #753 Add the arm64 architecture to the nodejs plugin | snapcraft | merged | Merged PR #753 (commit 3273adca0, "Add the arm64 architecture to the nodejs plugin") added arm64/aarch64 Node.js runtime support to snapcraft's nodejs plugin, fixing Launchpad bug #1616502 after manual on-device testing. |