Flatpak as part of the development process

Aleix Pol aleixpol at kde.org
Tue Apr 4 23:06:10 UTC 2017


On Tue, Apr 4, 2017 at 11:29 AM, Alexander Larsson <alexl at redhat.com> wrote:
> On Fri, 2017-03-31 at 19:26 +0200, Aleix Pol wrote:
>>
>> That said, this could have problems, such as these relative paths
>> going outside of the project (e.g. "../myawesomelibrary"). This
>> should
>> be an error.
>>
>> Does that make sense to you? Am I missing something?
>
> flatpak-builder is a tool for building releases, in a controlled
> reliable fashion. For instance, it always builds from scratch, and it
> always takes a commit or tarball as input (never just some source
> directory). As such, it is in a poor position to handle the regular
> edit-compile-test cycle in say an IDE. For something like that the
> lower level "flatpak build" operation makes a lot more sense.
>
> For instance, you can just do this from the directory where you have
> your checkout, with an initialized (by build-init) app-dir, possibly
> with some dependencies installed:
>
> $ flatpak build app-dir make
> #  edit file to fix build issue
> $ flatpak build app-dir make
> $ flatpak build app-dir ./test-app
> $ flatpak build app-dir gdb ./test-app
>
> flatpak-builder might be useful to initialize and pre-build the
> dependencies for the application though, which is how gnome-builder
> uses it (see christians mail).
>
> That said, there are some issues from your mail that we should probably
> look into.
>
> It would be nice to be able to ship a json file with a tarball, and
> then allow that tarball to be referenced from the json itself. This way
> you can create a rebuildable release, which is hard without this as the
> json would have to contain the checksum of the tarball which would
> contain the json...
>
> A similar feature could reference the git repo the json is in (as in,
> the ".git" directory, not the checked out tree). However, as I said
> before, I don't think this is going to be useful for day-to-day builds
> during development.
>
> I don't think we want to do this by referencing a local directory like
> "path": "." though. Instead i think we want a separate source type like
> "type": "container", which only works if you start the build by
> specifying a build using --from-git or (to be added) --from-archive.

Agreed, the IDE shouldn't be calling flatpak-builder other than for
setting up the build directories.

I do think that having the "container" case being usable from the IDE
would be interesting though, because we want to use the same
configuration we have in the json file already to set up the build for
the first time, I guess this would be a bit awkward on systems where
having a separate build directory is not common. This can possibly be
done by the IDE though, by configuring the project itself, mimicking
the logic.

Just to make sure I understood everything correctly, you mean that
currently when you build --from-git, there's 2 clones involved: one
for fetching the json file and a second to actually fetch the sources.

Aleix



More information about the xdg-app mailing list