Commit Graph

38 Commits

Author SHA1 Message Date
Alexander Larsson
fae922584c builder: Add commit property to git source
If branch is unset this is just a nicer way to set a
particular commit. However if both are set, then we verify
that the branch/tag is at that particular commit. This is
a nice way to document that we want to use a particular tag
but still protect against the tag changing or a MITM attack
modifying what that tag means.
2017-04-04 15:21:11 +02:00
Alexander Larsson
352eb84189 builder: Add builder_cache_checksum_compat_boolean 2017-02-28 11:29:39 +01:00
Alexander Larsson
aaf923bd37 builder: Use separate rofiles-fuse mounts for each module
We're doing a post-commit checkout directly to the app dir, which
means the fuse filesystem cache may get out of sync with the backing
directory. So, to ensure this doesn't happen we mount a fresh rofiles
fs for each build.
2017-02-24 14:16:12 +01:00
Alexander Larsson
67dc4a153f builder: Add builder_cache_checksum_compat_strv
This lets us add strv:s without invalidating old caches
if the empty strv means same as before
2017-02-22 09:42:13 +01:00
Alexander Larsson
359d4fa96b builder: Add builder_cache_get_files() to get all files in cache 2017-02-22 09:41:40 +01:00
Alexander Larsson
ec1589e9ca builder: Fix up get_outstanding changes for first cache stage 2017-02-16 10:27:23 +01:00
Alexander Larsson
1e2e718fd4 builder: Reuse devino cache for builder_cache_get_outstanding_changes
This makes finding debuginfo files to strip much faster.
2017-02-15 17:36:26 +01:00
Alexander Larsson
18b8c67207 builder: Use rofiles-fuse for the cache
Instead of building directly into the app directory we build into a
rofiles-fuse mount of it, which allows us to safely check out the
cache into the app directory using hardlinks (because rofiles-fuse
will not let you modify hardlinked files).

Additionally, every time we commit to the cache we check out all
the new and modified files into the appdir so that we get hardlinks
to the repo for the new files too.

The advantage of having hardlinks to the repo is that we can commit
much more efficient since we don't have to do a full checksum of
the hardlinked files.

There are some issues here:
 eu-strip fails due to doing in-place editin
 rofiles-fuse is using lots of CPU, unclear if this is faster, needs
 measurements
 needs testing of how well the fallback works (ie. if fuse is not
 working).

rofuse: use kernel caches

rofiles: check out after commit

Use devino cache

Only check out new files from cache after commit
2017-02-15 16:09:48 +01:00
Alexander Larsson
b585e4008e builder: Store the context in the BuilderCache
This allows the cache to respect global options
2017-02-07 16:39:23 +01:00
Alexander Larsson
6689c5c7f1 Switch back to mtime==0 for ostree checkouts
OSTree upstream changed back from mtime 1
2016-09-09 09:22:56 +02:00
Alexander Larsson
6578d37984 Drop libgsystem dependency 2016-08-22 16:00:33 +02:00
Alexander Larsson
65f1cf993d Create and use flatpak_file_get_path_cached
This is simpler that the one in libgs, as well as lockless. Also, it
removes one more use of libgs.
2016-08-22 10:22:42 +02:00
Alexander Larsson
e0bd22bfe8 Add flatpak_mkdir_p helper and use it
This replaces all current callers of gs_file_ensure_directory with
equivalent code.

Actually, two instances were calling gs_file_ensure_directory with
FALSE, i.e. error out on EEXIST, but those cases seem fine with the
do-nothing-if-exists semantics.
2016-08-22 09:29:24 +02:00
Matthew Leeds
b051571de8 builder: Fix a few memory leaks
These changes fix some memory leaks that valgrind pointed out.
2016-07-28 16:03:42 -04:00
Alexander Larsson
b5204c908d builder: Clear mtime to 1, not 0, to match what new ostree does 2016-07-01 14:25:22 +02:00
Alexander Larsson
bd485fbc01 builder: Report error details when failing to checkout cache. 2016-06-09 17:45:44 +02:00
Alexander Larsson
959fec1cd3 Zero out mtime when commiting
This means we get the same behaviour as if we checked out of
the cache. Also, its the same as the final behaviour will be
when running in flatpak.
2016-06-08 13:14:09 +02:00
Alexander Larsson
4990dd5f86 builder: Manually zero mtime of cache checkout
This works around an ostree bug where this didn't happen in the
mismatched mode (regular checkout, user repo) we're using.
2016-06-08 11:11:24 +02:00
Simon McVittie
a4641280a7 Fix various spelling mistakes
Mostly detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 11:43:32 +01:00
Alexander Larsson
c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson
1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson
e8adcc0eb5 builder: Add spew when commiting to cache 2016-01-22 14:08:43 +01:00
Alexander Larsson
1a4f257cbd builder: Remove leftover debug spew 2016-01-19 13:08:15 +01:00
Alexander Larsson
071561637a Remove unused variables 2016-01-19 12:37:51 +01:00
Alexander Larsson
8b3cc77955 builder: Handle modules with invalid refname characters in the cache 2016-01-19 11:57:37 +01:00
Alexander Larsson
496cbac3db cache: Don't fail to create cache if parent dir is not created 2016-01-18 17:17:04 +01:00
Alexander Larsson
e91a4c79e0 Builder: Support commiting a platform 2016-01-18 15:22:56 +01:00
Alexander Larsson
701d800059 builder: Correctly handling non-existing app dir when applying cache 2016-01-18 11:36:24 +01:00
Alexander Larsson
f2853a460b cache: Remove target directory before checking out cache
This will be empty anyway, and if its there the checkout fails.
2016-01-17 21:23:03 +01:00
Alexander Larsson
f3bf30334c builder: Also apply cleanup to changes in usr 2016-01-14 11:16:17 +01:00
Alexander Larsson
f8894af8d7 builder: Change the way the cache is indexed
Instead of a single ref we use one ref per stage (init, build module X,
cleanup, finish). This means we don't have to iterate in the cache
lookup, and it also means we get clean refs for each stage so one
can easily inspect the differences between the stages.
2016-01-13 09:50:15 +01:00
Alexander Larsson
13d07d6a6f builder: Add support for exporting with --repo=foo 2016-01-11 15:35:17 +01:00
Alexander Larsson
98a7d731ad builder: Add support for separating out debuginfo 2016-01-11 11:40:46 +01:00
Alexander Larsson
ef3582325d builder: Store the cache in BARE_USER mode
This has two advantages:
1) If building as non-root, then we can't modify xattrs, such as
   selinux ones, yet selinux will write then, making a bare repo
   not match the checksums (it has unexpected xattrs that selinux made)
2) We check out as MODE_NONE, not MODE_USER, which in combination with
   BARE_USER forces the files to be copied out of the cache, rather
   than using hardlinks into the cache which could mutate the cache.
2015-12-16 11:56:56 +01:00
Alexander Larsson
46558798a2 builder: Don't fsync on cache checkouts 2015-12-16 11:18:05 +01:00
Alexander Larsson
43a09b3646 Fix unused variable warnings 2015-12-15 14:34:52 +01:00
Alexander Larsson
f710eb9322 Correct license, we're LGPL 2+, not 3+
Some files accidentally got the LGPL 3+ header, but we
want to be LGPL2+.
2015-11-26 14:50:21 +01:00
Alexander Larsson
b2790349d6 Add xdg-app-builder
This is a tool that makes it easy to build applications and their
dependecies by automating the configure && make && make install steps.
2015-11-25 15:26:32 +01:00