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

Transitive dependencies ignored #32

Open
io12 opened this issue Oct 24, 2023 · 1 comment
Open

Transitive dependencies ignored #32

io12 opened this issue Oct 24, 2023 · 1 comment

Comments

@io12
Copy link

io12 commented Oct 24, 2023

With nix-shell, all the transitive dependencies have their shell hooks run. However, with nix-buffer, only top-level dependencies affect the Emacs buffer.

For example,

NIXPKGS_ALLOW_UNFREE=1 nix-shell -p coqPackages_8_16.coq coqPackages_8_16.compcert coqPackages_8_16.HoTT --run env | grep COQPATH

outputs

COQPATH=/nix/store/y46y9afvp5knxf40jyv3np8jj1sq5r2f-coq8.16-flocq-4.1.3/lib/coq/8.16/user-contrib/:/nix/store/3lgd8ca1zsbnbdxicl714fdr8h0f70zl-coq8.16-compcert-3.13-lib/lib/coq/8.16/user-contrib/:/nix/store/rw8n88pnq598daicg8k0wwc42fv8jga0-coq8.16-HoTT-8.16/lib/coq/8.16/user-contrib/

but with this dir-locals.nix

let pkgs = import <nixpkgs> { config.allowUnfree = true; };
in pkgs.nixBufferBuilders.withPackages
(with pkgs.coqPackages_8_16; [ coq compcert HoTT ])

running (nix-buffer), waiting for the derivation to compile, and then (getenv "COQPATH") gives
:/nix/store/rw8n88pnq598daicg8k0wwc42fv8jga0-coq8.16-HoTT-8.16/lib/coq/8.16/user-contrib.

This happens because compcert.lib is a dependency of compcert.out, but isn't directly in the list passed to withPackages.

I realize that this issue is with the upstream nixBufferBuilders code in nixpkgs, but I feel like it might be easier for a fix to be upstreamed if I post the issue here instead of on the nixpkgs issue tracker.

@shlevy
Copy link
Owner

shlevy commented Oct 27, 2023

I agree this is an issue and have some rough thoughts on how to address it, but unfortunately nix-buffer is not a priority at this time. I would welcome any contributions and will be happy to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants