Commit Graph

18 Commits (master)

Author SHA1 Message Date
Alexander Larsson 09b2736693 Compress changes when stored in cache commit metadata
The libreoffice cache failed because > 10mb commit object...

Closes: #263
Approved by: alexlarsson
2019-01-25 14:54:54 +00:00
Alexander Larsson 05dd2c68d9 cache: Make sure we escape stage names when we mark them as done
We need to to this, because they are also escaped as refs in the cache.

Fixes https://github.com/flatpak/flatpak-builder/issues/214

Closes: #215
Approved by: alexlarsson
2018-09-26 08:57:36 +00:00
Denis Ollier 7bd6440b75 Don't prune build stages from cache with --{export,finish}-only
A commonly used CI workflow [1] is to chain the following steps:

    > flatpak-builder --stop-at=<module>
    > flatpak build <commands to build module from local checkout>
    > flatpak-builder --finish-only

Unfortunately, the last step always purge all the compilation cache
created by the first one. All build steps are marked unused by default
and since they are skipped due to the option --finish-only, all of them
are always pruned by the gc function.

As a result, flatpak-builder cache becomes useless, a full compilation
is always performed.

Improve this by not cleaning unused stages when no compilation is done
by flatpak-builder (i.e: when flatpak-builder is used with --export-only
or --finish-only option).

[1]: https://gitlab.gnome.org/GNOME/Initiatives/wikis/DevOps-with-Flatpak
2018-06-11 15:47:39 +02:00
Alexander Larsson fa37c55e9c cache: Add builder_cache_checksum_random()
This is helpful when you have a source that should trigger a rebuild every time.

Closes: #136
Approved by: alexlarsson
2018-04-26 07:15:38 +00:00
Alexander Larsson 61ae14a6b8 Switch to bare-user-only cache repo mode
This means we can build without xattrs

This only affects new caches, old ones will work fine with the
bare-user repo though.

Closes: #80
Approved by: alexlarsson
2017-12-14 08:53:58 +00:00
Alexander Larsson 6a8e2af98f Store cache in canonical format
This stores the cache in the canonical format (i.e. uid/gid 0 and no
weird permissions). This has two advantages, first of all it matches
what flatpak build-export will produce, so diff:ing with the final
result will make things easier to read, shared repos will be smaller,
etc. Secondly, it will allow us to switch to bare-user-only mode which
means we don't need/use xattrs for the build filesystem.

Note: We bump the cache format as the cache will change affecting
e.g. ostree diff between different cachepoints, so this will rebuild
everything once.

Closes: #80
Approved by: alexlarsson
2017-12-14 08:53:58 +00:00
Alexander Larsson c421beb086 cache: Use force_copy instead of hack
We used to have a hack where we used a bare-user cache
and a non-user-mode checkout to force a copy. But these
days ostree has a force_copy mode, so lets just use that.

This doesn't really change anything for now, but it will allow
us later to canonicalize the uid/gid in the cache without then
failing to check out due to permission issues.

Closes: #80
Approved by: alexlarsson
2017-12-14 08:53:58 +00:00
Alexander Larsson 9453867333 Store the deletes in the cache metadata too
Closes: #49
Approved by: alexlarsson
2017-10-19 15:18:19 +00:00
Alexander Larsson 32f6722c1d Change the way the cache works
Previously we chained all the state via the internal sha256
checksum, extracting periodic checksums. We now reset
the checksum for each state and instead feed it the previous
stage checksum to chain things.

This means we have different cache checksum values, but the same
chaining behaviour. The advantage being that the checksum is
re-startable from any point, if we know the parent checksum.

Closes: #49
Approved by: alexlarsson
2017-10-19 15:18:19 +00:00
Alexander Larsson 1a4240eacc platform: Delete from base the things that were deleted in the sdk.
This fixes the issue in:
    https://github.com/flatpak/flatpak/issues/1024#issuecomment-333321323
Where we removed the base platform gstreamer plugins in the the
sdk, but they were not removed in the platform.
2017-10-09 13:29:19 +02:00
Alexander Larsson 1f57553d20 Add builder_cache_checksum_uint64
Closes: #40
Approved by: alexlarsson
2017-09-29 07:01:53 +00:00
Alexander Larsson 3e65d29fac Remove unused variables
These were reported by clang

Closes: #39
Approved by: alexlarsson
2017-09-28 09:12:10 +00:00
Alexander Larsson 85d2d18ba4 cache: Save changes in cache so that we can extract them fast later. 2017-09-14 13:29:32 +02:00
Alexander Larsson 2b61639790 cache: Always return changes sorted
This helps in comparisons, etc.
2017-09-14 13:27:33 +02:00
Alexander Larsson d91037be22 Re-open the cache OstreeRepo if we change the min-free-space-percent
Without this it doesnn't work the first time the property is set.
2017-09-08 15:47:56 +02:00
Alexander Larsson 23b49e676d Disable free disk check on the cache repo 2017-09-06 17:03:34 +02:00
Alexander Larsson faba587a72 Move common/flatpak-utils.* to src/builder-flatpak-utils.* 2017-08-25 09:36:49 +02:00
Alexander Larsson 5823533bd7 Move builder/ to src/ 2017-08-25 09:30:53 +02:00