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

Factor out nix::maybeLstat #10362

Merged
merged 2 commits into from
Mar 30, 2024
Merged

Conversation

Ericson2314
Copy link
Member

Motivation

This function is nice for more than PosixSourceAccessor. We can make a few things simpler with it.

Context

Note that the error logic slightly changes in some of the call sites, in that we also count ENOTDIR and not just ENOENT as not having the file, but that should be fine.

Helps out with windows porting.

Priorities and Process

Add 👍 to pull requests you find important.

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

This function is nice for more than `PosixSourceAccessor`. We can make a
few things simpler with it.

Note that the error logic slightly changes in some of the call sites, in
that we also count `ENOTDIR` and not just `ENOENT` as not having the
file, but that should be fine.
Copy link
Contributor

@puffnfresh puffnfresh left a comment

Choose a reason for hiding this comment

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

Much nicer! I actually noticed this when reviewing the Windows branch and really liked it.

Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

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

One small documentation nit, but great otherwise! It's quite pleasant to see these C-isms a bit more confined :)

Feel free to merge once the doc is here

src/libutil/file-system.hh Show resolved Hide resolved
Co-authored-by: Théophane Hufschmitt <[email protected]>
@Ericson2314 Ericson2314 merged commit 9b88e52 into NixOS:master Mar 30, 2024
9 checks passed
@Ericson2314 Ericson2314 deleted the maybeLstat branch March 30, 2024 15:24
@Ericson2314 Ericson2314 added backport 2.19-maintenance Automatically creates a PR against the branch backport 2.20-maintenance Automatically creates a PR against the branch backport 2.21-maintenance Automatically creates a PR against the branch labels Apr 11, 2024
Copy link

Backport failed for 2.19-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.19-maintenance
git worktree add -d .worktree/backport-10362-to-2.19-maintenance origin/2.19-maintenance
cd .worktree/backport-10362-to-2.19-maintenance
git switch --create backport-10362-to-2.19-maintenance
git cherry-pick -x 8be347afcac8006967921e4738215d98405f6d75 3752bbef28899bc05e2e144fae5dcf37d99f86b5

Copy link

Backport failed for 2.20-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.20-maintenance
git worktree add -d .worktree/backport-10362-to-2.20-maintenance origin/2.20-maintenance
cd .worktree/backport-10362-to-2.20-maintenance
git switch --create backport-10362-to-2.20-maintenance
git cherry-pick -x 8be347afcac8006967921e4738215d98405f6d75 3752bbef28899bc05e2e144fae5dcf37d99f86b5

Copy link

Backport failed for 2.19-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.19-maintenance
git worktree add -d .worktree/backport-10362-to-2.19-maintenance origin/2.19-maintenance
cd .worktree/backport-10362-to-2.19-maintenance
git switch --create backport-10362-to-2.19-maintenance
git cherry-pick -x 8be347afcac8006967921e4738215d98405f6d75 3752bbef28899bc05e2e144fae5dcf37d99f86b5

Copy link

Backport failed for 2.20-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.20-maintenance
git worktree add -d .worktree/backport-10362-to-2.20-maintenance origin/2.20-maintenance
cd .worktree/backport-10362-to-2.20-maintenance
git switch --create backport-10362-to-2.20-maintenance
git cherry-pick -x 8be347afcac8006967921e4738215d98405f6d75 3752bbef28899bc05e2e144fae5dcf37d99f86b5

Copy link

Successfully created backport PR for 2.21-maintenance:

Copy link

Backport failed for 2.19-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.19-maintenance
git worktree add -d .worktree/backport-10362-to-2.19-maintenance origin/2.19-maintenance
cd .worktree/backport-10362-to-2.19-maintenance
git switch --create backport-10362-to-2.19-maintenance
git cherry-pick -x 8be347afcac8006967921e4738215d98405f6d75 3752bbef28899bc05e2e144fae5dcf37d99f86b5

Copy link

Git push to origin failed for 2.21-maintenance with exitcode 1

Copy link

Backport failed for 2.20-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.20-maintenance
git worktree add -d .worktree/backport-10362-to-2.20-maintenance origin/2.20-maintenance
cd .worktree/backport-10362-to-2.20-maintenance
git switch --create backport-10362-to-2.20-maintenance
git cherry-pick -x 8be347afcac8006967921e4738215d98405f6d75 3752bbef28899bc05e2e144fae5dcf37d99f86b5

Copy link

Git push to origin failed for 2.21-maintenance with exitcode 1

tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
Factor out `nix::maybeLstat`

(cherry-picked from commit 9b88e52)

Change-Id: Id890525e847c890fad6593c594772826ac4d1d50
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.19-maintenance Automatically creates a PR against the branch backport 2.20-maintenance Automatically creates a PR against the branch backport 2.21-maintenance Automatically creates a PR against the branch windows
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants