A commonly used CI workflow [1] is to chain the following steps:
> flatpak-builder --stop-at=<module>
> flatpak build <commands to build module from local checkout>
> flatpak-builder --finish-only
Unfortunately, the last step always purge all the compilation cache
created by the first one. All build steps are marked unused by default
and since they are skipped due to the option --finish-only, all of them
are always pruned by the gc function.
As a result, flatpak-builder cache becomes useless, a full compilation
is always performed.
Improve this by not cleaning unused stages when no compilation is done
by flatpak-builder (i.e: when flatpak-builder is used with --export-only
or --finish-only option).
[1]: https://gitlab.gnome.org/GNOME/Initiatives/wikis/DevOps-with-Flatpak
As reported in
https://bugzilla.gnome.org/show_bug.cgi?id=796031#c1
we sometimes hang in libsoup downloading stuff. This uses
an early type initialization to avoid that.
We don't use libsoup for the main download anymore, but
its still used for some things, so better safe than sorry.
Closes: #153
Approved by: alexlarsson
When downloading only we will not be building, so we can skip all the checks for dependencies
and for the state-dir properties.
Closes: #145
Approved by: alexlarsson
This isn't really right, as install doesn't handle an empty subpath
like that. In fact, doing so will break exports.
Closes: #124
Approved by: alexlarsson
This makes sure that ccache is disabled if you don't enable
it on the commandline. This makes sense, because we don't
have any persistant location for the ccache files anyway.
Additionally this is done to work around a race condition initializing
~/.ccache/ccache.conf that causes meson builds to error out.
Closes: #118
Approved by: alexlarsson
This allows you to run --install-from-deps=foo -y to always install all
dependencies. Useful for auto-builders like flathub.
Closes: #107
Approved by: mwleeds
This allows us to pass it through in the case we're running in the same
pid namespace as the flatpak-builder process.
Closes: #100
Approved by: alexlarsson
If there were no change we didn't export and there might be nothing
to install, so print a notice that we're ignoring the install.
Closes: #85
Approved by: alexlarsson
This allows you to build and install the result in a single operation.
If a --repo is given the app is installed from there, otherwise we
build-export it to the flatpak-builder cache repo, which already has
all the objects that are needed in it, so this will not increase
disk-use.
Closes: #81
Approved by: alexlarsson
The function only does I/O, so could fail. Expose failure to the caller
rather than hiding it.
Coverity CID: #208385
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #74
Approved by: alexlarsson
Modules that say "run-tests": true, will run tests after installation,
unless disabled by --disable-tests.
The tests run by default are make check or ninja test, however you
can control the make/ninja target with test-rule, or supply a list
of commands with test-commands. There is also a test-args argument
in build-options, which you can use to give e.g. network access.
The tests are run with readonly access to the install directory, so
they cannot affect the build results.
Closes: #65
Approved by: alexlarsson