Nixpkgs: Can't compile go project with cgo

Created on 22 Dec 2018  路  7Comments  路  Source: NixOS/nixpkgs

Issue description

go get runtime/cgo: open /nix/store/yh6p6ky7w2nfa64r3r7vhr5d5s1p87bk-go-1.11.2/share/go/pkg/linux_amd64/runtime/cgo.a: read-only file system

Steps to reproduce

Install Go
Attempt to compile project that requires cgo. (Not with nix. just regularly)

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.18.0, NixOS, 19.03pre162671.44b02b52ea6 (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • channels(root): "nixos-19.03pre162671.44b02b52ea6, nixpkgs-19.03pre155263.20c4986c4dd"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
stale

Most helpful comment

It seems that there is not much we can do about that but stop using -i in go, which is not useful anymore anyway: https://github.com/golang/go/issues/24674#issuecomment-379919460

All 7 comments

CC @cstrahan @orivej @velovix @Mic92

I don't know the scope of the issue (I don't remember having encountered it) and whether we can/should fix it, but you can probably work around it by running go build or go install with -pkgdir /tmp (or any other writable directory).

The same file already exists, so I don' know why tries to recompile it. Usually this happens when build systems are injecting -i into go builds.

$ go list -f '{{.Stale}}' runtime/cgo
true
$ go list -f '{{.StaleReason}}' runtime/cgo
not installed but available in build cache

It seems that there is not much we can do about that but stop using -i in go, which is not useful anymore anyway: https://github.com/golang/go/issues/24674#issuecomment-379919460

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

grahamc picture grahamc  路  3Comments

spacekitteh picture spacekitteh  路  3Comments

rzetterberg picture rzetterberg  路  3Comments

yawnt picture yawnt  路  3Comments

ob7 picture ob7  路  3Comments