actions / actions/toolkit

Changing the PATH changes the `tar` command used by the cache

Open
#642 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug cache
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

In https://github.com/actions/cache/issues/465, the user's workflow was modifying the PATH while installing some custom software. This changed the tar implementation found when searching the PATH because it added C:/Program Files/Git/usr/bin. This broke caching since the cache action expected to use "BSD tar with GZip" during the restore step but would save the cache using "GNU tar with Zstd".

There is already work underway to always use GNU tar (when available), but even this could potentially run into issues if:

  1. The user modifies the PATH env var and removes all tar implementations
  2. The system starts without GNU tar but the user installs it in a subsequent step.

It therefore seems like we need the cache to "lock onto" a particular version of tar. My thinking is to record the tar implementation in the state which can then be used in the post step.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the cache implementation that performs the restore and post steps, then read how it discovers tar and persists state between those steps. Reproduce the PATH changes described in the issue and verify that restore and save use the same tar implementation, including when tar is unavailable or installed later.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.