Commit Graph

282 Commits (2e639b81e2377f6d7cbb139e225556974740f916)

Author SHA1 Message Date
Alexander Larsson 83600f7c1b builder: Always clone git repos with transport.fsckObjects
This way we detect any corrupt (or malicious) objects
2017-02-27 16:17:57 +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 f8388e7fdf Don't print stderr/stdout from emergency fuse unmount 2017-02-24 14:16:12 +01:00
Alexander Larsson c0da3e49b9 builder: Use splice in rofiles-fuse mount 2017-02-24 14:16:12 +01:00
Alexander Larsson 8983834f92 builder: Fix up .py[co] invalidation
Since we now only look at changed files we need to handle
the case where a .py file changed and the .pyc didn't, and
remove the now stale .pyc files.

Previously we looked at all files, so we detected this via
the stale .pyc file.
2017-02-24 14:16:12 +01:00
Alexander Larsson 364499939d builder: Add --skip-if-unchanged
This lets you skip rebuilds unless the actual json changes.
This is useful for continuos builds that only run if the json
changes, not on any commit to any git source.
2017-02-22 15:12:59 +01:00
Alexander Larsson 90674fafa0 builder: Don't mirror submodules if told not to 2017-02-22 15:12:59 +01:00
Alexander Larsson 61db31bb00 builder: Add ensure-writable to module 2017-02-22 09:48:00 +01:00
Alexander Larsson 2c71298d53 builder: Its break_hardlink, not unbreak_hardlink 2017-02-22 09:43:57 +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 082efe8951 Properly quote all commandlines we print
Fixes https://github.com/flatpak/flatpak/issues/236
2017-02-21 18:56:11 +01:00
Alexander Larsson 608374e57a builder: Checksum cleanup-platform for platform 2017-02-21 15:09:50 +01:00
Alexander Larsson 1ca3c86552 builder: Add support for --from-git=URL
This allows you to build a json manifest that is stored in a git repo.

Closes: https://github.com/flatpak/flatpak/issues/511
2017-02-21 11:58:40 +01:00
Alexander Larsson b136e7fdc6 builder: extract git mirroring code to builder-git.c
This way we can resuse it outside the git source
2017-02-21 11:58:35 +01:00
Alexander Larsson e71e4221a9 builder: Separate run-dir and base-dir
We always put the state in the .flatpak-builder subdirectory of where
you ran flatpak-builder, independent on the location of the json
manifest. This makes sense in general, but is also extra important
when we want to check out the json from git inside the .flatpak-buidler
directory.
2017-02-21 11:50:58 +01:00
Alexander Larsson 1cdd9e796d builder: Break out build-dir allocation code 2017-02-21 11:50:41 +01:00
Mathieu Bridon b996a636ff builder: Add a "simple" buildsystem
This just runs the specified "build-commands" one after the other,
ignoring makefiles, configure scripts, and all the rest.

Relates to #134
2017-02-20 16:08:35 +01:00
Alexander Larsson c4da82341b builder: Add --build-shell=MODULE support
This lets you prepare a build directory for a given module
and start a build shell inside it. Very useful for debugging.
2017-02-20 15:02:09 +01:00
Alexander Larsson 75a16555e7 builder: Fix spelling 2017-02-17 14:10:12 +01:00
Alexander Larsson be9e8c6eeb builder: Fix unused variable warning 2017-02-16 15:59:01 +01:00
Alexander Larsson bcbd92f774 builder: Bump checksum version to invalidate all caches
Since we changed how the post process handles python
files in the init stage we need to rebuild everything.
2017-02-16 15:52:25 +01:00
Alexander Larsson a5e1b2200a builder: Move python timestamp checkin to post-process
This changes what files we look at to only those in this module,
which is generally right, but to handle the base-layer sdk
case we also have to run the python fixup in the initial layer.
2017-02-16 10:51:00 +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 05676536a8 builder: Split out debuginfo handling to a post-process step
We want to call this on the initial stage too, so move
it out of BuilderModule.
2017-02-16 09:40:08 +01:00
Alexander Larsson 690908eade builder: Spawn rofiles-fuse with maximum nr of open fds allowed 2017-02-15 20:18:13 +01:00
Alexander Larsson 5a3c7feb15 builder: Unbreak hardlinks when eu-stripping
Otherwise this breaks with rofiles-fuse if the build produces
hardlinked installed files. For instance, as done by mesa.
2017-02-15 19:22:14 +01:00
Alexander Larsson ee83364a8e builder: Work around g_file_replace truncating hardlinked dests
If the target is the rofiles-fuse and a file is hardlinked, then
copy will fall back to truncation, which will fail with READONLY.
We work around this sometimes by deleting the destination first
and sometimes by using g_file_set_contents instead.
2017-02-15 18:04:00 +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
Mario Sanchez Prada df680dc0a6 Fix clang build: remove unused variables 2017-02-14 09:00:57 +01:00
Alexander Larsson f2fb0eaf55 By default, don't rebuild apps if the SDK changes
Rebuilding all apps because a minor change in the runtime is way too wasteful
and generated unnecessary app updates, especially since runtimes are supposed
to be API stable.

We add an a --rebuild-on-sdk-change option which you use to disable this feature,
for instance if you're building against an unstable SDK.
2017-02-10 16:37:33 +01:00
Alexander Larsson 08ea3baf49 builder: Download files and archives directly to disk, don't keep them in memory.
This works much better for larger sources.
2017-02-09 12:26:05 +01:00
Alexander Larsson bf316c1a82 builder: Compute SHA256 while downloading archives 2017-02-09 12:17:10 +01:00
Alexander Larsson de2f222474 builder: Don't modify .pyc files in-place
If we need to edit the files, make a copy and edit that.
Otherwise we can't handle the file being hardlinked into
the cache.
2017-02-07 16:39:23 +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 4190458d8a Make flatpak-builder run not forward wrong build-finish flags
Some of the build-finish flags we may use make no sense
to pass to flatpak build, so skip them
2017-02-07 16:39:23 +01:00
Alexander Larsson b24228277d Support appdata in share/metainfo also with rename-appdata-file 2017-02-06 11:59:03 +01:00
Jan Grulich 7c7c64c378 Search also in share/metainfo subdir for appstream metadata 2017-02-06 11:54:15 +01:00
Alexander Larsson 69235eeb77 builder: Support cleanup-platform-commands 2017-02-06 10:22:09 +01:00
Alexander Larsson 4feb82e75b builder: Remove the sdk locale/debug extension from the platform
Without this the platform metadata has locale extensions from
both the sdk and the platform
2017-02-02 13:55:30 +01:00
Alexander Larsson e38d980bca builder: Initial version of extension building support 2017-01-27 15:27:55 +01:00
Alexander Larsson 7d4ca72cba builder: User the new --type=runtime to build runtimes 2017-01-27 10:07:23 +01:00
Bartłomiej Piotrowski 751cae4639 builder: add cmake-ninja support
The commit adds another buildsystem, cmake-ninja, that tells
CMake to generate Ninja rules instead of Makefile.

Fixes #461.
2017-01-20 15:28:27 +01:00
Ikey Doherty 605c7ee87b Fix compiler warnings with uninitialised cleanup pointers
This change fixes GCC compiler warnings where a cleanup function was
specified on an uninitialised pointer, which in the view of GCC could
result in an errornous free of uninitialised memory, if the functions
that initialise them do not return NULL.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2017-01-19 10:05:13 +01:00
Patrick Griffis a410e86fff builder: Error when failing to include modules
Currently it can silently fail if an included file is invalid
or missing. This makes that fatal.
2016-12-22 14:39:41 +01:00
Alexander Larsson 8737153ded builder: Fix --verbose logging
We need to pass the right log domain in.
2016-12-19 14:55:22 +01:00
Alexander Larsson 364def2135 builder: Add some spew when applying patches
This makes it easier to figure out what patch is broken
2016-12-12 17:20:36 +01:00
Alexander Larsson e514dc2e14 Add flatpak_create_soup_session 2016-12-08 16:41:20 +01:00
Patrick Griffis 21b65947e8 builder: Add buildsystem option and meson support
Closes #400
2016-11-30 16:59:20 +01:00