project-stacker / stacker

Build OCI images natively from a declarative format
https://stackerbuild.io
Apache License 2.0
188 stars 34 forks source link

How to build? #293

Open hallyn opened 2 years ago

hallyn commented 2 years ago

Hi, squashfs/verity.go says

+// #cgo pkg-config: libcryptsetup libsquashfs1 devmapper --static

So is there a recommended way for building on something like Ubuntu focal, or do we have to build on bleeding edge?

hallyn commented 2 years ago

@tych0 or @smoser did you have a thought on this? Should we simply detect and use libsquashfs0 if it's available, or is it not compatible?

smoser commented 2 years ago

https://github.com/project-stacker/stacker/blob/master/.github/workflows/build.yaml

That shows how it builds in GitHub workflow. It looks like it just grabs squashfs's master from git and builds and installs it. that seems fragile. probably better to work from a stable branch. (like fixes-1.1.0 if it needs 1.1 or 1.0.0 if not).

one other option, that squashtool uses is to build it as non-root and not install it, but then point configure and such to it. https://github.com/anuvu/squashfs/blob/master/setup

hallyn commented 2 years ago

thanks.

hallyn commented 2 years ago

Nah this shouldn't be closed yet - if an ubuntu 20.04 user can't just git clone and build, then that's a problem. Maybe there should at least be a ppa with the needed package, maybe even a yum repo... I'll see, maybe I'll set those up.

tych0 commented 2 years ago

does the code actually use libsquashfs? I thought I found a way to do it without that

smoser commented 2 years ago

Frustrated with cgo recently... I think the right solution to this is probably to replace usage of cgo (at very least for squashfs). Some options:

I had some experience with go-diskfs (unfortunately ending in a bug in fat32 that stopped our usage of it)