Commit Graph

3350 Commits (master)
 

Author SHA1 Message Date
Christian Hergert 1929fd1cc6 utils: clear GUnixFDList before entering main loop
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
2018-01-12 10:06:12 +00:00
Alexander Larsson 63e0722cb0 git: When mirroring a new repo, use a temporary destination
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
2018-01-11 09:30:42 +00:00
Alexander Larsson 9b4f14cd45 Add flatpak_file_rename
Closes: #98
Approved by: alexlarsson
2018-01-11 09:30:42 +00:00
Alexander Larsson cd0c9da8f3 Fix --disable-updates for git sources
We lost the ability to not update if a git repo was already checked out.
This fixes that again.

Closes: #98
Approved by: alexlarsson
2018-01-11 09:30:42 +00:00
Will Thompson c06ee375c3 docs: fix "concatinated" and "inbetween" typos
"In between" is two separate words, but I think rewording it is clearer.

Closes: #94
Approved by: pwithnall
2018-01-08 10:54:53 +00:00
Alexander Larsson 543f25e8e3 --install: Fix path != NULL assertion when not using --repo
Closes: #86
Approved by: alexlarsson
2017-12-20 10:18:27 +00:00
Alexander Larsson d869c778ce --install: Fix double unref when --repo is not installed
export_repo is an autopr, so we have to ref it.

Closes: #86
Approved by: alexlarsson
2017-12-20 10:18:27 +00:00
Alexander Larsson 0ee2315818 Update NEWS for release 2017-12-15 14:32:30 +01:00
Alexander Larsson 48c504af8f Bump version to 0.10.6 2017-12-15 14:26:36 +01:00
Alexander Larsson 471adbaf21 Update requirements to flatpak 0.10.2 and ostree 2017.14 2017-12-15 14:25:02 +01:00
Alexander Larsson 5305a17915 --install: Always pass --reinstall
Otherwise the second --install failes

Closes: #85
Approved by: alexlarsson
2017-12-15 13:04:20 +00:00
Alexander Larsson 07240bf3a7 --install: Warn if --require-changes and --install interact badly
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
2017-12-15 13:04:20 +00:00
Alexander Larsson be191a57f1 --install: Don't pass relative path to flatpak install
That is parsed as a remote name, so ensure we pass the absolute pathname.

Closes: #85
Approved by: alexlarsson
2017-12-15 13:04:20 +00:00
Alexander Larsson 050feb1294 Add --install argument
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
2017-12-14 09:27:59 +00:00
Alexander Larsson 2075da5919 docs: Fix spelling
Closes: #81
Approved by: alexlarsson
2017-12-14 09:27:59 +00:00
Alexander Larsson 39ad84c499 flatpak_compose_ref: Remove unused error argument
Closes: #81
Approved by: alexlarsson
2017-12-14 09:27:59 +00:00
Alexander Larsson 61ae14a6b8 Switch to bare-user-only cache repo mode
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
2017-12-14 08:53:58 +00:00
Alexander Larsson 6a8e2af98f Store cache in canonical format
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
2017-12-14 08:53:58 +00:00
Alexander Larsson c421beb086 cache: Use force_copy instead of hack
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
2017-12-14 08:53:58 +00:00
Alexander Larsson 960c36ab88 appdata: Only rename complete matches of the id
We don't want to rename partial hits of the desktop id, nor
inside any other tag.

Fixes https://github.com/flatpak/flatpak/issues/1118

Closes: #83
Approved by: alexlarsson
2017-12-14 08:47:51 +00:00
Alexander Larsson 6529c39083 Support including json snippet for sources
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
2017-12-08 15:00:56 +00:00
Alexander Larsson c572831b21 Add g_autoptr(BuilderObjectList) support
This is a deeply freed GList of GObjects.

Closes: #77
Approved by: alexlarsson
2017-12-08 15:00:56 +00:00
Alexander Larsson 5a6a3a830b Don't require checksum for inline data
This fixes a regression from ac38819106

Closes: #79
Approved by: pwithnall
2017-12-08 11:14:06 +00:00
Alexander Larsson ac38819106 Fix file sources that have no sha256 checksums (but have others)
This was missing from the previous commit, and makes file sources
work just like archive sources.

Closes: #78
Approved by: pwithnall
2017-12-08 09:54:46 +00:00
Alexander Larsson adc84ac4ca
Add more checksum types for files and archives (#75)
* 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
2017-12-07 15:40:04 +01:00
Philip Withnall 336be88040 tests: Skip tests if fuse is not available
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
2017-12-06 10:09:08 +00:00
Philip Withnall 26e648ae99 context: Expose errors from builder_context_set_checksum_for()
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
2017-12-06 09:23:17 +00:00
Philip Withnall 4e4a7c9af5 git: Print details of ignored error when mirroring
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
2017-12-06 09:23:17 +00:00
Philip Withnall 287be6a7d1 utils: Eliminate some dead code
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
2017-12-06 09:23:17 +00:00
Alexander Larsson 0254b5174e Update NEWS and version to 0.10.5 2017-11-24 14:58:15 +01:00
Alexander Larsson d385187a49 Update flatpak req to 0.10.1
We need this for flatpak build --readonly
2017-11-24 14:52:14 +01:00
Philip Withnall 1b16d7cd95 build: Add missing mkdir to glib-tap.mk
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
2017-11-24 12:39:51 +00:00
Philip Withnall 6607fd1971 build: Add --enable-p2p configure argument
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
2017-11-24 12:39:51 +00:00
Alexander Larsson 9c4007fc0d Add --state-dir option
This allows using a shared state dir for downloads and build caches.

Closes: #67
Approved by: alexlarsson
2017-11-21 13:55:00 +00:00
Alexander Larsson 0797c72db7 Add support for running tests
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
2017-11-16 08:09:21 +00:00
Alexander Larsson 73e64a4434 Change debug output from XAB to FB
This is no longer xdg-app-builder, but flatpak-builder.
2017-11-16 09:03:35 +01:00
Alexander Larsson cd6a5f4bfb Add append-pkg-config option
Closes: #64
Approved by: alexlarsson
2017-11-14 12:02:58 +00:00
Alexander Larsson cf9d35de32 Add --log-*-bus to flatpak-builder --run
This requires https://github.com/flatpak/flatpak/pull/1160

Closes: #63
Approved by: alexlarsson
2017-11-14 12:02:46 +00:00
Alexander Larsson 0a2c7a0dea Fix warning about /* inside comment
Closes: #63
Approved by: alexlarsson
2017-11-14 12:02:46 +00:00
Alexander Larsson 426e664b7a appdata: When looking for appdata, find canonical name first
bijben had both a metainfo and an appdata, which caused EEXIST when
renaming the file.
2017-11-07 15:39:32 +01:00
Alexander Larsson a177961181 git: pass -f to git fetch
This means we handle non-fastforwarded branches
2017-11-07 10:21:02 +01:00
Alexander Larsson dbc60333da Update NEWS for release 2017-11-06 15:18:02 +01:00
Alexander Larsson ad2ae90d12 Bump version to 0.10.4 2017-11-06 15:16:40 +01:00
Alexander Larsson e7287852ad git: Support HEAD as ref when mirroring a repo
This is useful to reference whatever is currently checked out in a local
repo.
2017-11-06 14:27:25 +01:00
Alexander Larsson 01bdfd7d82 CI: We now need appstream-glib headers
Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00
Alexander Larsson 784328e397 git: Always deep clone for old git versions if bundling sources
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
2017-11-06 12:42:36 +00:00
Alexander Larsson 25805d5220 git: Add git mirror flags to simplify API
This is nicer than a bunch of booleans

Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00
Alexander Larsson 020461583a git: Add helper for checking for shallow clone
Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00
Alexander Larsson 55f07e209a git: Disable shallow clones of submodules pre git 1.9.0
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
2017-11-06 12:42:36 +00:00
Alexander Larsson 3d603320f2 git: Add helper for checking git version for feature
Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00