forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 7
Provenance #321
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
Provenance #321
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e096c4b
attrsToJSON(): Never serialize the __final attribute
edolstra 607804e
Provenance tracking
edolstra 1d8d430
Include provenance in resBuildResult log messages
edolstra 1a638ee
Include provenance in the daemon protocol
edolstra 8c9d6b2
Add experimental feature to enable provenance
edolstra c8a845e
Fix test
edolstra 05e14c5
Fix test
edolstra 62e4faf
Implement RemoteStore::addToStore()
edolstra e7453a4
Cleanup
edolstra 84e8f4b
Move provenance field
edolstra 89bb2f4
DummyStore: Include provenance
edolstra c426593
Add Provenance destructor
edolstra b03ddaf
Rename "derivation" provenance to "build"
edolstra 959bc7d
Rename isUsefulProvenance() -> includeInProvenance()
edolstra 06305fb
FetchurlProvenance: Remove sensitive URL data
edolstra e4ab014
FilteringSourceAccessor: Set subpath provenance correctly
edolstra a4734c6
Add provenance test
edolstra 094f8dd
Merge remote-tracking branch 'detsys/main' into provenance-detsys
edolstra bdc94b2
Add EvalContext type for per-thread evaluation context
edolstra a344766
Add helper functions for propagating eval context
edolstra 2458fc6
Handle the next field consistently
edolstra 7e69413
Use getReference().render()
edolstra 04fc9a5
CopiedProvenance: Handle null value for `next`
edolstra 7f9efc6
Don't set provenance in impure mode
edolstra ec59646
Merge remote-tracking branch 'detsys/main' into provenance-detsys
edolstra 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
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #pragma once | ||
|
|
||
| #include "nix/util/provenance.hh" | ||
| #include "nix/fetchers/fetchers.hh" | ||
|
|
||
| namespace nix { | ||
|
|
||
| struct TreeProvenance : Provenance | ||
| { | ||
| ref<nlohmann::json> attrs; | ||
|
|
||
| TreeProvenance(const fetchers::Input & input); | ||
|
|
||
| nlohmann::json to_json() const override; | ||
| }; | ||
|
|
||
| } // namespace nix |
This file contains hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #include "nix/fetchers/provenance.hh" | ||
| #include "nix/fetchers/attrs.hh" | ||
|
|
||
| #include <nlohmann/json.hpp> | ||
|
|
||
| namespace nix { | ||
|
|
||
| TreeProvenance::TreeProvenance(const fetchers::Input & input) | ||
| : attrs(make_ref<nlohmann::json>([&]() { | ||
| // Remove the narHash attribute from the provenance info, as it's redundant (it's already recorded in the store | ||
| // path info). | ||
| auto attrs2 = input.attrs; | ||
| attrs2.erase("narHash"); | ||
| return fetchers::attrsToJSON(attrs2); | ||
| }())) | ||
| { | ||
| } | ||
|
|
||
| nlohmann::json TreeProvenance::to_json() const | ||
| { | ||
| return nlohmann::json{ | ||
| {"type", "tree"}, | ||
| {"attrs", *attrs}, | ||
| }; | ||
| } | ||
|
|
||
| } // namespace nix |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.