-
Notifications
You must be signed in to change notification settings - Fork 231
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
Build and publish Snap image for releases #98
Comments
How is confinement handled in Snaps? fq should be very easy to restrict (syscalls, network access, etc), except for which file paths it needs to access for probing. |
Yeap i think fq has very basic needs, read filsystem, read/write stdout and stderr maybe some ioctls for readline. All interaction with the os (exceptions for some profiling and fuzz things) are done thru the Maybe first step i get a snap config with good confinement working and then look into goreleaser things? I can do -rc tag releases once we have something to try |
name: fq
summary: jq for binary formats
description: |
fq is inspired by the well known jq tool and language and allows you to work with binary formats the same way you would using jq.
In addition it can also present data similar to a hex viewer, transform, slice and concatenate binary data, supports nested formats and has an interactive REPL with auto-completion.
version: git
grade: stable
base: core20
confinement: classic # or strict
apps:
fq:
command: bin/fq
plugs:
- home # should be enough
parts:
fq:
plugin: go
source-type: git
source: https://github.com/wader/fq Do not have a linux system to test this on but should not something like this be enough for a basic golang based IO program? |
Thanks, i guess one maybe can test via docker or emulated if on some non-snap:able platform? what is needed more, some kind of packaging and publish? @Doctor-love any ideas? @Akaame BTW I noticed your name didn't show up as contributor on github for fq, maybe git email configured differently somehow? @Akaame Second BTW if your into binary tools there is a conference going on this weekend https://binary-tools.net/summit.html. I gave a talk about fq yesterday that was recorded so hopefully will show up somewhere soon. |
First BTW: I just realized that I committed to this repo using another git profile. I just realized snapcraft is available on Mac and I already have multipass anyway. Will try if this works and if it does we can simply extend goreleaser.
I think we should not scope creep this particular issue but adding flatpak to out release outputs would also be nice in some other issue. |
I finally got snapcraft working on Mac. We have three problems Snapcraft Go plugin has this line: Which results in the following statement: go install -p 2 -ldflags -linkmode=external ./... However, we want: go install -p 2 -ldflags -linkmode=external . Luckily, we have the build-environment:
- CGO_ENABLED: '0'
override-build: |
go install -p 2 -trimpath -ldflags "-s -w -linkmode=external" . The second problem is that I had to populate Third problem is we need to be able to push created snaps to snapstore for which there is this action: But I have not got around to trying that out. @wader do we have a Slack, Gitter or Discord for faster communication. We can pair up for this issue when you are free. Should not take more than an hour. |
Ok hmm does snapcraft have some tools or sanity checks to make sure that the binaries will actually work in different envs? i'm not familiar with how it works but i guess similar to macOS apps (bring all your deps)? Maybe possible to run goreleaser with some verbose logging to see what is going on? Any ide how common snapcraft is on macOS? maybe a start it to just do it for linux for now?
Push not done by goreleaser?
Good idea. No official channel etc at the moment, any suggestion what to use? |
Maybe can sneak peak at some other go project that uses snapcraft? |
All of them are solid options Kubernetes Terraform etc uses slack. Rust's Tokio uses discord and most other projects use gitter. Totally depends on your taste.
Oh, I re-read the config yaml for goreleaser and it has a
Snapcraft is the builder which is available on macos however snapd itself is not available so you can build snaps (thanks to multipass vm) but cannot use them. So our whole target with these is linux boxes.
That is also what I would suggest. |
One of my OSS friends recommended Zulip. https://waderfq.zulipchat.com/join/eiti77ojarx52b3fzek33mho/ |
@Doctor-love have time to chat with me and @Akaame about snap stuff during the weekend? |
Found a project that uses goreleaser and snapcraft that seem to publish https://github.com/dosco/graphjin/blob/master/.github/workflows/build.yml. It installs snapcraft and logs in on the action host but how can the |
Ah the goreleaser action is not a container https://github.com/goreleaser/goreleaser-action/blob/master/action.yml |
"Snap" is a popular package format that enables Linux users to install and run applications cross-distro.
In order to help potential users discover and use fq, it would be neat to automatically build and publish a snap during the release process.
fq utilizes GoReleaser in the "release" workflow, which according to the document supports building and publishing snaps.
I don't have any experience packaging snaps, so help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: