Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache not used for 'dir' sources #356

Open
sophie-h opened this issue Jul 2, 2020 · 4 comments
Open

Cache not used for 'dir' sources #356

sophie-h opened this issue Jul 2, 2020 · 4 comments

Comments

@sophie-h
Copy link

sophie-h commented Jul 2, 2020

Linux distribution and version

Debian 10

Flatpak-builder version

1.0.10

Flatpak version

1.2.5

Description of the problem

Source of type dir always leads to "Cache miss"

Steps to reproduce

app-id: org.example.App
runtime: org.gnome.Platform
sdk: org.gnome.Sdk

modules:
  - name: file
    buildsystem: simple
    build-commands: [ echo file ]
    sources:
      - type: file
        path: /etc/os-release
  - name: dir
    buildsystem: simple
    build-commands: [ echo dir ]
    sources:
      - type: dir
        path: ./
  - name: git
    buildsystem: simple
    build-commands: [ echo git ]
    sources:
      - type: git
        path: ./

result of second run

Cache hit for file, skipping build
Cache miss, checking out last cache hit
========================================================================
Building module dir in /tmp/test/.flatpak-builder/build/dir-1
========================================================================
Running: echo dir
dir
Committing stage build-dir to cache
========================================================================
Building module git in /tmp/test/.flatpak-builder/build/git-1
========================================================================
Already on 'master'
Running: echo git
git
Committing stage build-git to cache
@sophie-h sophie-h changed the title Cache not used for 'dir' and 'git' sources Cache not used for 'dir' sources Jul 2, 2020
@sophie-h
Copy link
Author

sophie-h commented Jul 2, 2020

Found this in the source code:

  /* We can't realistically checksum a directory, so always rebuild */
  builder_cache_checksum_random (cache);

Maybe this could be mentioned in the docs and I guess git might be a good alternative that could be recommend for some cases.

@sophie-h
Copy link
Author

sophie-h commented Jul 2, 2020

Actually, to me it doesn't sound that unrealistic to checksum a directory. Rebuilding dir sources is pretty annoying for CI. The GNOME CI for example seems to do all builds twice due to cache misses for dir sources.

@mwleeds
Copy link
Collaborator

mwleeds commented Jul 2, 2020

Certainly one way to checksum a directory is to make an ostree commit of it.

@abergmeier
Copy link

Trying to tackle this in #575 while still keeping the current default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants