canonical / open-documentation-academy

Learn open-source software documentation skills with Canonical
https://canonical.com/documentation/open-documentation-academy
Apache License 2.0
68 stars 39 forks source link

Snapcraft: Update Ruby example to use core22 #4

Open degville opened 8 months ago

degville commented 8 months ago

Update the following how-to guide to use core22 (or core24):

https://snapcraft.io/docs/ruby-applications

Background

Snapcraft's platform quickstart how-to guides help snap developers create a first snap with their chosen framework or development environment. Many of these guides become out of date and need to be revised. Specifically, they may need to be updated to address the following:

Prerequisites

You will need some experience building snaps, and some knowledge of the target framework or development environment.

See also Contribute to our documentation.

pgfaller commented 4 months ago

Hi @degville - I don't have experience with snaps; but I'm willing to learn. If there's no rush, please assign this to me.

degville commented 4 months ago

Hello @pgfaller! Thanks so much for asking - no experience is necessary, and I'll help in any way I can if you have questions. I'll assign the task to you now. A good place to start is with the snap building tutorial: https://snapcraft.io/docs/create-a-new-snap. If you encounter any problems, let me know and we can update the docs. Also let me know if you'd prefer the Ruby text to be within this repository (rather than on the forum).

pgfaller commented 4 months ago

Hi @degville - any idea where I can find the source for the old (core18) ruby plugin? No luck finding it in GitHub ...

pgfaller commented 4 months ago

Hi @degville - I'm running into many obstacles with this:

degville commented 3 months ago

Hi @pgfaller. Sorry for the long delay getting back to you on these. I'll be more responsive from now on. And I'm sorry about the unknown status of the Ruby plugin - this was something I hadn't originally considered. Thanks for putting so much effort into this.

I should try this myself first, but it does seem a snap developer has had some success pulling Ruby in as a standard snap dependency, and building from there with some workarounds. I might give this a go, rather than waste any more of your time, but it may be a way to help Ruby developers build snaps even when the plugin is no longer developed.

Something like this may work, but I should really give it a go myself. I'll look into it and get back to you, but this is what I'm currently thinking.

degville commented 3 months ago

Hi @degville - any idea where I can find the source for the old (core18) ruby plugin? No luck finding it in GitHub ...

I think it's in the legacy version here: https://github.com/canonical/snapcraft/blob/legacy/snapcraft/plugins/ruby.py

pgfaller commented 3 months ago

Hi @degville - I've tried the approaches that you linked to; but without success. Trying to use the Ruby snap as base led quickly to dependency hell. What I don't find in the Snap documentation is a detailed description of what happens in each stage - like what gets copied/linked where; what the final stage and prime directories should end up with; what the eventual runtime environment looks like. Does such documentation exist?

degville commented 3 months ago

Thanks so much for looking into this so deeply, and I'm sorry that's such a bad experience. The closes we have on documenting the runtime environment being built within the snap is probably Iterate over a build. With a clean build, you can run (for example), snapcraft prime --shell to drop you into the snap build environment just before the prime stage.

I really don't want to waste any more of your time on this, as it doesn't seem fair when there's a chance it may come to nothing. I will try to build something myself and share it with you, but I'm also happy to hear what you think may be the best way forward here. Essentially we're working around Ruby being no longer, which doesn't seem like a good use of your time.

pgfaller commented 3 months ago

OK @degville - I'll set this aside for now. I was going to take a look at the Qt5/KDE example instead; but I see userMaximillian is already busy on that.

pgfaller commented 4 weeks ago

@degville Can this be closed off?