If we do not clear the FDList before entering the main loop, the splice
async command may not complete because the pipe fd is still held. This
fixes an issue where builder_maybe_host_spawnv() hangs indefinitely when
run inside a Flatpak application.
Closes: #100
Approved by: alexlarsson
This way, if anything fails during the initial pull we can remove it
and not be confused by a partial repo on the next run.
Closes: #98
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
This means we can build without xattrs
This only affects new caches, old ones will work fine with the
bare-user repo though.
Closes: #80
Approved by: alexlarsson
This stores the cache in the canonical format (i.e. uid/gid 0 and no
weird permissions). This has two advantages, first of all it matches
what flatpak build-export will produce, so diff:ing with the final
result will make things easier to read, shared repos will be smaller,
etc. Secondly, it will allow us to switch to bare-user-only mode which
means we don't need/use xattrs for the build filesystem.
Note: We bump the cache format as the cache will change affecting
e.g. ostree diff between different cachepoints, so this will rebuild
everything once.
Closes: #80
Approved by: alexlarsson
We used to have a hack where we used a bare-user cache
and a non-user-mode checkout to force a copy. But these
days ostree has a force_copy mode, so lets just use that.
This doesn't really change anything for now, but it will allow
us later to canonicalize the uid/gid in the cache without then
failing to check out due to permission issues.
Closes: #80
Approved by: alexlarsson
This allows inclusion of sources from an external json source similar
to how we do it for modules.
For example, you can use:
"sources": [
{
"type": "shell",
"commands": [ "echo BEFORE include" ]
},
"include.json",
{
"type": "shell",
"commands": [ "echo AFTER include" ]
}
]
with include.json containing:
[
{
"type": "shell",
"commands": [ "echo Shell 1" ]
},
{
"type": "shell",
"commands": [ "echo Shell 2" ]
}
]
This is very useful in the case where the included file is
auto-generated from some other source, such as an npm lockfile.
Closes: #77
Approved by: alexlarsson
* Add more checksum types for files and archives
Many upstreams don't use sha256, some use even stronger checksums like
sha512, and its nice to be able to use these. Some system uses
weaker checksums, which you can work around by recomputing your own,
but sometimes that is a bit painful, for example when you're
auto-generating flatpak-builder manifests based on some other format
such as npm lock files.
This adds all the checksum types that GChecksum supports in the
glib version we currently use: md5, sha1, sha256, sha512
If fuse is not available (for example, the kernel module is not loaded,
or /dev/fuse is not exposed in a build chroot), the tests will currently
fail. Avoid that by skipping them gracefully.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #73
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
Rather than dropping the error on the floor entirely.
Coverity CID: #208384
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #74
Approved by: alexlarsson
Move the call inside a preprocessor condition so we don’t end up with
two `return` lines.
Coverity CID: #208383
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #74
Approved by: alexlarsson
This fixes build with builddir ≠ srcdir and a non-existent builddir: the
$(builddir)/tests/ directory was not being created by the time the .test
files were being written.
This will be submitted upstream to glib-tap.mk in GLib.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #68
Approved by: alexlarsson
This mirrors the one for flatpak.git. There are bits of the
flatpak-builder code which are P2P-specific and which couldn’t be
enabled before.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #68
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
If we're bundling sources we really need to fetch from them because
we want to bundle shallow clones. However, this doesn't work for older
git versions, so pre-emptively fetch those deeply.
Closes: #62
Approved by: alexlarsson
Fetching from shallow clones was added in 1.9.0, so we do deep
clones of submodule repos before that to ensure submodule update
works.
Closes: #62
Approved by: alexlarsson