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

Problem: gomod2nix don't call correct version of golang #91

Open
yihuang opened this issue Sep 2, 2022 · 3 comments · May be fixed by #92
Open

Problem: gomod2nix don't call correct version of golang #91

yihuang opened this issue Sep 2, 2022 · 3 comments · May be fixed by #92

Comments

@yihuang
Copy link
Contributor

yihuang commented Sep 2, 2022

The gomod2nix executable included in the overlay is a wrapper script that always uses the prepackaged go 1.17, which causes a problem in go 1.18 projects.

yihuang added a commit to yihuang/gomod2nix that referenced this issue Sep 2, 2022
Closes: nix-community#91
`updateScript` will use the same golang version to update the project.
@yihuang yihuang linked a pull request Sep 2, 2022 that will close this issue
@paleboot
Copy link

Hi folks, sorry for chiming in.

Had an issue where using shell.nix from the Getting Started document will always result in the following error:

error: go_1_12 has been removed

I also can't seem to "force" it to get Go 1.18 with the following snippet:

{ pkgs ? (
    let
      sources = import ./nix/sources.nix;
    in
    import sources.nixpkgs {
      overlays = [
        (import "${sources.gomod2nix}/overlay.nix")
      ];
    }
  )
}:

pkgs.mkShell {
  packages = [
    pkgs.go_1_18
    pkgs.gomod2nix
    pkgs.niv
  ];
}

Which spews the following error:

error: attribute 'go_1_18' missing
       stack trace...
       Did you mean one of go_1_12, go_1_14, go_1_15, go_1_16 or go_1_17?

On the other hand, changing to pkgs.go will result in the following error:

error: Package ‘ghc-8.10.4’ in /nix/store/hbf592lmpyigxr29563ywlc072kgxpzg-nixpkgs-src/pkgs/development/compilers/ghc/8.10.4.nix:263 is not supported on ‘aarch64-darwin’, refusing to evaluate.

Meanwhile, that issue should've been resolved a year ago, as I can run nix-env -iA nixpkgs.shellcheck just fine (it was the problem in that thread).

Was wondering if this is the same issue?

@yihuang
Copy link
Contributor Author

yihuang commented Oct 20, 2022

the haskell dependency is brought in by niv, suggest to use a version of nixpkgs that has binary cache.

@yihuang
Copy link
Contributor Author

yihuang commented Oct 20, 2022

attribute 'go_1_18' missing, sounds like nixpkgs too old, can try 22.05 release, or even master branch.

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

Successfully merging a pull request may close this issue.

2 participants