Skip to content

Conversation

@ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Dec 8, 2025

Upgrades to core22 (Ubuntu 22.04) from core(16) that didn't support architectures in addition to be very outdated.

Declares the arm64 target in addition to the amd64 target. Both can be built on either target, but because of the target specific tarball, they must each be built separately.

Adds the make push target as a convenient helper.

The Makefile now takes explicit variables instead of implicit environment variables:

  • ARCH: any architecture supported by crystal & snap (amd64 and arm64).
  • GRADE: the snap grade (devel or stable).
  • CHANNEL: the snap channel (edge or edge/<branch>).

For example:

$ make ARCH=amd64 CRYSTAL_TARBALL=/tmp/workspace/build/crystal-$(CRYSTAL_VERSION)-1-linux-x86_64.tar.gz GRADE=$SNAP_GRADE
$ make ARCH=arm64 CRYSTAL_TARBALL=/tmp/workspace/build/crystal-$(CRYSTAL_VERSION)-1-linux-aarch64.tar.gz GRADE=$SNAP_GRADE
$ make push CHANNEL=$SNAP_CHANNEL

@ysbaddaden
Copy link
Contributor Author

ysbaddaden commented Dec 8, 2025

Back to DRAFT. It's not working, the docker image is var outdated (3 years ago) and base: core refers to Ubuntu 16 😨.

We shall upgrade to https://github.com/canonical/snapcraft-rocks and core22 or core24 (recommended). I'm testing locally, but I'm hitting issues with architecture or platform

@ysbaddaden ysbaddaden marked this pull request as draft December 8, 2025 12:02
@ysbaddaden
Copy link
Contributor Author

Wonderful the official docker images 8_core22 and 8_core24 fail to find the core22 and core24 bases 🤦

@ysbaddaden ysbaddaden force-pushed the build-snap-for-arm64 branch from b8a3b98 to b535b07 Compare December 8, 2025 15:16
@ysbaddaden
Copy link
Contributor Author

After fighting for too many houurs, I found out that we don't need the snapcraft-rocks docker image, LXD or even multipass: we can just install snapd, snapcraft then build as the current user on the host itself with SNAPCRAFT_BUILD_ENVINRONMENT=host

@ysbaddaden
Copy link
Contributor Author

I'll try to upgrade to core24 later. I can't build it from an Ubuntu 22.04 host.

@ysbaddaden
Copy link
Contributor Author

I'm trying to get snapd & snapcraft setup on CircleCI, and I don't succeed so far.

@ysbaddaden
Copy link
Contributor Author

@ysbaddaden ysbaddaden marked this pull request as ready for review December 8, 2025 19:20
Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

The OP is out of date: It should use ARCH, maybe other changes need to be mentioned as well, there or in the readme?

adopt-info: crystal

architectures:
- build-on: [amd64]
Copy link
Member

Choose a reason for hiding this comment

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

question: Is it not possible to build on arm64 for amd64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose we can.

@ysbaddaden ysbaddaden force-pushed the build-snap-for-arm64 branch from e837952 to c6ca8ec Compare December 9, 2025 11:24
@ysbaddaden
Copy link
Contributor Author

@ysbaddaden
Copy link
Contributor Author

I added the push target to the Makefile.

CircleCI will pack and upload directly in the same job (so we avoid installing snapcraft twice) and removed the build output folder. I don't think there's much point to push them as build artifacts anymore?

@ysbaddaden
Copy link
Contributor Author

I updated the PR description with all the latest changes.

@ysbaddaden ysbaddaden changed the title Snap: add arm64 build target Snap: core22 + arm64 build target + make push Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants