-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: add --print-all-depedencies
to nixci build
subcommand
#60
Conversation
Uses `nix-store --query --requisites --include-outputs <drv-path>` to print all the build and runtime dependencies of a given derivation path
ba48c5a
to
c5bf7d3
Compare
@srid I am not sure how to add integration-test for |
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.
Can you move the struct from juspay/nix-rs#6 to nix_store.rs
? Let's give nix_store.rs
some time before it can be upstreamed to nix-rs
.
I am not sure how to add integration-test for
—print-all-dependencies
because there will system specific dependencies. To add to that, even the most basic packages like gnutar or gnused have about 700 dependencies on macOS.
Perhaps you can pick some stable transitive dependency and check for its inclusion? Rather than compare the whole list.
as there's no state in the struct anyway
src/nix/nix_store.rs
Outdated
async fn nix_store_query_deriver(&self, out_path: PathBuf) -> Result<PathBuf> { | ||
let mut cmd = self.command(); | ||
cmd.args(["--query", "--deriver", &out_path.to_string_lossy().as_ref()]); |
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.
Note: this command can fail silently with unknown-deriver
:
❯ nix-store --query --deriver /nix/store/50rs0cwcp2878l3hvymwnq6v7cyyw1l3-haskell-template
/nix/store/myd60l138syblrhwckpwxh259cn2s6ms-haskell-template.drv
srid on appreciate.intern nixci on print-all-deps [!] is 📦 v0.4.0 via 🦀 v1.74.0 via ❄️ impure (nixci-env)
❯ nix-store --query --deriver /nix/store/myd60l138syblrhwckpwxh259cn2s6ms-haskell-template.drv
unknown-deriver
srid on appreciate.intern nixci on print-all-deps [!] is 📦 v0.4.0 via 🦀 v1.74.0 via ❄️ impure (nixci-env)
❯ echo $?
0
the former is library module, that the later and the like are supposed to use
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.
Great, thanks!
I refactored a few things; check the commit log.
I might have to refactor some surrounding code (unchanged in this PR) as well; but will do that in another commit/PR.
resolves #59
Uses
nix-store --query --requisites --include-outputs <drv-path>
to print all the build and runtime dependencies of a given derivation path.Try it out: