Linux packaging docs - #12670
Conversation
tronical
left a comment
There was a problem hiding this comment.
Very nice. This is fairly brief and not too much boilerplate. A few comments within. The biggest pain point that I can see is the skia side. See comments within for three options.
| import { Aside } from '@astrojs/starlight/components'; | ||
| import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
|
|
||
| Linux, unlike other platforms, has countless ways to distribute applications. Each of these has its own pros and cons, different supported distros, etc. For this article, we will focus on [Flatpak](https://flatpak.org/). Here is an incomplete list of the alternatives, with the reason that we think they are less well-suited to our purposes here than Flatpak: |
There was a problem hiding this comment.
Since we're in the guide section, I don't think it's really necessary to justify our choice of Flatpak. A short reference to the alternatives is fine IMO. We're not competing with anyone here :)
| - [AppImage](https://appimage.org/) | ||
| - Less well-supported than Snap and Flatpak, the runtime is not shared between applications so the package size is larger compared to Flatpak and Snap. Additionally, AppImage does not provide sandboxing. Since Slint applications can run seamlessly inside Flatpak/Snap's sandbox, so the increased security of a sandbox doesn't require any tradeoff | ||
|
|
||
| Flatpaks are sandboxed, cross-platform, and they are relatively straightforward to create. |
There was a problem hiding this comment.
This is a positive key phrase :)
| Flatpaks are sandboxed, cross-platform, and they are relatively straightforward to create. | ||
|
|
||
| <Aside type="note"> | ||
| Your application may come with different trade-offs, and so you may want to make another choice. |
There was a problem hiding this comment.
This could be the box where you could very briefly mention alternatives IMO.
| # The "runtime" to use. For desktop applications, this will almost always be | ||
| # `org.freedesktop.Platform` |
There was a problem hiding this comment.
If there's doubt, then I think there's value in explaining it. Otherwise, I think it's better to just state the fact to avoid leaving the reader hanging. Here, I'd just stick to org.freedesktop.Platform and that's it.
A comment on the version might be more relevant, perhaps with a link where readers can find out what versions exists and if it's worth upgrading.
| CARGO_NET_OFFLINE: "true" | ||
| # This is required for Slint's Skia backend, and should match the source below. | ||
| # With the FemtoVG backend, you can remove this line and the relevant source. | ||
| SKIA_BINARIES_URL: file:///run/build/slint-visual-editor/deps/vendor/skia/skia-binaries-a25a0fdb7d90429aa2d1-x86_64-unknown-linux-gnu-gl-jpegd-jpege-pdf-textlayout-vulkan.tar.gz |
There was a problem hiding this comment.
This refers to the visual editor. Subsequent for all the skia related bits, I strongly suggest to leave those out of these instructions for now. There's value in supporting Skia here, but I think that could almost go into a separate section.
That said, it's in our interest to support Skia (for our own needs), and for Linux then alternative that I think is easier to support, without the need to hard-code URLs like the above), is to build skia from sources. I think automating that will be easier because instead of the user having to figure out skia-binaries-a25a0fdb7d90429... type of URLs, we can use the existing meta-data in skia-bindings to determine the correct url for the source sources and prepare that.
I tried a local build with skia sources (by setting SKIA_SOURCE_DIR) and that works within the sandbox.
So I see three paths forward:
- We keep the above as it is. I'd prefer not, because it'll be outdated by the time we release Slint 1.18.
- We omit skia from the instructions for now and I'll try to create a separate PR to add a section and a helper script for apps that would like to include it and then the build will build it from source.
- I'll try to finish my experiment with from-source build and we incorporate it in this PR.
There was a problem hiding this comment.
My preferred path would be 3, although personally I think this is fine. I give instructions on how to figure out which URL to include.
Not that you're suggesting this, but I definitely don't think that leaving it out is an option since Skia is the best-supported renderer. All of those options are viable though, I wouldn't be unhappy with any of them.
There was a problem hiding this comment.
I've included my instructions, so you get to choose :)
…ckaging.mdx Co-authored-by: Simon Hausmann <hausmann@gmail.com>
…ckaging.mdx Co-authored-by: Simon Hausmann <hausmann@gmail.com>
|
One idea I've had is that perhaps it would make sense to integrate this into https://github.com/slint-ui/slint-rust-template . Our tutorial, the vs code extension's quick pick, etc. all use the templates and it would be most convenience to have them in there (maybe in a packaging sub-directory). That's not an acceptance criteria for this PR, but if you feel that this makes sense, please feel free to connect it :) |
| command: slint-test-package | ||
|
|
||
| # The "sdk" to use. Again, this will almost always be `org.freedesktop.Sdk` | ||
| sdk: org.freedesktop.Sdk |
There was a problem hiding this comment.
I also needed this:
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
There was a problem hiding this comment.
Ah, I meant to mention that below in the Rust section. Good catch.
There was a problem hiding this comment.
On second thought, don't we always need this? For C++ we surely do. For Python and Node.js what's in this template is incomplete.
|
Here's what I ended up with in terms of Skia support that's perhaps a bit easier to maintain:
So if the application uses Skia, the dependency is in the lock file, the python script extracts the correct sources and writes them into the sources json file, and gn may or may not be updated (it's not updated frequently IIRC). Overall I think that's not too bad, we could have the python script in our repo and link to it (like we do for the iOS build script), and we could use this ourselves for the visual editor. Suggested options remain, I just wanted to present my findings that IMO make the from-source build easier to maintain. |
…ckaging.mdx Co-authored-by: Simon Hausmann <hausmann@gmail.com>
In my opinion, I think we should make a separate project. Putting the
Funnily enough, I originally wrote out something extremely similar in the docs as a small bash script, but then decided it was overcomplicating things. Just checking the version with |
That's fine with me :) |
Using |
| # The "runtime" to use. For desktop applications, this will almost always be | ||
| # `org.freedesktop.Platform` |
| command: slint-test-package | ||
|
|
||
| # The "sdk" to use. Again, this will almost always be `org.freedesktop.Sdk` | ||
| sdk: org.freedesktop.Sdk |
There was a problem hiding this comment.
On second thought, don't we always need this? For C++ we surely do. For Python and Node.js what's in this template is incomplete.
No description provided.