Skip to content

libexpr: Don't leak output of SourceAccessor::showPath in eval - #16780

Merged
xokdvium merged 5 commits into
masterfrom
fix-showPath-leakage
Nov 8, 2026
Merged

xokdvium merged 5 commits into
masterfrom
fix-showPath-leakage

Conversation

@xokdvium

@xokdvium xokdvium commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Motivation

showPath (called from SourcePath::to_string()) is now primarily meant only for legible source locations in error messages and such.

See #16550.

Also hack around lazy paths issue with nix run when the program is a "mounted" path by stuffing back opaque string context.

Implementation


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium
xokdvium requested a review from edolstra as a code owner November 7, 2026 19:51
@github-actions github-actions Bot added the with-tests Issues related to testing. PRs with tests have some priority label Nov 7, 2026
@xokdvium
xokdvium force-pushed the fix-showPath-leakage branch from 6e1d10a to d9526aa Compare November 7, 2026 19:53
@xokdvium

xokdvium commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

This is a bit of a regression from #14050 for pure-eval

@xokdvium
xokdvium marked this pull request as draft November 7, 2026 20:04
@github-actions github-actions Bot added the store Issues and pull requests concerning the Nix store label Nov 7, 2026
@xokdvium

xokdvium commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

The second commit is also a regression fix from #14050 (comment)

@Ericson2314 Ericson2314 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is good, but we should put some docs on showPath and toString so this doesn't happen in the future

@xokdvium

xokdvium commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Will add more tests. Though hopefully I can do the language tests refactor so that we can run them with more store types and we'll get better coverage that way

@xokdvium
xokdvium marked this pull request as ready for review November 8, 2026 11:54
@xokdvium
xokdvium force-pushed the fix-showPath-leakage branch from f5d3b1e to d12ff06 Compare November 8, 2026 12:31
@xokdvium
xokdvium added this pull request to the merge queue Nov 8, 2026
@xokdvium
xokdvium removed this pull request from the merge queue due to a manual request Nov 8, 2026
showPath (called from SourcePath::to_string()) is now primarily meant
only for legible source locations in error messages and such.

See #16550.

Also hack around lazy paths issue with `nix run` when the program is
a "mounted" path by stuffing back opaque string context.
They pollute the logs way too much and provide little useful context.
@xokdvium
xokdvium force-pushed the fix-showPath-leakage branch from 3131f08 to 0845028 Compare November 8, 2026 14:02
@xokdvium
xokdvium enabled auto-merge November 8, 2026 14:02
@xokdvium
xokdvium added this pull request to the merge queue Nov 8, 2026
Merged via the queue into master with commit b564ead Nov 8, 2026
20 checks passed
@xokdvium
xokdvium deleted the fix-showPath-leakage branch November 8, 2026 15:30
@xokdvium xokdvium added the backport 2.35-maintenance Automatically creates a PR against the branch label Nov 8, 2026
@internal-nix-ci

Copy link
Copy Markdown

Successfully created backport PR for 2.35-maintenance:

@xokdvium xokdvium mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.35-maintenance Automatically creates a PR against the branch store Issues and pull requests concerning the Nix store with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants