Skip to content

libstore: fix runtime gc on non-standard store paths#15122

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:gc-test
Jan 30, 2026
Merged

libstore: fix runtime gc on non-standard store paths#15122
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:gc-test

Conversation

@artemist
Copy link
Member

Motivation

Due to a typo in quoteRegexChars, finding runtime roots for garbage collection was failing on paths that contained a dot, or any other regex chars that would have to be replaced. This happened during functional tests.

At the same time, also add some tests to ensure that runtime gc continues to work. This was originally part of a change I wrote in lix: https://git.lix.systems/lix-project/lix/commit/c03de0df627864fb7e83e9af88201b8a5fcd4930

Context


Add 👍 to pull requests you find important.

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

@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Jan 30, 2026
Due to a typo in quoteRegexChars, finding runtime garbage collection roots
was failing on paths that contained a dot, or any other regex chars that would
have to be replaced.

When fixing that error, also add tests to make sure gc continues to
work.
@Ericson2314 Ericson2314 enabled auto-merge January 30, 2026 16:22
@Ericson2314 Ericson2314 added this pull request to the merge queue Jan 30, 2026
Merged via the queue into NixOS:master with commit 22372d7 Jan 30, 2026
14 checks passed
@Ericson2314 Ericson2314 deleted the gc-test branch January 30, 2026 17:31
{
static auto specialRegex = boost::regex(R"([.^$\\*+?()\[\]{}|])");
return boost::regex_replace(raw, specialRegex, R"(\$&)");
return boost::regex_replace(raw, specialRegex, R"(\\$&)");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, but what's the purpose of this with raw string literals?

Copy link
Member Author

Choose a reason for hiding this comment

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

We need to escape the backslash for the regex engine, not the string parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants