Commit Graph

169 Commits

Author SHA1 Message Date
Alexander Larsson
bd485fbc01 builder: Report error details when failing to checkout cache. 2016-06-09 17:45:44 +02:00
Alexander Larsson
5eb671aac4 builder: Warn for duplicate module names 2016-06-09 12:43:31 +02:00
Matthias Clasen
99e4f83e33 Allow inclusions in the module list
When we see a string in the modules array, parse it as a json
file and use the resulting BuilderModule object.
2016-06-09 01:01:37 -04:00
Matthias Clasen
5225e7b1d0 manifest: Prepare expand_modules to report errors
Move the expand_modules call from the modules setter to
builder_manifest_start, where we have a chance to report
errors.
2016-06-09 00:29:02 -04:00
Matthias Clasen
e25e379a2a manifest: expand module list
Linearize the tree of modules and submodules when the modules
are set on the manifest, while filtering out disabled modules
at the same time.

Skip source-less modules when building; this makes it possible
to have modules that only contain submodules.

With this approach, we use the tree structure of modules for
serializing and deserializing to and from json, while using
a linear list of modules for building.
2016-06-08 23:56:38 -04:00
Matthias Clasen
2757c63fea Add a modules property to BuilderModule
This will let us load modules recursively.
2016-06-08 23:56:38 -04:00
Matthias Clasen
9a8eef8597 manifest: Skip source-less modules when building
Building such modules won't produce anything. And future
commits will make source-less modules useful to support.
2016-06-08 23:56:38 -04:00
Matthias Clasen
914b841481 module: Be a bit more robust
When we call builder_module_cleanup_collect on a module that
has no changes, we shouldn't crash.
2016-06-08 23:55:57 -04:00
Alexander Larsson
bd66da0dad builder: Add support for patching mtime in python bytecode headers
This makes them work at runtime (as the mtime will then be 0) and
makes builds more repeatable.
2016-06-08 13:28:27 +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
Matthias Clasen
6d1837ce4b Make an error message more helpful
When we see somebody trying to use a command with spaces, we
should be helpful and point out how to do what they want to do.
2016-06-03 09:22:21 -04:00
Alexander Larsson
d950ed338f Merge pull request #65 from matthiasclasen/builder-messages
Add another status message to flatpak-builder
2016-06-02 09:12:08 +02:00
Alexander Larsson
4805d49bdf Merge pull request #37 from matthiasclasen/command-check
flatpak-builder: Ensure after build that the binary listed in "command" is installed
2016-06-02 08:58:30 +02:00
matthiasclasen
5e2be3cb10 builder: Some consistency fixes for output (#64)
* builder: Some consistency fixes for output

Capitalize all error messages.
2016-06-02 08:50:58 +02:00
Matthias Clasen
7794a70f50 builder: Check that command exists after build
This keeps us from creating a non-working flatpak.
2016-06-01 23:31:57 -04:00
Matthias Clasen
c7594e5515 Add another status message to flatpak-builder
Add a message for the 'rewriting the desktop file' step.
This helps in providing context for error messages when something
goes wrong.
2016-06-01 16:21:25 -04:00
Alexander Larsson
c7c9505e90 Always initialize autofree variable 2016-05-27 09:19:45 +02:00
Alexander Larsson
8362d9cafe Merge pull request #36 from matthiasclasen/module-errors
flatpak-builder: Print name of failed module on error
2016-05-27 09:02:44 +02:00
Alexander Larsson
f9cbcc3996 Merge pull request #49 from jsoref/spelling
spelling fixes
2016-05-27 09:02:14 +02:00
Josh Soref
37409c4095 spelling: sections 2016-05-27 06:46:23 +00:00
Alexander Larsson
6b65972434 Merge pull request #47 from matthiasclasen/build-error
builder: Avoid a confusing error
2016-05-27 08:45:21 +02:00
Matthias Clasen
5f928b30ac builder: Prefix module errors
Sprinkle g_prefix_error calls in builder-module.c, to make
sure that module-specific errors get a "module foo:" prefix.
This is not quite perfect, since callers tend to impose their
own prefix as well, but at least it clearly identifies the
module in which the error ocurred.
2016-05-27 00:25:28 -04:00
Matthias Clasen
6d1d9724c5 builder: Warn about bad module names
Putting spaces or slashes in module names is a recipe for
cryptic error from one of the many constructed flatpak
commandlines. Better warn early on, as soon as we see such
a name.
2016-05-27 00:05:55 -04:00
Matthias Clasen
c89a610a91 builder: Avoid a confusing error
When the sdk is not specified in the manifest, we get a confusing
error from running flatpak info with an invalid commandline.
Avoid that by checking for the the sdk string beforehand.
2016-05-26 23:35:41 -04:00
Alexander Larsson
e9e92b79fe builder: Support argument to the command with --run
For instance, this lets you do:

  flatpak-builder app foo.json ls -l

Without flatpak-builder complaining about not knowing "-l".
2016-05-26 12:44:51 +02:00
Alexander Larsson
33c0d49212 builder: Support permission ops with --run 2016-05-26 12:24:43 +02:00
Alexander Larsson
f6b4e8ead6 builder: Make the options and help output for --run a bit nicer
We now pre-process for the --run argument in order to only show
related arguments.
2016-05-26 11:20:23 +02:00
Stephan Bergmann
3b6b0da108 exec* returns -1 on error
...so use the == -1 idiom as already used in common/flatpak-run.c
(another fix would be to drop the if completely, as exec* doesn't
return on success)
2016-05-24 17:44:33 +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
9d6bc99649 builder: Untar with --no-same-owner
Without this if you run as root (which is generally a poor idea) it will
extract the sources with the user/group specified on the archive, which
is never what you want when building code.
2016-05-12 19:35:32 +02:00
Alexander Larsson
28c1c65d8f Builder: Support disabled=true to not build a module
This is a simple way to "comment out" a module.
2016-05-09 17:24:42 +02:00
Alexander Larsson
8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson
ba37b22d78 Rename library to libflatpak 2016-05-09 09:46:26 +02:00
Alexander Larsson
c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson
6a613d1fab Rename all non-autogenerated symbols 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
098e3e426d build: Look for files in the same dir as the manifest, not in the CWD
This makes more sense, the CWD is not necessary a useful place.
2016-05-04 08:47:38 +02:00
Tristan Van Berkom
51e387159b build-export: Add --arch option
This patch adds the --arch option to the build-export builtin command.

Previously build-export derives this from the metadata and then falls back
to xdg_app_get_arch(), except that this does not work when the metadata does
not specify an arch (such as with extensions like .Debug or .Locale).

https://bugs.freedesktop.org/show_bug.cgi?id=95226
2016-05-03 09:05:56 +02:00
Tristan Van Berkom
aa69c1afef xdg-app-builder: Add --arch command line option
This is only useful for building for architectures which are
compatible with the build host, e.g. building i686 binaries on
an x86_64 build host.
2016-05-02 08:46:52 +02:00
Tristan Van Berkom
bc7bfeef6f BuilderSourceFile: Delete destination file
Sometimes you want to replace an existing file, like a config.sub,
and sometimes that existing config.sub does not have the writable
bits set. Just delete the file if we intend to replace it anyway.
2016-04-27 14:15:05 +02:00
Alexander Larsson
9171c94662 builder: Fix unused return value warnings
This just adds a (void) cast to avoid the warnings.
2016-04-21 09:49:24 +02:00
Alexander Larsson
af03d2f5b4 Remove unused local variables reported by clang 2016-04-21 09:48:56 +02:00
Joaquim Rocha
f112d117da builder: Do not repeat the separate locales path
These changes replace all occurrences of 'share/runtime/locale' with a
define so it will avoid possible mistakes when having to be replaced
one day.
2016-04-20 12:32:02 +02:00
Joaquim Rocha
39279c8b8b builder: Skip separate locales exportation if directory doesn't exist
This will avoid errors when separate_locales is set to true but the
locales directory does not exist. This is the case of many apps that do
not support separate locales but haven't specifically set
separate_locales to false in the configuration.
2016-04-20 12:32:02 +02:00
Alexander Larsson
265ba5e528 Merge pull request #128 from matthiasclasen/run-fixes
Some fixes for xdg-app-builder --run
2016-04-15 11:50:34 +02:00
Tristan Van Berkom
401c7b2dea BuilderModule: Use builder_options_get_config_opts()
The configure arguments are now a combination of the
default config-opts plus the accumulative sum of the config-opts
specified in the build-options that are active for a given build
context.

https://bugs.freedesktop.org/show_bug.cgi?id=94940
2016-04-15 10:25:55 +02:00
Tristan Van Berkom
17ec9ef3b0 BuilderOptions: Added 'config-opts' option.
Allows conditional configure arguments.

https://bugs.freedesktop.org/show_bug.cgi?id=94940
2016-04-15 10:25:55 +02:00
Matthias Clasen
9426438c0b Fix --run
I have a manifest which has --command=terminix in the finish-args,
and xdg-app build doesn't like that option, so filter it out.
2016-04-14 19:11:48 -04:00
Alexander Larsson
416ad53878 Fix typo for no-debuginfo properly 2016-04-14 19:28:08 +02:00