Skip to content

Transitive dependencies ignored #32

@io12

Description

@io12

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions