-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use the fs accessor for readInvalidDerivation #4366
Merged
+28
−24
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use the fs accessor for readInvalidDerivation
Extend `FSAccessor::readFile` to allow not checking that the path is a valid one, and rewrite `readInvalidDerivation` using this extended `readFile`. Several places in the code use `readInvalidDerivation`, either because they need to read a derivation that has been written in the store but not registered yet, or more generally to prevent a deadlock because `readDerivation` tries to lock the state, so can't be called from a place where the lock is already held. However, `readInvalidDerivation` implicitely assumes that the store is a `LocalFSStore`, which isn't always the case. The concrete motivation for this is that it's required for `nix copy --from someBinaryCache` to work, which is tremendously useful for the tests.
- 2.26.3
- 2.26.2
- 2.26.1
- 2.26.0
- 2.25.5
- 2.25.4
- 2.25.3
- 2.25.2
- 2.25.1
- 2.25.0
- 2.24.12
- 2.24.11
- 2.24.10
- 2.24.9
- 2.24.8
- 2.24.7
- 2.24.6
- 2.24.5
- 2.24.4
- 2.24.3
- 2.24.2
- 2.24.1
- 2.24.0
- 2.23.4
- 2.23.3
- 2.23.2
- 2.23.1
- 2.23.0
- 2.22.4
- 2.22.3
- 2.22.2
- 2.22.1
- 2.22.0
- 2.21.5
- 2.21.4
- 2.21.3
- 2.21.2
- 2.21.1
- 2.21.0
- 2.20.9
- 2.20.8
- 2.20.7
- 2.20.6
- 2.20.5
- 2.20.4
- 2.20.3
- 2.20.2
- 2.20.1
- 2.20.0
- 2.19.7
- 2.19.6
- 2.19.5
- 2.19.4
- 2.19.3
- 2.19.2
- 2.19.1
- 2.19.0
- 2.18.9
- 2.18.8
- 2.18.7
- 2.18.6
- 2.18.5
- 2.18.4
- 2.18.3
- 2.18.2
- 2.18.1
- 2.18.0
- 2.17.2
- 2.17.1
- 2.17.0
- 2.16.3
- 2.16.2
- 2.16.1
- 2.16.0
- 2.15.3
- 2.15.2
- 2.15.1
- 2.15.0
- 2.14.1
- 2.14.0
- 2.13.6
- 2.13.5
- 2.13.4
- 2.13.3
- 2.13.2
- 2.13.1
- 2.13.0
- 2.12.1
- 2.12.0
- 2.11.1
- 2.11.0
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.1
- 2.8.0
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4
- 2.4pre-rc1
commit 7080321618e29033a8b5dc2f9fc938dcf2df270d
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the overrides shouldn't have the default args? Elsewhere in the codebase they at least are only part of the declarations, IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. Triggered me to read https://stackoverflow.com/questions/6464404/virtual-function-default-arguments-behaviour which is… interesting.
The gist of it seems to that if we only call
accessor.readFile(path)
whereaccessor
is declared of typeFSAccessor
(which is probably the case) then we don't need the default arguments for the overrides. But that looks quite fragile. Maybe I could just split the interface as:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I read it the other way around, where up casting certainly gives you the outer default arg, but no upcasting would also give you the outer default arg if there is no inner default arg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, just checked:
x.foo()
typechecks fine, buty.foo()
doesn'tThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to have misled you with that wrong interpretation then.