Skip to content

Make Go packages work with nix-shell#15490

Closed
chris-martin wants to merge 1 commit intoNixOS:masterfrom
chris-martin:go-shell-hook
Closed

Make Go packages work with nix-shell#15490
chris-martin wants to merge 1 commit intoNixOS:masterfrom
chris-martin:go-shell-hook

Conversation

@chris-martin
Copy link
Contributor

Go projects currently don't work with nix-shell because the source for the project never gets added to $GOPATH. This adds a shell hook to do that.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @wkennington, @ehmry and @lethalman to be potential reviewers

@chris-martin
Copy link
Contributor Author

The source has to be in a particular directory hierarchy to satisfy Go. I'm constructing that hierarchy under a temporary directory. I'm not sure if there's a better way to do it - should it going into /nix/store somehow instead?

@joachifm joachifm added the 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. label May 16, 2016
@chris-martin chris-martin changed the title buildGoPackage: shellHook linking $src into $GOPATH Make Go packages work with nix-shell May 16, 2016
@chris-martin
Copy link
Contributor Author

@garbas points out to me that this is very similar to the shell hook we use for Python.

@lucabrunox
Copy link
Contributor

is this still working after the go packaging rework done recently?

@chris-martin
Copy link
Contributor Author

I think that refactor obviates this PR, but I'm not sure how to test it. Where did go-packages.nix go?

@kamilchm
Copy link
Member

This works for my local packages #16297

@chris-martin
Copy link
Contributor Author

Closing because #16297 seems to be the way to go

@chris-martin chris-martin deleted the go-shell-hook branch December 31, 2016 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants