-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Add Snap ARM64 support #298237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Snap ARM64 support #298237
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,12 +7,12 @@ description: | | |||||
| edit-build-debug cycle. | ||||||
|
|
||||||
| architectures: | ||||||
| - build-on: amd64 | ||||||
| - build-on: @@BUILD_ARCHITECTURE@@ | ||||||
| run-on: @@ARCHITECTURE@@ | ||||||
|
|
||||||
| grade: stable | ||||||
| confinement: classic | ||||||
| base: core20 | ||||||
| base: core24 | ||||||
| compression: lzo | ||||||
|
|
||||||
| parts: | ||||||
|
|
@@ -27,9 +27,7 @@ parts: | |||||
| - libatspi2.0-0 | ||||||
| - libcairo2 | ||||||
| - libcanberra-gtk3-module | ||||||
| - libcurl3-gnutls | ||||||
| - libcurl3-nss | ||||||
| - libcurl4 | ||||||
| - libcurl4t64 | ||||||
| - libegl1 | ||||||
| - libdrm2 | ||||||
| - libgbm1 | ||||||
|
|
@@ -59,18 +57,18 @@ parts: | |||||
| - -usr/share/lintian | ||||||
| - -usr/share/man | ||||||
| override-build: | | ||||||
| snapcraftctl build | ||||||
| patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/x86_64-linux-gnu:$ORIGIN:/snap/core20/current/lib/x86_64-linux-gnu' $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome_crashpad_handler | ||||||
| craftctl default | ||||||
| patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/@@DEB_ARCHITECTURE@@-linux-gnu:$ORIGIN:/snap/core24/current/lib/@@DEB_ARCHITECTURE@@-linux-gnu' $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome_crashpad_handler | ||||||
|
||||||
| patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/@@DEB_ARCHITECTURE@@-linux-gnu:$ORIGIN:/snap/core24/current/lib/@@DEB_ARCHITECTURE@@-linux-gnu' $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome_crashpad_handler | |
| patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/@@DEB_MULTIARCH@@:$ORIGIN:/snap/core24/current/lib/@@DEB_MULTIARCH@@' $SNAPCRAFT_PART_INSTALL/usr/share/@@NAME@@/chrome_crashpad_handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DEB_ARCHITECTURE mapping logic is incorrect because it only handles x64 and arm64 architectures. When arch is 'armhf', this ternary expression will incorrectly map it to 'aarch64' instead of the correct 'arm-linux-gnueabihf'.
This will cause the patchelf command in snapcraft.yaml to use the wrong library path for armhf builds, potentially breaking the snap package.
The mapping should handle all three architectures (x64, arm64, armhf) correctly. Looking at the rest of the codebase (e.g., build/linux/debian/calculate-deps.ts:51-54), armhf should map to 'arm-linux-gnueabihf', arm64 to 'aarch64-linux-gnu', and x64 to 'x86_64-linux-gnu'.
See below for a potential fix: