Unintended side effects of caching #1

Closed
opened 2022-04-27 07:25:09 +00:00 by grawlinson · 0 comments
Owner

Lines 37 to 45 in 9ff21f6
# rust - crates
if grep -q "depends = rust\|cargo" <<<"$makepkg_output"; then
EXTRA_ARGS+=(--bind-rw /var/cache/cargo:/build/.cargo)
fi
# go - modules
if grep -q "depends = go" <<<"$makepkg_output"; then
EXTRA_ARGS+=(--bind-rw /var/cache/golang:/build/go)
fi

Caching Rust/Go packages has the unfortunate side effect of preserving the following directories:

  • GOPATH/bin
  • CARGO_HOME/bin and other artifacts in the CARGO_HOME directory.

The following needs to change:

  • /var/cache/cargo:/build/.cargo to /var/cache/cargo/git:/build/.cargo/git and /var/cache/cargo/registry:/build/.cargo/registry
  • /var/cache/golang:/build/go to /var/cache/golang/pkg:/build/go/pkg
https://git.little.kiwi/grawlinson/arch-pkgs/src/commit/9ff21f67e088c6acfcafe73e2830acec3b24854f/.repo/build#L37-L45 Caching Rust/Go packages has the unfortunate side effect of preserving the following directories: * `GOPATH/bin` * `CARGO_HOME/bin` and other artifacts in the `CARGO_HOME` directory. The following needs to change: * `/var/cache/cargo:/build/.cargo` to `/var/cache/cargo/git:/build/.cargo/git` and `/var/cache/cargo/registry:/build/.cargo/registry` * `/var/cache/golang:/build/go` to `/var/cache/golang/pkg:/build/go/pkg`
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: grawlinson/arch-pkgs#1
No description provided.