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

Git hashing as a new file ingestion method --- contains #3754 #3635

Closed
wants to merge 231 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
dbca599
Add ingestionMethodPrefix to get prefix
matthewbauer May 27, 2020
9b452c9
Handle g: prefix in nix store paths
matthewbauer May 27, 2020
16c4945
Use git: instead of g: for ca prefix
matthewbauer May 27, 2020
6ba8360
Rename recursive to method in more places
matthewbauer May 27, 2020
2e16c28
Throw error when using unsupported git file ingestion
matthewbauer May 27, 2020
256bbb6
First draft of git parsing
meditans May 27, 2020
85eeb2a
Use switch ingestion method in BinaryCacheStore::addToStore
matthewbauer May 28, 2020
39df335
More work on git objects
matthewbauer May 27, 2020
ffc1024
Add fcntl.h to fs-sink.hh
matthewbauer May 28, 2020
124cc89
Fix bugs with git hashing
Ericson2314 May 28, 2020
a1f5760
Remove cached data
Ericson2314 May 28, 2020
3481284
Merge remote-tracking branch 'obsidian/do-fixme-store-removes' into g…
Ericson2314 May 29, 2020
4ced63c
Temporarily reduce CI platform's for sake of Obsidian's own CI
Ericson2314 Jun 1, 2020
130267d
Handle git ingestion over daemon
matthewbauer May 28, 2020
df74744
Parse git blobs correctly
matthewbauer May 28, 2020
f292e50
Add --git argument to add-to-store
matthewbauer May 28, 2020
1592d09
Add test for nix add-to-store
matthewbauer May 28, 2020
cf81991
Depend on install for installcheck
matthewbauer May 28, 2020
9e9c2ce
Give error when git ingestion doesn’t use sha1
matthewbauer May 29, 2020
6f7fab9
Use SHA1 for Git objects
matthewbauer May 29, 2020
ee989c6
Pass storeDir to restoreGit
matthewbauer May 29, 2020
9cd3ac7
Pad 0s for dumpGitInternal
matthewbauer May 29, 2020
b5ed6a9
Add createExecutableFile primitive to ParseSink
matthewbauer May 29, 2020
6ceba63
Read related git objects from nix store in parseGit
matthewbauer May 29, 2020
e44956d
Allow sha1 in --hash results
matthewbauer May 29, 2020
646862e
Add test for adding git tree hash
matthewbauer May 29, 2020
592e926
Expand git tests
matthewbauer May 29, 2020
a4a038f
Cleanup git.cc code
matthewbauer May 29, 2020
4ecb49d
Use path-based addToStore method for add-to-store
matthewbauer May 29, 2020
d68b774
Properly handle realStoreDir vs. storeDir in git.cc
matthewbauer May 29, 2020
18d4a3d
Allow sending git objects over daemon
matthewbauer May 29, 2020
d8f34fd
Recursively add to store from git ingestion
matthewbauer May 29, 2020
27ffbc7
Add hash to local store correctly from dump
matthewbauer May 30, 2020
05cbfde
Move git tests to own file
matthewbauer May 30, 2020
97ce2cc
Revert "Depend on install for installcheck"
matthewbauer May 30, 2020
229ce9c
Make computeStorePathForPath work in Git ingestion
matthewbauer Jun 1, 2020
031fa72
Use SHA256 for narHash
matthewbauer Jun 1, 2020
d49c873
Use correct narHash in add-to-store
matthewbauer Jun 1, 2020
cd3ef3f
Throw error when hashAlgo != SHA1 on git ingestion
matthewbauer Jun 1, 2020
4dae98e
Don’t include realStoreDir refs in git output
matthewbauer Jun 1, 2020
1b14945
Use FdSink to simplify copying
matthewbauer Jun 1, 2020
54ee74e
Fixup bad hash in tests/git.sh
matthewbauer Jun 1, 2020
b1e1ace
Update tests/git.sh hashes
matthewbauer Jun 1, 2020
7fe9a48
Don’t preallocate file size
matthewbauer Jun 1, 2020
eb90cc6
Copy instead of symlinking directories
matthewbauer Jun 1, 2020
b120259
Use custom copyDirectory instead of libc++fs
matthewbauer Jun 1, 2020
7432a9d
Fixup bad rebase
matthewbauer Jun 2, 2020
24544d3
Verify added path matches calculated store path in add-to-store
matthewbauer Jun 2, 2020
ed5b7c5
Merge pull request #3 from obsidiansystems/ipfs-git-addtostore
Ericson2314 Jun 2, 2020
4832e13
Merge remote-tracking branch 'obsidian/git-objects-develop' into git+…
Ericson2314 Jun 2, 2020
3f1040f
Merge remote-tracking branch 'obsidian/missing-include-0' into git+no…
Ericson2314 Jun 2, 2020
775ab98
Merge pull request #5 from obsidiansystems/git+no-hash-type-unknown
Ericson2314 Jun 2, 2020
88b5a98
Handle treeHash in Git fetcher
matthewbauer Jun 2, 2020
7f77ba1
Support null bytes in hashes for dumpGitTree
matthewbauer Jun 3, 2020
6611e36
Use “git” for all git object names
matthewbauer Jun 3, 2020
d07212c
Show error when git treeHash is not a tree
matthewbauer Jun 3, 2020
3457b3e
Copy executable bit correctly in fs-sink
matthewbauer Jun 3, 2020
3e8ddac
Don’t add 0 in front of dumpGitTree format
matthewbauer Jun 3, 2020
192ea2b
Observe correct git sort order
matthewbauer Jun 3, 2020
3e59168
Merge remote-tracking branch 'obsidiansystems/git-objects-develop' in…
matthewbauer Jun 4, 2020
5b7aed7
Merge pull request #6 from obsidiansystems/fetchgit
Ericson2314 Jun 4, 2020
35b0dff
Somehow lost git tests
Ericson2314 Jun 4, 2020
7596005
Add test for fetching git objects
matthewbauer Jun 4, 2020
8a91cdd
Merge pull request #8 from obsidiansystems/git-objects-fetch-test
Ericson2314 Jun 4, 2020
21d9928
Add test for submodules in git
matthewbauer Jun 4, 2020
0ce84b6
Merge remote-tracking branch 'obsidian/gitignore-test-file' into git-…
Ericson2314 Jun 4, 2020
4c6040f
Merge pull request #9 from obsidiansystems/git-objects-submodules-error
Ericson2314 Jun 4, 2020
2f12327
Merge remote-tracking branch 'obsidian/no-hash-type-unknown' into git…
Ericson2314 Jun 18, 2020
3ab213b
Merge remote-tracking branch 'upstream/master' into git-objects-develop
Ericson2314 Jun 19, 2020
4a73bd0
`addToStore` should always use NAR hash
Ericson2314 Jun 19, 2020
f85fc65
Merge remote-tracking branch 'upstream/master' into git-objects-develop
Ericson2314 Jun 22, 2020
74b83c4
Try to substitute builtins.fetch*
matthewbauer Jun 19, 2020
62d6ee0
Merge branch 'substitute-fetchers' into ipfs-git-ipld
matthewbauer Jun 22, 2020
5fa33d7
Support substituting in fetchGit
matthewbauer Jun 22, 2020
4074142
Override substitute option in test
matthewbauer Jun 23, 2020
0de3063
Merge pull request #25 from obsidiansystems/ipfs-git-ipld
Ericson2314 Jun 23, 2020
e1f836b
Store CA for fetchers
Ericson2314 Jun 25, 2020
3306877
Temp skip CA argument on this branch
Ericson2314 Jun 25, 2020
e146abd
Merge branch 'master' of github.com:NixOS/nix into HEAD
Ericson2314 Jun 25, 2020
263fcdb
Merge remote-tracking branch 'obsidian/path-info' into HEAD
Ericson2314 Jun 25, 2020
a24ebd2
Use `FixedOutputHash` in parameters for `makeFixedOutputPath`
Ericson2314 Jun 24, 2020
69fe58c
Use `PathReferences` in a few more places
Ericson2314 Jun 25, 2020
783e262
CA: Distingish Full vs Mini content addresses
Ericson2314 Jun 25, 2020
c8cd66f
Fix syntax
matthewbauer Jun 26, 2020
bff0743
Add order for FullContentAddress
matthewbauer Jun 26, 2020
1db393f
Fix referencesPossiblyToSelf
matthewbauer Jun 29, 2020
9cd79c5
Merge branch 'path-info' of github.com:obsidiansystems/nix into store…
Ericson2314 Jun 29, 2020
43ba4a8
Merge branch 'path-info' of github.com:obsidiansystems/nix into store…
Ericson2314 Jun 29, 2020
ebba7f3
Fix nar info parsing
Ericson2314 Jun 29, 2020
4f6f771
Merge branch 'path-info' of github.com:obsidiansystems/nix into store…
Ericson2314 Jun 29, 2020
e83f02c
Merge branch 'substitute-other-storedir' of github.com:matthewbauer/n…
Ericson2314 Jun 30, 2020
83f743b
Fix perl bindings
Ericson2314 Jun 30, 2020
5a8e8fa
Use some named designators again with braces for base class
Ericson2314 Jul 1, 2020
7dacd78
Fix more initialization warnings
Ericson2314 Jul 1, 2020
b2e0ec8
Try to avoid include problem in perl
Ericson2314 Jul 1, 2020
c77f6c9
Rename FullContentAddress to ContentAddress
matthewbauer Jul 1, 2020
aab42da
Merge branch 'master' of github.com:NixOS/nix into git-objects-develop
Ericson2314 Jul 2, 2020
b85dd8f
Merge remote-tracking branch 'upstream/master' into git-objects-develop
Ericson2314 Jul 3, 2020
c7383c7
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Jul 3, 2020
fd40971
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Jul 5, 2020
7271778
See if setting -std=c++17 for PERL helps
Ericson2314 Jul 5, 2020
97234c1
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Jul 6, 2020
00c0ca4
Merge commit '7d8d78f06a637ba6b75285d299b07b81279c422f' into git-obje…
Ericson2314 Jul 9, 2020
3e92236
Merge remote-tracking branch 'upstream/master' into git-objects-develop
Ericson2314 Jul 9, 2020
ff07296
Rename ContentAddress to StorePathDescriptor
meditans Jul 13, 2020
ade0f1a
Rename functions related to ContentAddress
meditans Jul 14, 2020
08bf6c4
Rename LegacyContentAddress and related functions
meditans Jul 14, 2020
c07cecc
TEMP
Ericson2314 Jul 14, 2020
ea90dc5
Merge branch 'fix-add-to-star-narhash' into git-objects-develop--merg…
Ericson2314 Jul 14, 2020
b6786fa
Merge pull request #58 from obsidiansystems/git-objects-develop--merg…
Ericson2314 Jul 14, 2020
1f6a3c2
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Jul 16, 2020
dc28cd6
Merge branch 'from-dump-stream' of github.com:obsidiansystems/nix int…
meditans Jul 16, 2020
1d52449
Merge commit 'c3c7aedbb5ac869b7c454e90683f77b9c527a75a' into ipfs-dev…
Ericson2314 Jul 19, 2020
d0eaf2b
Rename ContentAddress to StorePathDescriptor
meditans Jul 13, 2020
1cf131f
Rename functions related to ContentAddress
meditans Jul 14, 2020
74de4c7
Rename LegacyContentAddress and related functions
meditans Jul 14, 2020
db7f05c
Merge branch 'store-path-or-ca-reconcile' of github.com:obsidiansyste…
Ericson2314 Jul 19, 2020
11a4ae4
Merge commit '36a124260361ba8dfa43bf43a067dcc48064c93f' into store-pa…
Ericson2314 Jul 19, 2020
713d574
Merge branch 'store-path-or-ca-reconcile' of github.com:obsidiansyste…
Ericson2314 Jul 19, 2020
3fbb781
Merge pull request #66 from obsidiansystems/git-objects-develop-merge
Ericson2314 Jul 19, 2020
f8a1403
Merge commit 'c466cb2091b7a382aba1739c0320f2b6c0a04c1e' into store-pa…
Ericson2314 Jul 21, 2020
ecf65a6
Use StorePathDescriptor more widely
Ericson2314 Jul 21, 2020
f4918ec
Merge branch 'store-path-or-ca' of github.com:obsidiansystems/nix int…
Ericson2314 Jul 21, 2020
c9f83f2
Fix issues with store path descriptor round trip
Ericson2314 Jul 21, 2020
c4b0184
Merge pull request #68 from obsidiansystems/store-path-or-ca-reconcile
Ericson2314 Jul 22, 2020
7decfd0
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Jul 22, 2020
367cba6
Merge remote-tracking branch 'obsidian/better-ca-parse-errors' into s…
Ericson2314 Jul 31, 2020
bf042cc
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Aug 1, 2020
ed6aeb2
Merge commit '3dcca18c30cbc09652f5ac644a9f8750f9ced0c9' into new-base
Ericson2314 Aug 3, 2020
aa9c762
Merge commit 'e197bc622948973fca192774b6cd8e0d3157aeb6' into new-base
Ericson2314 Aug 3, 2020
100c287
Merge branch 'new-base' into git-objects-develop
Ericson2314 Aug 3, 2020
b224c9b
Merge branch 'master' of github.com:NixOS/nix into store-path-or-ca
meditans Aug 4, 2020
8d01e9f
Move back code to minimize diff size
meditans Aug 4, 2020
07f9134
Remove unused imports
meditans Aug 4, 2020
b9cdbe3
Merge remote-tracking branch 'obsidian/drv-outputs-map-allow-missing'…
Ericson2314 Aug 4, 2020
b0ede14
Merge branch 'templated-daemon-protocol' into store-path-or-ca
Ericson2314 Aug 4, 2020
3d17a6b
Merge remote-tracking branch 'obsidian/templated-daemon-protocol' int…
Ericson2314 Aug 5, 2020
cd7187c
WIP Merge remote-tracking branch 'obsidian/store-path-or-ca' into git…
Ericson2314 Aug 5, 2020
caafdfb
Allow tree hash without nar hash for "has all info" method
Ericson2314 Aug 6, 2020
3273d8a
Fix misc other git test failures
Ericson2314 Aug 6, 2020
8c0fd95
Fix and document some subtle assertions
Ericson2314 Aug 6, 2020
74318cc
Merge branch 'templated-daemon-protocol' of github.com:obsidiansystem…
Ericson2314 Aug 7, 2020
b789809
Merge branch 'store-path-or-ca' of github.com:obsidiansystems/nix int…
Ericson2314 Aug 7, 2020
b5f1f8e
Merge pull request #71 from obsidiansystems/git-objects-develop+store…
Ericson2314 Aug 7, 2020
535ad25
Fix perl bindings build
Ericson2314 Aug 7, 2020
31e1058
Merge branch 'store-path-or-ca' of github.com:obsidiansystems/nix int…
Ericson2314 Aug 7, 2020
a1ccec5
Merge branch 'templated-daemon-protocol' of github.com:obsidiansystem…
Ericson2314 Aug 7, 2020
c5e6da3
Merge branch 'templated-daemon-protocol' of github.com:obsidiansystem…
Ericson2314 Aug 19, 2020
fa247e2
Merge remote-tracking branch 'obsidian/templated-daemon-protocol' int…
Ericson2314 Aug 20, 2020
d16d90f
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Aug 27, 2020
7a255c8
Merge remote-tracking branch 'obsidian/store-path-or-ca' into git-obj…
Ericson2314 Sep 3, 2020
5c9f8c8
git fetcher: fix bad copy paste of "shallow"
Ericson2314 Sep 3, 2020
4b9263f
Shore up fetching and git tree hashes quite a bit
Ericson2314 Sep 3, 2020
f31e1a4
Merge remote-tracking branch 'obsidian/templated-daemon-protocol' int…
Ericson2314 Sep 22, 2020
edf7253
Merge remote-tracking branch 'obsidian/store-path-or-ca' into git-obj…
Ericson2314 Sep 22, 2020
e04cf6b
Allow `copyPaths` and `queryValidPaths` to work with StorePathDesc
Ericson2314 Sep 9, 2020
956e488
Merge remote-tracking branch 'obsidian/templated-daemon-protocol' int…
Ericson2314 Sep 22, 2020
971bc0e
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Sep 23, 2020
884a049
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Sep 23, 2020
740554c
Merge remote-tracking branch 'obsidian/store-path-or-ca' into git-obj…
Ericson2314 Sep 23, 2020
ae417b5
Handle `FileIngestionMethod::Git` for CA builds
Ericson2314 Aug 8, 2020
c5e4f51
Merge remote-tracking branch 'upstream/master' into store-path-or-ca
Ericson2314 Oct 5, 2020
fdbaca8
Fix improperly-merged revert from upstream
Ericson2314 Oct 5, 2020
cea07c9
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Oct 6, 2020
6f6b3bb
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Oct 7, 2020
6547357
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Oct 12, 2020
518903e
Merge remote-tracking branch 'obsidian/store-path-or-ca' into git-obj…
Ericson2314 Oct 12, 2020
57601f8
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Oct 13, 2020
50eb913
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Oct 13, 2020
bd2c995
Merge remote-tracking branch 'obsidian/store-path-or-ca' into git-obj…
Ericson2314 Oct 13, 2020
aa09e1d
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Oct 15, 2020
bf3933b
Merge remote-tracking branch 'obsidian/store-path-or-ca' into git-obj…
Ericson2314 Oct 15, 2020
26a0c66
Merge remote-tracking branch 'upstream/master' into path-info
Ericson2314 Feb 25, 2021
554f006
Merge remote-tracking branch 'obsidian/path-info' into store-path-or-ca
Ericson2314 Feb 25, 2021
7f50ecf
Merge commit 'f0ad29acc1f2c9e82679c3af434a8bf185f36b94' into store-pa…
Ericson2314 Mar 25, 2022
f1bcb73
Fill in missing comparison operators for content addresses
Ericson2314 Mar 25, 2022
37ab189
Fix bug in `copyPaths`
Ericson2314 Mar 26, 2022
4a55c7b
Remove pointless copy
Ericson2314 Mar 26, 2022
e6ad490
Merge commit 'e12308dd63f0ad27b22dcdb3da89c411eebcad2b' into store-pa…
Ericson2314 Mar 26, 2022
8f0b757
Merge commit 'd5cef6c33a051dfc672cb1e5f4739948b167315b' into store-pa…
Ericson2314 Mar 26, 2022
27ef76a
Merge commit '1b6cf0d5f56e166a1cbbf38142375b7a92fc88f2' into store-pa…
Ericson2314 Mar 27, 2022
8106a67
Merge commit 'f4f3203aa7c2fc9225a8ae220db25593066fb397' into store-pa…
Ericson2314 Mar 27, 2022
4ed2f42
Merge commit '13b6b645897fd2edaa0f09fa48d6fe8dd6287b55' into store-pa…
Ericson2314 Apr 19, 2022
5e87f08
Merge commit '8ba089597fa19bfd49ba5f22a5e821740ca4eb5d' into store-pa…
Ericson2314 Apr 20, 2022
230c771
Merge commit '0dc2974930df57cac6673c02e9bc6eb6fd16ba48' into store-pa…
Ericson2314 Apr 20, 2022
56be25a
Merge commit '2c21cb672043fcf3c3fd19f89618b37693c0dc62' into store-pa…
Ericson2314 Apr 20, 2022
fa1e9ea
Merge commit '13c669105ca93d28ca1a78321f07fd4ddbb445b1' into store-pa…
Ericson2314 Apr 20, 2022
daa760d
Merge branch 'path-info' into store-path-or-ca
Ericson2314 Apr 20, 2022
6601ac8
Revert "Make `ValidPathInfo` have plain `StorePathSet` references lik…
Ericson2314 Jan 14, 2023
b21dd38
Revert "Don't add `StorePathDescriptor` for now"
Ericson2314 Jan 23, 2023
91baf7f
Merge remote-tracking branch 'upstream/master' into store-path-descri…
Ericson2314 Sep 3, 2023
4ed87aa
Merge commit 'e9fc1e4fdb0ab5adb6b163c3db361b86a4f5c69b' into store-pa…
Ericson2314 Sep 3, 2023
50803f2
Merge commit '8623143921f8683b88d46aaebe9f707e5b9a912b' into store-pa…
Ericson2314 Sep 3, 2023
1731340
Merge commit '6a168254ce068c067259c913ee7d6ee2e0d1dc7e' into store-pa…
Ericson2314 Sep 3, 2023
554158c
Merge commit '9cfa78e58a92b4bf034867bc1296a200bdc3f12a' into store-pa…
Ericson2314 Sep 3, 2023
c08971b
Merge commit '46e942ff9e65755689ee72f93846d7118e1b8d45' into store-pa…
Ericson2314 Sep 3, 2023
3a43680
Merge commit '91617f80ec03ff4580a656310959ce2e31e0d177' into store-pa…
Ericson2314 Sep 3, 2023
9faa690
Merge commit '2e7be46e73293f729358eefc5b464dcb7e2d76bf' into store-pa…
Ericson2314 Sep 3, 2023
6305b77
Merge commit '056cc1c1b903114f59c536dd9821b46f68516f4e' into store-pa…
Ericson2314 Sep 3, 2023
6208375
Merge commit '6601ac86421fb05377f113aa52c55da7b9cbe658' into store-pa…
Ericson2314 Sep 3, 2023
7cac155
Merge commit 'c67e0cc58c5a74121d74a3f5cf9f9c2199a87093' into store-pa…
Ericson2314 Sep 3, 2023
f7f1be6
Merge commit 'b21dd384235bc9863c89ef249bbc1ca58f4ec3fd' into store-pa…
Ericson2314 Sep 3, 2023
57bf738
Merge branch 'store-path-descriptor' into store-path-or-ca
Ericson2314 Sep 3, 2023
f0ffdeb
Merge commit '554f006feabd8e98137b0203cd4ad96cd7189931' into git-obje…
Ericson2314 Sep 3, 2023
bfcab85
Introduce experimental feature
Ericson2314 Sep 4, 2023
db9f421
Merge commit '7f50ecf5dfcdd767443a5f465a873bd92a73172d' into git-obje…
Ericson2314 Sep 4, 2023
fd713bb
Merge commit 'f1bcb730a94b4a0546864762b04d5fc1bedd4550' into git-obje…
Ericson2314 Sep 4, 2023
07908ca
Merge commit '37ab1891b9de3b6f72032bd6d2fd0f2d3d602b51' into git-obje…
Ericson2314 Sep 4, 2023
cf55eb3
Merge commit '4a55c7b74b0de4f039fd135a86cfa44afc2a264f' into git-obje…
Ericson2314 Sep 4, 2023
2735e69
Merge commit 'e6ad49075907a2bda85107fda4142a23f4bd3505' into git-obje…
Ericson2314 Sep 4, 2023
b0b4e03
Merge commit '8f0b757a9524af47bfc477d350bdb06285af0a1a' into git-obje…
Ericson2314 Sep 4, 2023
095ac45
Merge commit '27ef76ab58e5ebeb2d9836239b034db5b83a1ae5' into git-obje…
Ericson2314 Sep 4, 2023
47cc182
Merge commit '8106a67e4e6f403be65e180f63bfa61d73e5b45e' into git-obje…
Ericson2314 Sep 4, 2023
690cc34
Merge commit '4ed2f421eb707c2195927db27bdaba8641c7d1ee' into git-obje…
Ericson2314 Sep 4, 2023
0394cc8
Merge commit '5e87f0884c93ee91803e835a05b33b77729f2e51' into git-obje…
Ericson2314 Sep 4, 2023
7dff882
Merge commit '230c771713ddaeb1d0cdfa70e3e876d403d6e023' into git-obje…
Ericson2314 Sep 4, 2023
83ad00a
Merge commit '56be25a069df3d9aadf8e0b714e2053742d912aa' into git-obje…
Ericson2314 Sep 4, 2023
c53a59d
Merge commit 'fa1e9ea950d735e078ce360ccdea94f3e983333e' into git-obje…
Ericson2314 Sep 4, 2023
9bb295e
Merge commit 'daa760d4ebde2cc212a5b89dea63b0b14b56e52e' into git-obje…
Ericson2314 Sep 4, 2023
8388950
Merge commit '4ed87aac038f307dcdf069835b9b7aa6de2497b7' into git-obje…
Ericson2314 Sep 4, 2023
525bb8c
Merge commit '50803f208da7a8f37d31191df7f32ad6b764eefb' into git-obje…
Ericson2314 Sep 4, 2023
05f67f4
Merge commit '17313408d5c06ae6aac98f7d35d8da6195c4ab2b' into git-obje…
Ericson2314 Sep 4, 2023
8c5117b
Merge commit '554158c9d06ab90f261812ddc81ad5f682f2918a' into git-obje…
Ericson2314 Sep 4, 2023
7c31431
Merge commit 'c08971bf2df0bfa0deb2b58451ebf3a65f1e0f72' into git-obje…
Ericson2314 Sep 4, 2023
166fe2a
Merge commit '3a43680ff89cc3bba167773c32dbc3762148857e' into git-obje…
Ericson2314 Sep 4, 2023
615ef58
Merge commit '9faa690e0fd8ff3d8d53e5df1c4b3c969a52fc3a' into git-obje…
Ericson2314 Sep 4, 2023
a085eeb
Merge commit '6305b77a2878333bf2af208ffe691d10ad233812' into git-obje…
Ericson2314 Sep 4, 2023
12eecf9
Merge commit '6208375ba942a676da12e79c135e07eb585cd9b0' into git-obje…
Ericson2314 Sep 4, 2023
0c68df7
Merge commit '7cac155fc8b548de7b4e054aee66551e2fc93289' into git-obje…
Ericson2314 Sep 4, 2023
40bc1d2
Merge commit 'f7f1be69330212d22c11027adb4bd8a07c1f56fe' into git-obje…
Ericson2314 Sep 4, 2023
2b42bf7
Merge branch 'store-path-or-ca' into git-objects-develop
Ericson2314 Sep 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions perl/lib/Nix/Store.xs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ void setVerbosity(int level)
int isValidPath(char * path)
CODE:
try {
RETVAL = store()->isValidPath(store()->parseStorePath(path));
auto storePath = store()->parseStorePath(path);
RETVAL = store()->isValidPath(storePath);
} catch (Error & e) {
croak("%s", e.what());
}
Expand All @@ -68,7 +69,8 @@ int isValidPath(char * path)
SV * queryReferences(char * path)
PPCODE:
try {
for (auto & i : store()->queryPathInfo(store()->parseStorePath(path))->references)
auto storePath = store()->parseStorePath(path);
for (auto & i : store()->queryPathInfo(storePath)->referencesPossiblyToSelf())
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(i).c_str(), 0)));
} catch (Error & e) {
croak("%s", e.what());
Expand All @@ -78,7 +80,8 @@ SV * queryReferences(char * path)
SV * queryPathHash(char * path)
PPCODE:
try {
auto s = store()->queryPathInfo(store()->parseStorePath(path))->narHash.to_string(Base32, true);
auto storePath = store()->parseStorePath(path);
auto s = store()->queryPathInfo(storePath)->narHash.to_string(Base32, true);
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
} catch (Error & e) {
croak("%s", e.what());
Expand All @@ -88,7 +91,8 @@ SV * queryPathHash(char * path)
SV * queryDeriver(char * path)
PPCODE:
try {
auto info = store()->queryPathInfo(store()->parseStorePath(path));
auto storePath = store()->parseStorePath(path);
auto info = store()->queryPathInfo(storePath);
if (!info->deriver) XSRETURN_UNDEF;
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(*info->deriver).c_str(), 0)));
} catch (Error & e) {
Expand All @@ -99,7 +103,8 @@ SV * queryDeriver(char * path)
SV * queryPathInfo(char * path, int base32)
PPCODE:
try {
auto info = store()->queryPathInfo(store()->parseStorePath(path));
auto storePath = store()->parseStorePath(path);
auto info = store()->queryPathInfo(storePath);
if (!info->deriver)
XPUSHs(&PL_sv_undef);
else
Expand All @@ -109,7 +114,7 @@ SV * queryPathInfo(char * path, int base32)
mXPUSHi(info->registrationTime);
mXPUSHi(info->narSize);
AV * refs = newAV();
for (auto & i : info->references)
for (auto & i : info->referencesPossiblyToSelf())
av_push(refs, newSVpv(store()->printStorePath(i).c_str(), 0));
XPUSHs(sv_2mortal(newRV((SV *) refs)));
AV * sigs = newAV();
Expand Down
3 changes: 2 additions & 1 deletion src/libcmd/command.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ ref<Store> StoreCommand::createStore()

void StoreCommand::run()
{
run(getStore());
auto store = getStore();
run(store);
}

CopyCommand::CopyCommand()
Expand Down
8 changes: 5 additions & 3 deletions src/libcmd/common-eval-args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,17 @@ Bindings * MixEvalArgs::getAutoArgs(EvalState & state)
SourcePath lookupFileArg(EvalState & state, std::string_view s)
{
if (EvalSettings::isPseudoUrl(s)) {
auto storePath = fetchers::downloadTarball(
state.store, EvalSettings::resolvePseudoUrl(s), "source", false).tree.storePath;
auto storePath = state.store->makeFixedOutputPathFromCA(
fetchers::downloadTarball(
state.store, EvalSettings::resolvePseudoUrl(s), "source", false).tree.storePath);
return state.rootPath(CanonPath(state.store->toRealPath(storePath)));
}

else if (hasPrefix(s, "flake:")) {
experimentalFeatureSettings.require(Xp::Flakes);
auto flakeRef = parseFlakeRef(std::string(s.substr(6)), {}, true, false);
auto storePath = flakeRef.resolve(state.store).fetchTree(state.store).first.storePath;
auto storePath = state.store->makeFixedOutputPathFromCA(
flakeRef.resolve(state.store).fetchTree(state.store).first.storePath);
return state.rootPath(CanonPath(state.store->toRealPath(storePath)));
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcmd/installables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ ref<eval_cache::EvalCache> openEvalCache(
EvalState & state,
std::shared_ptr<flake::LockedFlake> lockedFlake)
{
auto fingerprint = lockedFlake->getFingerprint();
auto fingerprint = lockedFlake->getFingerprint(*state.store);
return make_ref<nix::eval_cache::EvalCache>(
evalSettings.useEvalCache && evalSettings.pureEval
? std::optional { std::cref(fingerprint) }
Expand Down
13 changes: 8 additions & 5 deletions src/libexpr/flake/flake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ static std::tuple<fetchers::Tree, FlakeRef, FlakeRef> fetchOrSubstituteTree(

auto [tree, lockedRef] = *fetched;

auto storePath = state.store->makeFixedOutputPathFromCA(tree.storePath);

debug("got tree '%s' from '%s'",
state.store->printStorePath(tree.storePath), lockedRef);
state.store->printStorePath(storePath), lockedRef);

state.allowPath(tree.storePath);
state.allowPath(storePath);

assert(!originalRef.input.getNarHash() || tree.storePath == originalRef.input.computeStorePath(*state.store));

Expand Down Expand Up @@ -210,7 +212,8 @@ static Flake getFlake(
auto flakeFile = canonPath(flakeDir + "/flake.nix", true);
if (!isInDir(flakeFile, sourceInfo.actualPath))
throw Error("'flake.nix' file of flake '%s' escapes from '%s'",
lockedRef, state.store->printStorePath(sourceInfo.storePath));
lockedRef,
state.store->printStorePath(state.store->makeFixedOutputPathFromCA(sourceInfo.storePath)));

Flake flake {
.originalRef = originalRef,
Expand Down Expand Up @@ -891,14 +894,14 @@ static RegisterPrimOp r4({

}

Fingerprint LockedFlake::getFingerprint() const
Fingerprint LockedFlake::getFingerprint(const Store & store) const
{
// FIXME: as an optimization, if the flake contains a lock file
// and we haven't changed it, then it's sufficient to use
// flake.sourceInfo.storePath for the fingerprint.
return hashString(htSHA256,
fmt("%s;%s;%d;%d;%s",
flake.sourceInfo->storePath.to_string(),
store.makeFixedOutputPathFromCA(flake.sourceInfo->storePath).to_string(),
flake.lockedRef.subdir,
flake.lockedRef.input.getRevCount().value_or(0),
flake.lockedRef.input.getLastModified().value_or(0),
Expand Down
2 changes: 1 addition & 1 deletion src/libexpr/flake/flake.hh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct LockedFlake
Flake flake;
LockFile lockFile;

Fingerprint getFingerprint() const;
Fingerprint getFingerprint(const Store & store) const;
};

struct LockFlags
Expand Down
2 changes: 1 addition & 1 deletion src/libexpr/flake/lockfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LockedNode::LockedNode(const nlohmann::json & json)
fetchers::attrsToJSON(lockedRef.input.toAttrs()));
}

StorePath LockedNode::computeStorePath(Store & store) const
StorePathDescriptor LockedNode::computeStorePath(Store & store) const
{
return lockedRef.input.computeStorePath(store);
}
Expand Down
3 changes: 2 additions & 1 deletion src/libexpr/flake/lockfile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
///@file

#include "flakeref.hh"
#include "content-address.hh"

#include <nlohmann/json_fwd.hpp>

Expand Down Expand Up @@ -47,7 +48,7 @@ struct LockedNode : Node

LockedNode(const nlohmann::json & json);

StorePath computeStorePath(Store & store) const;
StorePathDescriptor computeStorePath(Store & store) const;
};

struct LockFile
Expand Down
11 changes: 8 additions & 3 deletions src/libexpr/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,12 @@ std::optional<std::string> EvalState::resolveSearchPathPath(const SearchPath::Pa

if (EvalSettings::isPseudoUrl(value)) {
try {
auto storePath = fetchers::downloadTarball(
store, EvalSettings::resolvePseudoUrl(value), "source", false).tree.storePath;
auto storePath = store->makeFixedOutputPathFromCA(
fetchers::downloadTarball(
store,
EvalSettings::resolvePseudoUrl(value),
"source",
false).tree.storePath);
res = { store->toRealPath(storePath) };
} catch (FileTransferError & e) {
logWarning({
Expand All @@ -796,7 +800,8 @@ std::optional<std::string> EvalState::resolveSearchPathPath(const SearchPath::Pa
experimentalFeatureSettings.require(Xp::Flakes);
auto flakeRef = parseFlakeRef(value.substr(6), {}, true, false);
debug("fetching flake search path element '%s''", value);
auto storePath = flakeRef.resolve(store).fetchTree(store).first.storePath;
auto storePath = store->makeFixedOutputPathFromCA(
flakeRef.resolve(store).fetchTree(store).first.storePath);
res = { store->toRealPath(storePath) };
}

Expand Down
5 changes: 3 additions & 2 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1618,8 +1618,9 @@ static void prim_readFile(EvalState & state, const PosIdx pos, Value * * args, V
state.debugThrowLastTrace(Error("the contents of the file '%1%' cannot be represented as a Nix string", path));
StorePathSet refs;
if (state.store->isInStore(path.path.abs())) {
auto p = state.store->toStorePath(path.path.abs()).first;
try {
refs = state.store->queryPathInfo(state.store->toStorePath(path.path.abs()).first)->references;
refs = state.store->queryPathInfo(p)->referencesPossiblyToSelf();
} catch (Error &) { // FIXME: should be InvalidPathError
}
// Re-scan references to filter down to just the ones that actually occur in the file.
Expand Down Expand Up @@ -2188,7 +2189,7 @@ static void addPath(
try {
auto [storePath, subPath] = state.store->toStorePath(path);
// FIXME: we should scanForReferences on the path before adding it
refs = state.store->queryPathInfo(storePath)->references;
refs = state.store->queryPathInfo(storePath)->referencesPossiblyToSelf();
path = state.store->toRealPath(storePath) + subPath;
} catch (Error &) { // FIXME: should be InvalidPathError
}
Expand Down
3 changes: 2 additions & 1 deletion src/libexpr/primops/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ static void prim_appendContext(EvalState & state, const PosIdx pos, Value * * ar
.errPos = state.positions[i.pos]
});
auto namePath = state.store->parseStorePath(name);
if (!settings.readOnlyMode)
if (!settings.readOnlyMode) {
state.store->ensurePath(namePath);
}
state.forceAttrs(*i.value, i.pos, "while evaluating the value of a string context");
auto iter = i.value->attrs->find(sPath);
if (iter != i.value->attrs->end()) {
Expand Down
5 changes: 3 additions & 2 deletions src/libexpr/primops/fetchMercurial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ static void prim_fetchMercurial(EvalState & state, const PosIdx pos, Value * * a
auto [tree, input2] = input.fetch(state.store);

auto attrs2 = state.buildBindings(8);
state.mkStorePathString(tree.storePath, attrs2.alloc(state.sOutPath));
auto storePath = state.store->makeFixedOutputPathFromCA(tree.storePath);
state.mkStorePathString(storePath, attrs2.alloc(state.sOutPath));
if (input2.getRef())
attrs2.alloc("branch").mkString(*input2.getRef());
// Backward compatibility: set 'rev' to
Expand All @@ -86,7 +87,7 @@ static void prim_fetchMercurial(EvalState & state, const PosIdx pos, Value * * a
attrs2.alloc("revCount").mkInt(*revCount);
v.mkAttrs(attrs2);

state.allowPath(tree.storePath);
state.allowPath(state.store->makeFixedOutputPathFromCA(tree.storePath));
}

static RegisterPrimOp r_fetchMercurial({
Expand Down
43 changes: 33 additions & 10 deletions src/libexpr/primops/fetchTree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ void emitTreeAttrs(

auto attrs = state.buildBindings(10);

auto storePath = state.store->makeFixedOutputPathFromCA(tree.storePath);

state.mkStorePathString(tree.storePath, attrs.alloc(state.sOutPath));
state.mkStorePathString(storePath, attrs.alloc(state.sOutPath));

// FIXME: support arbitrary input attributes.

auto narHash = input.getNarHash();
assert(narHash);
attrs.alloc("narHash").mkString(narHash->to_string(SRI, true));
if (auto narHash = input.getNarHash()) {
attrs.alloc("narHash").mkString(narHash->to_string(SRI, true));
} else if (auto treeHash = input.getTreeHash()) {
attrs.alloc("treeHash").mkString(treeHash->to_string(SRI, true));
} else
/* Must have either tree hash or NAR hash */
assert(false);

if (input.getType() == "git")
attrs.alloc("submodules").mkBool(
Expand All @@ -50,6 +55,11 @@ void emitTreeAttrs(
attrs.alloc("shortRev").mkString(emptyHash.gitShortRev());
}

if (auto treeHash = input.getTreeHash()) {
attrs.alloc("treeHash").mkString(treeHash->gitRev());
attrs.alloc("shortTreeHash").mkString(treeHash->gitRev());
}

if (auto revCount = input.getRevCount())
attrs.alloc("revCount").mkInt(*revCount);
else if (emptyRevFallback)
Expand Down Expand Up @@ -188,7 +198,7 @@ static void fetchTree(

auto [tree, input2] = input.fetch(state.store);

state.allowPath(tree.storePath);
state.allowPath(state.store->makeFixedOutputPathFromCA(tree.storePath));

emitTreeAttrs(state, tree, input2, v, params.emptyRevFallback, false);
}
Expand Down Expand Up @@ -250,12 +260,14 @@ static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v
if (evalSettings.pureEval && !expectedHash)
state.debugThrowLastTrace(EvalError("in pure evaluation mode, '%s' requires a 'sha256' argument", who));

// early exit if pinned and already in the store
if (expectedHash && expectedHash->type == htSHA256) {
// early exit if pinned and already in the store, or substituted successfully
if (expectedHash) {
auto method = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat;

auto expectedPath = state.store->makeFixedOutputPath(
name,
FixedOutputInfo {
.method = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat,
.method = method,
.hash = *expectedHash,
.references = {}
});
Expand All @@ -264,6 +276,15 @@ static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v
state.allowAndSetStorePathString(expectedPath, v);
return;
}

// try to substitute if we can

auto substitutableStorePath = fetchers::trySubstitute(state.store, method, *expectedHash, name);

if (substitutableStorePath) {
state.allowAndSetStorePathString(*substitutableStorePath, v);
return;
}
}

// TODO: fetching may fail, yet the path may be substitutable.
Expand All @@ -273,16 +294,18 @@ static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v
? fetchers::downloadTarball(state.store, *url, name, (bool) expectedHash).tree.storePath
: fetchers::downloadFile(state.store, *url, name, (bool) expectedHash).storePath;

auto actualStorePath = state.store->makeFixedOutputPathFromCA(storePath);

if (expectedHash) {
auto hash = unpack
? state.store->queryPathInfo(storePath)->narHash
: hashFile(htSHA256, state.store->toRealPath(storePath));
: hashFile(htSHA256, state.store->toRealPath(actualStorePath));
if (hash != *expectedHash)
state.debugThrowLastTrace(EvalError((unsigned int) 102, "hash mismatch in file downloaded from '%s':\n specified: %s\n got: %s",
*url, expectedHash->to_string(Base32, true), hash.to_string(Base32, true)));
}

state.allowAndSetStorePathString(storePath, v);
state.allowAndSetStorePathString(actualStorePath, v);
}

static void prim_fetchurl(EvalState & state, const PosIdx pos, Value * * args, Value & v)
Expand Down
12 changes: 7 additions & 5 deletions src/libfetchers/cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,19 @@ struct CacheImpl : Cache
ref<Store> store,
const Attrs & inAttrs,
const Attrs & infoAttrs,
const StorePath & storePath,
const StorePathDescriptor & storePathDesc,
bool locked) override
{
_state.lock()->add.use()
(attrsToJSON(inAttrs).dump())
(attrsToJSON(infoAttrs).dump())
(store->printStorePath(storePath))
// FIXME should use JSON for store path descriptor
(renderStorePathDescriptor(storePathDesc))
(locked)
(time(0)).exec();
}

std::optional<std::pair<Attrs, StorePath>> lookup(
std::optional<std::pair<Attrs, StorePathDescriptor>> lookup(
ref<Store> store,
const Attrs & inAttrs) override
{
Expand Down Expand Up @@ -90,9 +91,10 @@ struct CacheImpl : Cache
}

auto infoJSON = stmt.getStr(0);
auto storePath = store->parseStorePath(stmt.getStr(1));
auto storePathDesc = parseStorePathDescriptor(stmt.getStr(1));
auto locked = stmt.getInt(2) != 0;
auto timestamp = stmt.getInt(3);
auto storePath = store->makeFixedOutputPathFromCA(storePathDesc);

store->addTempRoot(storePath);
if (!store->isValidPath(storePath)) {
Expand All @@ -107,7 +109,7 @@ struct CacheImpl : Cache
return Result {
.expired = !locked && (settings.tarballTtl.get() == 0 || timestamp + settings.tarballTtl < time(0)),
.infoAttrs = jsonToAttrs(nlohmann::json::parse(infoJSON)),
.storePath = std::move(storePath)
.storePath = std::move(storePathDesc)
};
}
};
Expand Down
Loading
Loading