Skip to content

Factor out nix::maybeLstat#10362

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:maybeLstat
Mar 30, 2024
Merged

Factor out nix::maybeLstat#10362
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:maybeLstat

Conversation

@Ericson2314
Copy link
Copy Markdown
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
Copy Markdown
Member

@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
Copy Markdown
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

Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
@Ericson2314 Ericson2314 enabled auto-merge March 30, 2024 14:39
@Ericson2314 Ericson2314 merged commit 9b88e52 into NixOS:master Mar 30, 2024
@Ericson2314 Ericson2314 deleted the maybeLstat branch March 30, 2024 15:24
@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

Successfully created backport PR for 2.21-maintenance:

@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants