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

niv tries to unpack local dependency #337

Open
yaitskov opened this issue Nov 6, 2021 · 3 comments
Open

niv tries to unpack local dependency #337

yaitskov opened this issue Nov 6, 2021 · 3 comments
Labels
question Further information is requested

Comments

@yaitskov
Copy link

yaitskov commented Nov 6, 2021

Hi,
niv revision "e0ca65c81a2d7a4d82a189f1e23a48d59ad42070"

sources.json:

    "prune-juice": {
        "type": "local",
        "path": "/home/dan/pro/prune-juice"
    },

Error

unpacking source archive /home/dan/pro/prune-juice
do not know how to unpack source archive /home/dan/pro/prune-juice
builder for '/nix/store/bvhjyi9p3hxi87zjl7f6xbr1xjy7yc8q-prune-juice-0.6.drv' failed with exit code 1
git clone git@github.com:dfithian/prune-juice.git

It was working before.

@refnil
Copy link
Collaborator

refnil commented Nov 6, 2021

Hi @yaitskov ,

I made a small demo that use a local source just fine without unpacking. In fact, I don't think niv is ever unpacking any sources. I would recommend checking how you are using this prune-juice source. You could share it here so I can take a look.

{ sources ? import ./nix/sources.nix
, nixpkgs ? import sources.nixpkgs {}
, juice ? sources.juice
}:
{
  test-command = nixpkgs.writeScriptBin "test-niv" ''
    #! ${nixpkgs.bash}/bin/bash
    echo '${juice}'
  '';
}

@refnil refnil added the question Further information is requested label Nov 6, 2021
@yaitskov
Copy link
Author

yaitskov commented Nov 6, 2021

How to run the snippet above?

nix-shell pj.nix

I think it is worth to mention nixpkgs repo version. I took master because I need HLS 1.4

    "nixpkgs": {
        "branch": "master",
        "description": "Nix Packages collection",
        "homepage": "",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "4217614266efccf9c5f8817532fbcbdbf31001e2",
        "sha256": "0xiiprzxm72xw0jrgr1fgz0lxkhhl0n6gk08wv2hn8l0ms5w2yl7",
        "type": "tarball",
        "url": "https://github.com/NixOS/nixpkgs/archive/4217614266efccf9c5f8817532fbcbdbf31001e2.tar.gz",
        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
    },

I suspect the issue is caused by changes in nixpkgs itself.

@refnil
Copy link
Collaborator

refnil commented Nov 8, 2021

How to run the snippet above?

First, you should copy the script in the same folder containing the nix folder with sources.json and sources.nix.
Then, you could change sources.juice in the script by sources.prune-juice to use the problematic source.
To run it, you could do run it with

nix-shell -p "(import ./test.nix {}).test_command" --run test_niv

or

nix-build test.nix && result/bin/test_niv

Note that my file is named test.nix while yours is pj.nix (I think).

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

No branches or pull requests

2 participants