简体   繁体   中英

'No such file or directory' error when using buildGoPackage in nix

I'm trying to build the hasura cli: https://github.com/hasura/graphql-engine/tree/master/cli with the following code (deps derived from dep2nix):

{ buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  version = "1.0.0-beta.2";
  name = "hasura-${version}";

  goPackagePath = "github.com/hasura/graphql-engine";
  subPackages = [ "cli" ];

  src = fetchFromGitHub {
    owner = "hasura";
    repo = "graphql-engine";
    rev = "v${version}";
    sha256 = "1b40s41idkp1nyb9ygxgsvrwv8rsll6dnwrifpn25bvnfk8idafr";
  };

  goDeps = ./deps.nix; 
}

but I get the following errors after the post-installation fixup step: find: '/nix/store/gkck68cm2z9k1qxgmh350pq3kwsbyn8q-hasura-cli-1.0.0-beta.2': No such file or directory .

What am I doing wrong here? For reference, I'm on macOS and using home-manager.

For anyone still wondering:

There are a couple of things to consider:

  1. dep has been deprecated in favor of go modules
  2. This is also reflected in Nix, as buildGoPackage is now legacy and moved to buildGoModule
  3. There is already a hasura-cli package in nixpkgs. You can just use it with nix-shell -p hasura-cli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM