uutils / uutils/coreutils

cp: GNU test script preserve-gid.sh fails due to environment variable

Open
#7,661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - cp
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

The GNU test file tests/cp/preserve-gid.sh fails in the CI due to the variable $abs_path_dir_ being the empty string, which eventually results in this error:

2025-04-05T09:52:15.8760689Z FAIL: tests/cp/preserve-gid
2025-04-05T09:52:15.8760900Z ===========================
2025-04-05T09:52:15.8761102Z 
2025-04-05T09:52:15.8761220Z       chroot --skip-chdir \
2025-04-05T09:52:15.8761456Z cp: cannot stat '/cp': No such file or directory
2025-04-05T09:52:15.8761742Z env: 'cp': No such file or directory
2025-04-05T09:52:15.8762010Z FAIL tests/cp/preserve-gid.sh (exit status: 1)

See the "Run GNU root tests" step in the "Run GNU tests" job; here is a recent build: https://github.com/uutils/coreutils/actions/runs/14280309835/job/40029506444

I'm not sure how the $abs_path_dir_ variable gets set normally, but I can't find any other reference to it. For our purposes, maybe it is just enough to set it explicitly in the tests/cp/preserve-gid.sh file? It looks like maybe it needs to be </path/to/gnucoreutils>/src?

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 with tests/cp/preserve-gid.sh and the “Run GNU root tests” step in the “Run GNU tests” CI job. Trace where abs_path_dir_ is expected to be set and reproduce the failure; done means the preserve-gid test finds cp through the intended path and passes in CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.