Commit Graph

304 Commits

Author SHA1 Message Date
Matthew Leeds
d272a4d4cc builder: Don't pass --require-version along to build
The --require-version option works for build-finish but not build, so
don't pass it along when using a manifest to build.
2017-03-28 08:51:36 +02:00
Matthew Leeds
543c0735f1 builder: Add a hint about --force-clean 2017-03-27 12:52:46 +02:00
Colin Walters
64fd2c2a8d Bump libglnx, use new glnx_throw(), fix callers
One benefit here becomes immediately obvious - `flatpak_fail()` was lacking
`G_GNUC_PRINTF` which meant we missed a lot of type checking. Fix up the
callers.
2017-03-27 10:42:36 +02:00
Alexander Larsson
b00b8b1601 builder: Add --default-branch=BRANCH 2017-03-21 13:16:29 +01:00
Alexander Larsson
c7086364be builder: Handle absolute paths in command
Don't fail with "not found" in this case because we're checking
the absolute path on the host, not in the final sandbox.
2017-03-20 17:55:14 +01:00
Alexander Larsson
9a62c456e3 builder: Remove all SDK extension from the platform
Instead of hardoding the locale and debug one.
This allows us to have SDK-specific extensions that
are not in the platform
2017-03-16 21:20:29 +01:00
André Klitzing
567802749c Fix some issues with musl
* Use realpath instead of canonicalize_file_name
* Add missing include
2017-03-15 10:14:39 +01:00
Alexander Larsson
72e36b90a0 builder: Keep cache per arch
This just adds the arch name to the cache branch names, which
means a build on a different arch will not invalidate the other
arch:s build.

Fixes https://github.com/flatpak/flatpak/issues/628
2017-03-15 09:43:50 +01:00
Alexander Larsson
18f27f701b flatpak-builder --run: Always enable the dbus proxy
This means we're able to own our own id as a name, etc.
2017-03-14 16:27:51 +01:00
Alexander Larsson
b6d06ba8ef Bump manifest cache version to rebuild everything
This is due to the append changes, etc
Also, we drop all _compat_ cache checksums
2017-03-14 12:02:35 +01:00
Alexander Larsson
81c444892a builder: Make cflags, cxxflags and ldflags append, not replace
This is much more natural, and means you don't have to duplicate the
flags in each place.
2017-03-14 10:53:38 +01:00
Alexander Larsson
4e2b103167 builder: Fix ordering of arch-specific build options
The arch-specific options override the generic ones,
not the other way around.
2017-03-14 10:37:12 +01:00
Alexander Larsson
0f0188aacb builder: Add support for ldflags 2017-03-14 10:26:22 +01:00
Alexander Larsson
900d146810 builder: Don't strip already stripped binaries 2017-03-09 17:03:59 +01:00
Alexander Larsson
ea6747fcb4 builder: Fix --from-git
We need to specify the full branch when checking out
2017-03-07 14:20:44 +01:00
Alexander Larsson
60cadead5c builder: Properly handle relative module include paths from git
We load the sub-modules from the base directory (i.e. where
the manifest is stored).
2017-03-06 09:20:34 +01:00
Alexander Larsson
44399bcf5f builder: Add only-arches and skip-arches for sources 2017-02-28 17:41:45 +01:00
Alexander Larsson
0379c01981 builder: Add build-arches and skip-arches to modules
This lets you avoid modules on some arches.
2017-02-28 12:07:53 +01:00
Alexander Larsson
c3322fd9e9 builder: Add no-make-install to modules
This is useful for modules that don't have a make install rule.
You can use the new build-commands which is run after make to
create your own custom installation phase.

Fixes https://github.com/flatpak/flatpak/issues/458
2017-02-28 11:30:59 +01:00
Alexander Larsson
352eb84189 builder: Add builder_cache_checksum_compat_boolean 2017-02-28 11:29:39 +01:00
Alexander Larsson
0b448c5f68 builder: Handle chdir failures when spawning shell 2017-02-28 11:11:28 +01:00
Alexander Larsson
e9429d6759 builder: Silence unused return value warning 2017-02-28 11:05:01 +01:00
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