actions / actions/toolkit

Extracting an archive to a root subfolder fails with ENOENT

Open
#996 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

Extracting an archive to a root subfolder fails with NOENT.

Using the following typescript code,

    const tar_path = await tc.downloadTool(SOME_URL);
    const location = "/location";
    core.info(`Archive downloaded to ${tar_path}.`);

    const extract_location = await tc.extractTar(tar_path, location);
    core.info(`Archive extracted to ${extract_location}.`);

a consumer fails with:

Archive downloaded to /home/runner/work/_temp/e87a9e79-45b6-4f14-9d50-6e13043a11c5.
Error: ENOENT: no such file or directory, mkdir

To Reproduce
Steps to reproduce the behavior:

  1. Create an action that uses tool cache, downloads an archive and extracts to a root subfolder
  2. Create a workflow that uses this action
  3. Run this action
  4. Error

A github action that suffers from this problem is my WIP setup-watcom.
A consumer of this github action is watcom-cmake.
(The reproducers are currently on the experimental branch. the master branch works around this issue by extracting the toolchain to the current working directory)

This github action log shows the error message.

Expected behavior
The tar is extracted to the root subfolder, and is ready for use.

Screenshots
Screenshot from 2022-02-05 01-54-06

Additional context
The same action works on Windows, which extracts the toolchain to a direct subfolder of C:\.

The error is not EACCESS, so I think this is not a permission error.

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 tracing the extractTar entry point used in the TypeScript example and reproduce the failure with an absolute root-subfolder destination. Compare the behavior with the Windows case and the linked action log; done means the archive extracts successfully to the requested root subfolder without ENOENT.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.