Skip to content

cp: label the destination of -Z when it is named relatively - #14161

Open
sylvestre wants to merge 2 commits into
uutils:mainfrom
sylvestre:fix-gnu-cp-a-selinux
Open

cp: label the destination of -Z when it is named relatively#14161
sylvestre wants to merge 2 commits into
uutils:mainfrom
sylvestre:fix-gnu-cp-a-selinux

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Should make test tests/cp/cp-a-selinux.sh pass

#13841

Copilot AI lite review requested due to automatic review settings August 26, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre
sylvestre force-pushed the fix-gnu-cp-a-selinux branch from a206c73 to c052ae5 Compare August 26, 2026 19:49
@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.62%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 2 regressed benchmarks
✅ 354 untouched benchmarks
🆕 4 new benchmarks
⏩ 50 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation true_consecutive_calls 294.7 ns 350.2 ns -15.86%
Simulation du_deep_tree[(100, 3)] 2 ms 2.2 ms -5.35%
Simulation mv_directory 8.2 ms 7.3 ms +12.41%
🆕 Memory base16_encode_to_dev_null N/A 22.6 KB N/A
🆕 Memory base16_encode_to_file N/A 22.6 KB N/A
🆕 Simulation base16_encode_to_dev_null N/A 184.3 ms N/A
🆕 Simulation base16_encode_to_file N/A 184.2 ms N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sylvestre:fix-gnu-cp-a-selinux (1b72452) with main (1a6fb19)2

Open in CodSpeed

Footnotes

  1. 50 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (7d10e5b) during the generation of this report, so 1a6fb19 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/retry (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cp/cp-a-selinux is no longer failing!
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

Three problems kept tests/cp/cp-a-selinux.sh from running and passing under
the SELinux CI job:

* build-gnu.sh stubbed out src/getlimits with an empty, non-executable file
  when SELINUX_ENABLED=1, on the assumption that the SELinux tests do not use
  it. cp-a-selinux.sh calls getlimits_, so the test died with "hard error:
  running getlimits" (exit 99) before running anything. Build the real program
  instead -- only that one, together with the generated sources it needs, so
  the job still skips the rest of the GNU tree. Key the build on the program
  being executable rather than merely existing, and do it also when reusing an
  existing GNU build directory, so a tree left behind by the previous version
  of the script repairs itself. Remove a stale copy in the uutils build
  directory before installing it, since copying onto an existing file keeps
  that file's permissions.

* -Z asks the policy for the default context of the destination, and the
  policy only ever lists absolute names: a relative name matched nothing, the
  lookup reported success because "no default context" is not an error, and
  the file silently kept the context it had inherited or already carried.
  Resolve the name first, leaving the last component alone so a symbolic link
  is still labelled itself.

* A failure to set the context lost its errno on the way into CpError, so the
  ENOTSUP that a mount with a fixed context returns could no longer be
  recognised, and -a printed a diagnostic where GNU stays quiet.

Should make test tests/cp/cp-a-selinux.sh pass

uutils#13841
Stripping the factor tests leaves tests/local.mk with a trailing backslash
that automake rejects. Building getlimits while local.mk was still newer
than Makefile.in sent make into the remake rule, which died there; the
|| true hid it, nothing was copied to the uutils build directory, and the
tests calling getlimits_ ended in "hard error: running getlimits".

Move the build below the touch that settles those timestamps, and say so
when getlimits is missing instead of failing silently.

Should make test tests/cp/cp-a-selinux.sh pass
@sylvestre
sylvestre force-pushed the fix-gnu-cp-a-selinux branch from c052ae5 to 1b72452 Compare August 26, 2026 20:51
Copilot AI review requested due to automatic review settings August 26, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre

Copy link
Copy Markdown
Contributor Author

Congrats! The gnu test tests/cp/cp-a-selinux is no longer failing!

\o/

@sylvestre
sylvestre requested a review from cakebaker August 27, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants