Skip to content
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

CLI symlink fixes #12046

Merged
merged 8 commits into from
Jan 7, 2025
Merged

CLI symlink fixes #12046

merged 8 commits into from
Jan 7, 2025

Conversation

roberth
Copy link
Member

@roberth roberth commented Dec 13, 2024

Motivation

PosixSourceAccessor does not operate on non-canonical paths, yet many createAtRoot calls did not canonicalize their inputs.

See commit messages and comments for details.

Probably more createAtRoot calls need this kind of treatment, but that's not a prerequisite for reviewing what's probably the bulk of the change, and the ideas behind it.

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 documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Dec 13, 2024
@roberth roberth marked this pull request as ready for review December 13, 2024 18:19
@Mic92 Mic92 added the bug label Dec 14, 2024
@Mic92
Copy link
Member

Mic92 commented Dec 14, 2024

@mergify rebase

Copy link
Contributor

mergify bot commented Dec 14, 2024

rebase

✅ Branch has been successfully rebased

@Mic92
Copy link
Member

Mic92 commented Dec 15, 2024

Tests seem to pass now. @roberth do you want to squash things a bit, so we can backport patches?

@roberth roberth added the regression Something doesn't work anymore label Dec 16, 2024
@roberth
Copy link
Member Author

roberth commented Dec 16, 2024

  • added hydraJobs.tests.functional_symlinked-home

squash things a bit

  • rearranged the commits to squash all improvements that are internal to the PR. The only remaining refactor commit is relative to master and should be separate.

@Mic92 Mic92 force-pushed the cli-symlink-fixes branch 2 times, most recently from 5b521cf to 12d4c8d Compare December 16, 2024 13:49
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-12-16-nix-team-meeting-minutes-203/57483/1

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-12-18-nix-team-meeting-minutes-204/57602/1

@Mic92
Copy link
Member

Mic92 commented Dec 23, 2024

Please undraft, if you need a new review.

@Mic92 Mic92 marked this pull request as draft December 23, 2024 13:07
@roberth roberth marked this pull request as ready for review December 23, 2024 16:00
@roberth
Copy link
Member Author

roberth commented Dec 23, 2024

Thanks for the reminder. I was still adding a regression test, 73871f2 when I was interrupted (rudely ;) ) by the maintainer meeting today.
It's ready for review now.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-12-23-nix-team-meeting-minutes-205/57783/1

@Mic92 Mic92 enabled auto-merge January 7, 2025 05:41
@Mic92
Copy link
Member

Mic92 commented Jan 7, 2025

@mergify rebase

roberth and others added 8 commits January 7, 2025 05:42
Tested with

    nix run nix/2.3-maintenance#nix-store -- --add some_symlink
    nix run nix/2.3-maintenance#nix-store -- --add-fixed sha256 --recursive some_symlink
…makeParentCanonical

I'd messed up a rebase in my previous iteration, causing `weakly_canonical` to reappear,
but not trigger a test failure.

These two functions behave similarly when the argument is a path that points to a broken
symlink. `weakly_canonical` would not resolve it because the target doesn't exist, and
`makeParentCanonical` would not resolve it, because it never resolves the final path
element.
This new test case now also tests a valid symlink, "differentiating" the two.
Copy link
Contributor

mergify bot commented Jan 7, 2025

rebase

✅ Branch has been successfully rebased

@Mic92 Mic92 force-pushed the cli-symlink-fixes branch from 73871f2 to 4c74d67 Compare January 7, 2025 05:42
@Mic92 Mic92 merged commit 383ab87 into NixOS:master Jan 7, 2025
10 checks passed
@Mic92 Mic92 added backport 2.24-maintenance Automatically creates a PR against the branch backport 2.25-maintenance Automatically creates a PR against the branch labels Jan 7, 2025
Mic92 added a commit that referenced this pull request Jan 7, 2025
Mic92 added a commit that referenced this pull request Jan 7, 2025
@szlend
Copy link
Member

szlend commented Jan 18, 2025

This is still an issue in 2.24. Any plans to tag a maintenance release soon?

@Mic92
Copy link
Member

Mic92 commented Jan 18, 2025

cc @edolstra ^

@roberth roberth added automatic backport This PR is a backport produced by automation (does not trigger backporting) and removed automatic backport This PR is a backport produced by automation (does not trigger backporting) labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.24-maintenance Automatically creates a PR against the branch backport 2.25-maintenance Automatically creates a PR against the branch bug documentation new-cli Relating to the "nix" command regression Something doesn't work anymore with-tests Issues related to testing. PRs with tests have some priority
Projects
Archived in project
5 participants