Provide a --token-type command line option and a token-type manifest
property that allows passing the token type to build-export. The
manifest property takes precendence over the CLI option. In either case,
the value will be passed to build-export if it's >= 0. This requires
flatpak >= 1.6 to use the --token-type option in build-export.
We want to use this in flathub to avoid all the problems we've having
parsing json manifests via the python parser, which isn't *quite* compatible
with json-glib (differs in comment and multiline string support for instance).
Closes: #307
Approved by: alexlarsson
This means when flatpak-builder runs a flatpak command in a subprocess,
we can see the arguments passed to flatpak in the flatpak-builder
output, if -v was used.
Closes: #291
Approved by: alexlarsson
We were printing argv[3] which is wrong (and typically null).
Instead set the error message where it happens and we know
what we were trying to do.
Closes: #269
Approved by: alexlarsson
This is similar to branch and used if branch is not set. However, this
key (as opposed to branch) is overridden by the --default-branch option.
The idea is that most apps in flathub would use default-branch=stable, so
that a standart flatpak-builder command will build a "stable" release.
However, when building a test build we can use --default-branch=test to
override that. Then special cases like theme extensions and other things
that require a specific branch value to work at all can use branch="1.0".
Closes: #264
Approved by: alexlarsson
This way we don't rely on the host appstream-glib which could be old.
We already rely on it in the runtime for appstream-compose.
Closes: #217
Approved by: alexlarsson
appstream-util mirror-screenshots rewrites the xml file in-place, so
we need to break hardlinks the before running it, otherwise it will
modify the cache object in place, breaking the repo.
Closes: #217
Approved by: alexlarsson
Otherwise buildbots, and other non-interactive/clean-room builds might
not have git committer information set, and make it impossible to
successfully commit, and git erroring out with:
*** Please tell me who you are.
Closes: #183
Approved by: alexlarsson
The mirror URL is composed with the file we want using soup_uri_new_with_base,
which means a mirror path that is not /-terminated will have it's last element
stripped off. When parsing the list of sources URI arguments, add a / if needed
before the Soup base URI object is created.
Closes: #198
Approved by: alexlarsson
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