flatpak-builder support #1618
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-13#1618
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "v0.6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Recent distributions like
Debian bullseye
don't support QT4 anymore. This pull request provides aflatpak-builder
configuration and instructions how to package PyBitmessage as a flatpak application which bundles QT4.This pull request is also a necessary requirement for https://github.com/Bitmessage/PyBitmessage/issues/1607
Thank you, this is great.
Maybe move the manifest to packages/flatpak?
@ -108,0 +98,4 @@
ebuild.sh - create a package for Gentoo
osx.sh - create a package for OS X
puppy.sh - create a package for Puppy Linux
rpm.sh - create a RPM package
It's probably a typo here, should be
--install-deps-from=
I'll try... need to change some relative paths within the manifest then.
If we already have all dependencies installed on Ubuntu bionic, is it possible to skip building Qt4?
See https://travis-ci.org/github/g1itch/PyBitmessage/jobs/681467891
No, Qt4 is not available in any of the available runtimes on flathub: https://docs.flatpak.org/en/latest/available-runtimes.html
Actually, Qt4 is build within the sandbox and not in Ubuntu.
Well, while this works, it would check out the HEAD revision from the remote origin again. This may not be what you want in case you want to build/package the current working copy state.
@ -108,0 +98,4 @@
ebuild.sh - create a package for Gentoo
osx.sh - create a package for OS X
puppy.sh - create a package for Puppy Linux
rpm.sh - create a RPM package
Fixed. The updated build instructions are now in packages/flatpak/README.md.
flatpak-builder has a cache directory. Qt4 won't be rebuild if this exists from a previous build and the inputs for a build step haven't changed. Not sure if this could be configured in travis-ci somehow...
Maybe you can take my qt5-wip branch and try to build with Qt5?
I tested it and it works fine, now I can use PyBM on Ubuntu 20.04.
For integration into the pipeline I'll have to cache qt and pyqt as they take long to build, but I'll deal with that. Bump the
sip
version and update docs as I requested.@ -0,0 +15,4 @@
git clone git://github.com/Bitmessage/PyBitmessage.git
cd PyBitmessage/
git submodule update --init --recursive
flatpak-builder --install --user -install-deps-from=flathub --force-clean --state-dir=build/.flatpak-builder build/_flatpak org.bitmessage.PyBitmessage.json
flatpak-builder --install --user -install-deps-from=flathub --force-clean --state-dir=build/.flatpak-builder build/_flatpak packages/flatplak/org.bitmessage.PyBitmessage.json
@ -0,0 +18,4 @@
"sources": [
{
"type": "archive",
"url": "https://www.riverbankcomputing.com/static/Downloads/sip/4.19.22/sip-4.19.22.tar.gz",
"url": "https://www.riverbankcomputing.com/static/Downloads/sip/4.19.25/sip-4.19.25.tar.gz",
@ -0,0 +19,4 @@
{
"type": "archive",
"url": "https://www.riverbankcomputing.com/static/Downloads/sip/4.19.22/sip-4.19.22.tar.gz",
"sha256": "e1b768824ec1a2ee38dd536b6b6b3d06de27b00a2f5f55470d1b512306e3be45"
"sha256": "b39d93e937647807bac23579edbff25fe46d16213f708370072574ab1f1b4211"
Also rebase.
It would be great to be able to build the modules separately and upload them to a repo. I don't have time to find out how to do this myself. Can someone do it? Once I have the ability build and publish individual modules, I can make it into an incremental buildbot job.
What do you mean exactly by "publishing" individual modules? If you mean publishing as individual flatpaks I don't think this is possible as flatpaks can only declare dependencies on "runtimes". So you would have to publish and maintain your own "runtime" on flathub, seems a bit overkill to me.
But if you just want to break up the build process that could probably be achieved by splitting the manifest into two or three, four, ... files. You would just have to add simple copy commands to backup the build artifacts to another location outside the build dir and copy them back into the build dir in the final manifest where you build PyBitmessage.
But since this depends highly on your build environment I think you have to do the separation on your own. The
--stop-at
parameter toflatpak-builder
might help you. You can take the current manifest and stop at the last dependency and inspect the build directory:flatpak-builder --user --install-deps-from=flathub --state-dir=build/.flatpak-builder --build-only --stop-at=python-sip build/_flatpak packages/flatpak/org.bitmessage.PyBitmessage.json
.The only issue is that you can't simply "continue" after using the
--stop-at
option asflatpak-builder
always wants a clean/empty build directory and aborts if that is not the case.The solution could be do use different build dirs for each step (per manifest) and add a copy command(s) as the first thing to do in the final
PyBitmessage module
/ manifest.Well, I'm not really familiar with flatpak, but I can compare it to what I do with brew for mac build. There I also have to build some dependencies, such as qt and sip, as the binaries aren't always publicly available. What I do is that the build first tries to install the dependency from a URL (private 'repo'), and if it fails, builds it and uploads it to said repo. Next time the build runs and the dependency hasn't changed (no version bump), no need to build it as it's installed from the URL. I was thinking I can do the same with flatpak but it isn't clear to me how to create my own repo. With brew, I can just specify a URL to install from, so any web server will do.
Each build is started from a clean environment.
What about simply persisting the whole
state-dir
(see--state-dir=build/.flatpak-builder
) across build jobs? Everything is in there. Python and QT4 won't be rebuild if their metadata JSONs didn't change:This doesn't fit into the design of my setup. All build VMs and containers are ephemeral.
Note that the
state-dir
is not the thebuild dir
.build dir
must be clean and empty before every build. But the purpose of thestate-dir
is to be persisted across builds to achieve all the caching and speedups you are looking for.Can't you rsync or archive the whole
state-dir
at the end of a build job and upload it to your server/repository and sync it back to the VM at the beginning of a build job?That's basically a kludge version of what I want.
But usually you can mount some specific persistent volumes/folders/dirs to a ephermeral VM.
The
.flatepak-builder
directory is 5.5G right now. You would save a lot of build job time and network bandwidth if you just reserve some space on the build machine to be mounted persistent across builds.Technically that may work, but isn't suitable for easy deployment and maintenance, it creates another item in infrastructure I have to worry about. Compared that to what I do with brew, it just re-uses an existing web server and cache. How about this: https://pagure.io/flatpak-module-tools , doesn't it do what I want?
As far as I understand this has something to do with "Fedora modules"... not "flatpak modules". It's just using flatpak to build Fedora modules.
The notion of a "module" within the flatpak manifest is nothing which can be exported and deployed as a standalone artifact. Flatpak only has the notion of standalone and sandboxed "applications" which have a single dependency on a runtime. So unless you want to become a flatpak "runtime developer" and "runtime maintainer", an "application" is the only thing you can produce. There are no "modules" from a build artifact / repository / deployment perspective. "Modules" only exist from a source code or "build steps" perspective. The source code can be structured into "modules". But "build artifacts" that can be exported are only standalone "applications".
Can I do something like a
wget && tar xJf module.tar.xz
with fallback toflatpak build-module module1 && tar cJf module1.tar.xz && upload
?Sorry, I'm only familiar with
flatpak-builder
(https://docs.flatpak.org/en/latest/building-introduction.html#flatpak-builder).Ok, how about you just fix the other things I requested (documentation, bump sip, rebase), and the buildbot job will be run manually for now, the splitting into steps I'll deal with separately. This way at least I can have an official flatpak that can be distributed.
Oh, python2 now also needs that git submodules. Too bad.
I guess now this should be considered abandoned. Duplicates: #1755.
@g1itch yes it's a duplicate, the new one has split dependencies and app, so that you don't have to build QT4 everytime you are building a new flatpak of the app.