Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

why repeat build in rust? #201

Open
rustdreamer opened this issue Apr 3, 2022 · 3 comments
Open

why repeat build in rust? #201

rustdreamer opened this issue Apr 3, 2022 · 3 comments

Comments

@rustdreamer
Copy link

rustdreamer commented Apr 3, 2022

Describe the bug
I've tried 101 times, but all repeat build in rust.

To Reproduce
Steps to reproduce the behavior:

steps:
- name: restore-cache-with-filesystem
  image: meltwater/drone-cache
  pull: true
  settings:
    backend: "filesystem"
    restore: true
    cache_key: "volume"
    mount:
      - target
  volumes:
  - name: cache
    path: /tmp/cache

- name: rust-build
  image: rust:1.57.0
  pull: true
  commands:
    - cargo build --release
  when:
    event: [push, pull_request]
    branch: [development]
  volumes:
  - name: cache
    path: /tmp/cache

- name: rebuild-cache-with-filesystem
  image: meltwater/drone-cache
  pull: true
  settings:
    backend: "filesystem"
    rebuild: true
    cache_key: "volume"
    mount:
      - target
  volumes:
  - name: cache
    path: /tmp/cache

Expected behavior
Except for the first time, others should read the cache

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version 18.0

Additional context
No more

@cydowens
Copy link
Contributor

@rustdreamer Sorry for the delayed response, do you have any updates around this issue? I will look into duplicating the above, but wanted to see if you have had any changes?

@bdebyl
Copy link
Contributor

bdebyl commented Jul 19, 2022

I'm not sure I understand the issue here. Perhaps not all required directories are mounted as part of drone-cache settings, or more likely this is an issue with the rust compiler seeing the files as out of date. Perhaps a Makefile could prove useful here though may yield similar behavior.

I am not familiar enough with rust to understand if the build command is selective with it's sources and output/target files. However, this does seem more like an issue to be resolved with cargo rather than drone-cache.

If this is still needed please address any attempts to resolve this with additional steps in Drone @rustdreamer

@raphendyr
Copy link

Two ideas:

  1. Ensure those compiled / cached files are really under target and not e.g. $HOME/.cache/foobar. I.e., are you really caching the data you assume you should? Note that absolute paths are not yet supported, see archive: Add absolute path mode #141

  2. The cache plugin doesn't restore timestamps, thus cargo could assume one file is modified when it's really not. However, the cache should have a newer file, thus the behaviour doesn't support this theory. Any how, more in Tar archive does not restore file (or directory) modification time stamps #210 .

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

No branches or pull requests

4 participants