Commit Graph

3119 Commits (1b16d7cd950305d5220bc0d0d050543cb5f529b5)
 

Author SHA1 Message Date
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
Alexander Larsson baf8d4630b git: Explicitly pull all refs when doing full pull
Older versions of git default to only tags when you do --tags instead
of tags + all. So, we force everything with --tags *:*.

Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00
Alexander Larsson 3afbb5a6d2 Fix bundling of git sources specifying a tag object
When pulling the commit we need to also pull the tags so we have them
locally, and then we need to peel the ref when we commit it so that we
don't try to create a ref pointing to a non-commit (tag) object.

Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00
Alexander Larsson c5cd6f50f6 Fix crashes on git errors
We returned FALSE but error was unset, leading to a crash printing
the error message.

Closes: #62
Approved by: alexlarsson
2017-11-06 12:42:36 +00:00
Alexander Larsson 202dcf7e9d Release 0.10.3 2017-10-31 13:45:42 +01:00
Alexander Larsson cb11d421f6 --from-git: Allocate builddir before mirroring 2017-10-31 12:50:51 +01:00
Alexander Larsson 0fed4a6433 --from-git: Drop origin/ now that we're not mirroring on checkout 2017-10-31 11:24:20 +01:00
Alexander Larsson 4c0b9ae0e3 git: Use cp -al instead of git clone when checking out git mirror
This fixes older versions of git not supporting clones from shallow
repos.
2017-10-31 11:22:44 +01:00
Alexander Larsson 7d532f5125 git: Disable fsck when doing shallow clones on git < 1.8.3.2
The git 1.8.3.2 release notes say:

 * Cloning with "git clone --depth N" while fetch.fsckobjects (or
   transfer.fsckobjects) is set to true did not tell the cut-off
   points of the shallow history to the process that validates the
   objects and the history received, causing the validation to fail.

So, on versions prior to this, we always disable fsck when you're
pulling shallowly. If you need fsck validation, use a newer git.
2017-10-31 10:22:52 +01:00
Alexander Larsson bf7aeacded git: Don't clone refs that is not under refs/
HEAD gives all sorts of problems
2017-10-31 09:05:59 +01:00
Alexander Larsson 0a03de929d Release 0.10.2 2017-10-30 15:12:36 +01:00
Matthias Clasen 7fc1a5a821
Merge pull request #56 from larchunix/typo-fix
Fix a typo in the docs
2017-10-30 08:57:48 -04:00
larchunix 1af81b799e
Fix a typo in the docs 2017-10-30 12:23:30 +01:00
Alexander Larsson a39f727adf git: Never do shallow pulls if we once had a deep one
This seems to break on old versions of git. For example:

$ git --version
git version 1.8.3.1
$ git clone --mirror https://github.com/divVerent/s2tc.git
Cloning into bare repository 's2tc.git'...
remote: Counting objects: 740, done.
remote: Total 740 (delta 0), reused 0 (delta 0), pack-reused 740
Receiving objects: 100% (740/740), 1.47 MiB | 0 bytes/s, done.
Resolving deltas: 100% (493/493), done.
$ cd s2tc.git/
$ git fetch -p --no-recurse-submodules --no-tags --depth=1 -f origin '+HEAD:HEAD'
fatal: git fetch-pack: expected shallow list

Closes: #55
Approved by: alexlarsson
2017-10-30 10:57:35 +00:00
Alexander Larsson 17f659ee71 git: --unshallow if we do a full pull where we were previously shallow
Closes: #55
Approved by: alexlarsson
2017-10-30 10:57:35 +00:00
Alexander Larsson ac6a25c981 Add option to disable shallow clone for git sources
Closes: #55
Approved by: alexlarsson
2017-10-30 10:57:35 +00:00
Alexander Larsson fb2612ea02 Release 0.10.1 2017-10-27 12:43:46 +02:00
Alexander Larsson 7e124f0e91 Work around issues with older versions of git
It turns out older versions of git cannot properly check out a commit
if the ref that points to it was not a normal one (branch or tag).
So, we work around this case by detecting it add adding a fake
tag. Also, we change the fake ref we use for commit-only references
to be a regular branch and not a special one for the same reason.

This fixes https://github.com/flatpak/flatpak/issues/1133

Closes: #52
Approved by: alexlarsson
2017-10-27 10:41:20 +00:00
Alexander Larsson f5693ab5de run: Don't pass --die-with-parent when we --run
In this case we will exec rather than fork + exec, so we don't
want to use prctl, as that can cause the app to die if any
*thread* in the parent dies (rather then the whole process).

In particular, this caused issues for gnome-builder starting
a newly built flatpak:ed app.

Closes: #51
Approved by: alexlarsson
2017-10-27 06:43:23 +00:00
Alexander Larsson 122ab653e8 Make tests work on debian
The regular ldconfig is some bash wrapper over /sbin/ldconfig.real
2017-10-26 13:57:18 +02:00
Alexander Larsson 188b835627 Update version to 0.10.0 2017-10-26 11:46:47 +02:00
Alexander Larsson f222a18dec Require flatpak 0.10.0 and corresponding ostree version 2017-10-26 11:46:32 +02:00
Alexander Larsson 726dbc4bd9 Update NEWS 2017-10-26 11:45:59 +02:00
Alexander Larsson 15f3582e40 Fix checkout of shallow repo.
Some manifest (cx.ring.RingGnome) had a git commit id that
was only tip of a non-branch ref (refs/changes/51/8051/8), which
was not cloned by a regular clone, so we need to switch to
a clone --mirror.

Closes: #50
Approved by: alexlarsson
2017-10-19 20:39:08 +00:00
Alexander Larsson 9453867333 Store the deletes in the cache metadata too
Closes: #49
Approved by: alexlarsson
2017-10-19 15:18:19 +00:00
Alexander Larsson 32f6722c1d Change the way the cache works
Previously we chained all the state via the internal sha256
checksum, extracting periodic checksums. We now reset
the checksum for each state and instead feed it the previous
stage checksum to chain things.

This means we have different cache checksum values, but the same
chaining behaviour. The advantage being that the checksum is
re-startable from any point, if we know the parent checksum.

Closes: #49
Approved by: alexlarsson
2017-10-19 15:18:19 +00:00
Alexander Larsson be8597f346 git: Try to do shallow mirrors when downloading
When downloading a git repo we try to do a shallow (depth=1) fetch of
only the specified target. This normally works fine for branches and
tags, but if the commit is a raw SHA1 then it fails, because we can
only request refs from the remote.

We handle this by doing an ls-remote and seeing if the specified
target is either a (possilby partial) ref, or a commit id that a
remote ref is pointing at. If it is, we pull that ref only. If not,
then we fall back to a full fetch.

I believe this is the best we can do to fix
 https://github.com/flatpak/flatpak-builder/issues/6

Closes: #47
Approved by: alexlarsson
2017-10-17 10:31:28 +00:00
Alexander Larsson 42da157c47 git: Create fake refs that are not branches when doing shallow mirrors
When doing a shallow clone when bundling git sources we sometimes need
to create a ref in the source repo. This changes the ref used from
refs/heads/flatpak-builder/ref-$REF to refs/flatpak/ref-$REF.
In other words, it uses a custom ref rather than a branch, which has
less chance of conflicting with some existing branch.

Closes: #47
Approved by: alexlarsson
2017-10-17 10:31:28 +00:00
Alexander Larsson 04cf19083e git: Add GSubprocessFlags to git()
Closes: #47
Approved by: alexlarsson
2017-10-17 10:31:28 +00:00
Alexander Larsson 039a24aeb4 utils: Add flags argument to flatpak_spawn
This allows you to e.g. silence STDERR

Closes: #47
Approved by: alexlarsson
2017-10-17 10:31:28 +00:00
Alexander Larsson a912f119d6 Bump version to 0.9.99 2017-10-09 13:51:02 +02:00
Alexander Larsson 271f0af212 Update NEWS 2017-10-09 13:50:42 +02:00