Skip to content

tests/fetch-tests: avoid unnecessary copy-to-store #3315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025

Conversation

MattSturgeon
Copy link
Member

Previously path was concatenated using string interpolation. This commit switches from string interpolation to path interpolation.

The problem is nix will copy the "${directory}" to a new store object, meaning anything outside its root won't be available.

From the nix manual:

A path in an interpolated expression is first copied into the Nix
store, and the resulting string is the store path of the newly created
store object.

https://nix.dev/manual/nix/2.28/language/string-interpolation#interpolated-expression

This commit is cherry-picked from #3314, cc @stasjok

See prior discussion: #3314 (comment)

@MattSturgeon MattSturgeon requested a review from a team May 12, 2025 12:03
Previously path was concatenated using string interpolation. This commit
switches from string interpolation to path interpolation.

The problem is nix will copy the "${directory}" to a new store
object, meaning anything outside its root won't be available.

From the nix manual:

> A path in an interpolated expression is first copied into the Nix
> store, and the resulting string is the store path of the newly created
> store object.

https://nix.dev/manual/nix/2.28/language/string-interpolation#interpolated-expression
@MattSturgeon

This comment was marked as resolved.

This comment was marked as resolved.

Copy link
Contributor

mergify bot commented May 12, 2025

This pull request, with head sha ddddd780e0ba901cd990de2401348f95f706f762, has been successfully merged with fast-forward by Mergify.

This pull request will be automatically closed by GitHub.

As soon as GitHub detects that the sha ddddd780e0ba901cd990de2401348f95f706f762 is part of the main branch, it will mark this pull request as merged.

It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch tests/path-root, this means GitHub will fail to detect the merge.

@mergify mergify bot merged commit ddddd78 into nix-community:main May 12, 2025
4 checks passed
@mergify mergify bot temporarily deployed to github-pages May 12, 2025 14:36 Inactive
@MattSturgeon MattSturgeon deleted the tests/path-root branch May 12, 2025 14:38
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.

3 participants