-
Notifications
You must be signed in to change notification settings - Fork 385
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
Add support for building snaps #307
Conversation
Hi @igorljubuncic - Thank you for this, it's extremely helpful! Ponzu has a dev dependency on the Go toolchain. Is there a way to ensure through the snap install that Go (above some defined version) is also installed? and if not, to install it along with Ponzu? |
Yes, absolutely. You can define that with the build-packages keyword - so if you need a package named foobar3-dev, you can add it. For instance, the snapcraft.yaml I uploaded has:
You could have something like:
Similarly, for runtime assets, you can use the stage-packages keyword. I hope this answers your question. |
Hello @igorljubuncic, may I ask, in the context of a snap, can a package dependency be another Snap. I see there's Go already in the snapcraft store. That would seem to be a simple way to ensure Go is available? |
@@ -0,0 +1,26 @@ | |||
name: ponzu | |||
version: '1.0' |
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.
@igorljubuncic - would it be safer to use the same version number as the one most recently tagged (in this case, 0.10.1
)? Sorry, I'm not sure what a 1.0 version might imply to a snap user.
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 version string has no semantic meaning in snaps - you can use anything you like. You can even use the git tag if you like, or any naming scheme you want, whatever makes most sense to you.
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.
On the basis that scope is limited to snap users and changes are restricted to a single new yaml file, this can be approved and make the 0.11.0 release hopefully.
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.
I missed that the PR is on master sorry, PRs are only accepted on "ponzu-dev" branch. Otherwise, previous comments stand.
Hi Ollie, do you need this resubmitted to the dev branch? |
@igorljubuncic if you could even though it's not a change that impacts the Ponzu code base that'd be great. But is the file complete from your perspective? I don't think it factors in the golang build dependency discussed above, so would fail for some users? Could that be added so you have a complete snap.yml? |
Hey Ollie, There are several options available:
https://forum.snapcraft.io/t/stage-snaps/11001 I believe this will fully satisfy your requirements. I'm going to file a new PR - with the same text above, and reference this one. |
Closing as PR superseded by #313 |
Hi Steve,
Following up on what we briefly discussed, this is the PR for building a snap package of ponzu.
Build and test
You can use:
Build locally
I used Ubuntu 18.04 for this.
snap install snapcraft --classic --beta
git clone https://github.com/igorljubuncic/ponzu.git
cd ponzu
git checkout add-snapcraft
snapcraft
This command will generate a .snap file, something like ponzu_1.0_amd64.snap.
Install locally
snap install ponzu_1.0_amd64.snap --dangerous
The --dangerous flag is necessary because the app (snap) does not originate from the snap store just yet and is not digitally signed.
Run ponzu
snap run ponzu "options"
Register dev account
You can do this here: https://snapcraft.io/account.
Register ponzu name in the store
This can be done on the command line with snapcraft:
snapcraft login
snapcraft register
Upload/push ponzu to the store
snapcraft push ponzu_1.0_amd64.snap --release edge
We use release channels to denote risk, as follows:
You can promote to different channels after testing and validation.
Install from store for (a second) test
snap install ponzu --edge
I think this covers it.
Once you land the PR, we can help you with the promotion of ponzu.
Feel free to ask any questions you may have.
Thanks!