aboutsummaryrefslogtreecommitdiff
path: root/src/nix/path-info.cc
AgeCommit message (Collapse)Author
2020-07-30unsigned long long -> uint64_tEelco Dolstra
2020-07-15nix: Fix examplesEelco Dolstra
2020-06-18Merge branch 'validPathInfo-temp' into validPathInfo-ca-proper-datatypeJohn Ericson
2020-06-16Remove StorePath::clone() and related functionsEelco Dolstra
2020-06-02WIPJohn Ericson
2020-06-01WIP more progressJohn Ericson
2020-05-28Merge branch 'master' of github.com:NixOS/nix into enum-classCarlo Nucera
2020-05-05nix --help: Group commandsEelco Dolstra
2020-03-29Use `enum struct` and drop prefixesJohn Ericson
This does a few enums; the rest will be gotten in subsequent commits.
2020-03-24nix path-info --json: Print hash in SRI formatEelco Dolstra
(cherry picked from commit 442e665d6d3fcbdee7dece2f62a597142f8784b1)
2019-12-10Make the Store API more type-safeEelco Dolstra
Most functions now take a StorePath argument rather than a Path (which is just an alias for std::string). The StorePath constructor ensures that the path is syntactically correct (i.e. it looks like <store-dir>/<base32-hash>-<name>). Similarly, functions like buildPaths() now take a StorePathWithOutputs, rather than abusing Path by adding a '!<outputs>' suffix. Note that the StorePath type is implemented in Rust. This involves some hackery to allow Rust values to be used directly in C++, via a helper type whose destructor calls the Rust type's drop() function. The main issue is the dynamic nature of C++ move semantics: after we have moved a Rust value, we should not call the drop function on the original value. So when we move a value, we set the original value to bitwise zero, and the destructor only calls drop() if the value is not bitwise zero. This should be sufficient for most types. Also lots of minor cleanups to the C++ API to make it more modern (e.g. using std::optional and std::string_view in some places).
2019-12-05Make subcommand construction in MultiCommand lazyEelco Dolstra
(cherry picked from commit a0de58f471c9087d8e6cc60a6078f9940a125b15)
2018-09-01nix path-info: Remove trailing spacesEelco Dolstra
Fixes #2390.
2018-08-31Really fix the buildEelco Dolstra
2018-08-31nix path-info: Hopefully fix macOS build failureEelco Dolstra
https://hydra.nixos.org/build/80480356
2018-08-30printSize() fixesEelco Dolstra
Fix a 32-bit overflow that resulted in negative numbers being printed; use fmt() instead of boost::format(); change -H to -h for consistency with 'ls' and 'du'; make the columns narrower (since they can't be bigger than 1024.0).
2018-08-30Avoid overflow and use boost::formatBenjamin Hipple
If the user has an object greater than 1024 yottabytes, it'll just display it as N yottabytes instead of overflowing. Swaps to use boost::format strings instead of std::setw and std::setprecision.
2018-08-30Add human readable closure sizes to nix path-infoBenjamin Hipple
Unfortunately, -h is already taken as a short option by --help, so we have to use a different letter or the capitalized version. Resolves #2363
2017-11-14Don't indent JSON outputEelco Dolstra
2017-07-14nix path-info: Show download sizes for binary cache storesEelco Dolstra
E.g. $ nix path-info --json --store https://cache.nixos.org nixpkgs.thunderbird -S ... "downloadHash": "sha256:1jlixpzi225wwa0f4xdrwrqgi47ip1qpj9p06fyxxg07sfmyi4q0", "downloadSize": 43047620, "closureDownloadSize": 84745960 } ]
2017-07-14nix path-info: Don't barf on invalid pathsEelco Dolstra
Now you get [ { "path": "/nix/store/fzvliz4j5xzvnd0w5zgw2l0ksqh578yk-bla", "valid": false } ]
2017-04-25Restructure installables handling in the "nix" commandEelco Dolstra
2017-04-24Factor out --jsonEelco Dolstra
2017-01-26exportReferencesGraph: Export more complete info in JSON formatEelco Dolstra
This writes info about every path in the closure in the same format as ‘nix path-info --json’. Thus it also includes NAR hashes and sizes. Example: [ { "path": "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "narHash": "sha256:0ckdc4z20kkmpqdilx0wl6cricxv90lh85xpv2qljppcmz6vzcxl", "narSize": 197648, "references": [ "/nix/store/10h6li26i7g6z3mdpvra09yyf10mmzdr-hello-2.10", "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24" ], "closureSize": 20939776 }, { "path": "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24", "narHash": "sha256:1nfn3m3p98y1c0kd0brp80dn9n5mycwgrk183j17rajya0h7gax3", "narSize": 20742128, "references": [ "/nix/store/27binbdy296qvjycdgr1535v8872vz3z-glibc-2.24" ], "closureSize": 20742128 } ] Fixes #1134.
2016-09-14nix path-info: Add some more examplesEelco Dolstra
2016-08-30Fix 32-bit buildEelco Dolstra
2016-08-29nix path-info: Add --json flagEelco Dolstra
Also, factor out JSON generation from value-to-json.{cc,hh}, and support producing indented JSON.
2016-08-10Mark content-addressed paths in the Nix database and in .narinfoEelco Dolstra
This allows such paths to be imported without signatures.
2016-04-25Improved logging abstractionEelco Dolstra
This also gets rid of --log-type, since the nested log type isn't useful in a multi-threaded situation, and nobody cares about the "pretty" log type.
2016-04-22Fold "nix query-path-sigs" into "nix path-info"Eelco Dolstra
2016-04-21Implement S3BinaryCacheStore::queryAllValidPaths()Eelco Dolstra
This allows commands like "nix verify --all" or "nix path-info --all" to work on S3 caches. Unfortunately, this requires some ugly hackery: when querying the contents of the bucket, we don't want to have to read every .narinfo file. But the S3 bucket keys only include the hash part of each store path, not the name part. So as a special exception queryAllValidPaths() can now return store paths *without* the name part, and queryPathInfo() accepts such store paths (returning a ValidPathInfo object containing the full name).
2016-04-21nix path-info: AddEelco Dolstra
Forgot to commit this earlier...