Fail to build snap on riscv64

The go snap fails to build on riscv64.

The build log is at

The relevant part is

Cannot pack snap file: Command '['snap', 'pack', '--filename', 'go_1.20.2_riscv64.snap', '--compression', 'xz', PosixPath('/build/go/prime'), PosixPath('/build/go')]' returned non-zero exit status 20. (error: cannot pack "/build/go/prime": mksquashfs call failed: must be installed for pthread_cancel to work)

I assume the mksquashfs command is from the snapcraft snap (or snapd snap?)? So it’s broken by missing

Has anyone successfully built snaps with core22 on riscv64?

Have you tried simply adding libgcc (probably with an architecture flag for riscv64) to your build-packages to work around the blocker for the moment?

I think it’s already there. I have build-essential in build-packages. It should brings libgcc-s1. And I can see libgcc-s1 is in the build log.

1 Like

@mvo care to look into this?

it’s already fixed 6 month ago, but not released in riscv64 branch.


Actually libgcc_s1 is in snapd’s snap

$ sudo find /snap/snapd/ -name

but the execution doesn’t include /lib path

ubuntu      1105 97.8  7.4 349004 73152 ttyS0    Sl+  07:47   4:35          \_ /snap/snapd/current/lib/riscv64-linux-gnu/ --library-path /snap/snapd/current/usr/local/lib:/snap/sn
apd/current/usr/local/lib/riscv64-linux-gnu:/snap/snapd/current/lib/riscv64-linux-gnu:/snap/snapd/current/usr/lib/riscv64-linux-gnu /snap/snapd/current/usr/bin/mksquashfs . /home/ubuntu/go-
snap/prime/go_1.20.2_amd64.snap -noappend -comp xz -no-fragments -no-progress -wildcards -ef /tmp/.snap-pack-exclude-704354971 -all-root -no-xattrs 

I merged xnox branch in and triggered a new build, hopefully that fixes the issue. Fwiw, in “edge” the problem is fixed so hopefully that is enough.

@mvo sadly it fails to build… (not sure why apparmor part is dropped in beta-riscv64 branch… accident?)

The snapcraft.yaml in riscv64 branch is almost same with release branch, and the difference is guarded by riscv64 condition… so maybe it’s time to merge back?

Hi zhsj,

The build works after another merge from mvo on 12 April.