-
Notifications
You must be signed in to change notification settings - Fork 1
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
go: Initial commit #9
Conversation
go/.flox/env/manifest.toml
Outdated
[hook] | ||
on-activate = ''' | ||
# Point GOENV to Flox environment cache | ||
export GOENV="$FLOX_ENV_CACHE/goenv" | ||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From @stealthybox:
also not sure if we should be using the Flox env project cache -- usually Go is pretty good about the global cache for deps/builds/source, but maybe a more pure build could benefit
I'm also not sure about this. Would have to look up the history and confidence-level that we originally added it to the setup hook. We could omit it for now if we're unsure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to include glibc
for Linux too so that we don't compile CGO against system libs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's punt on this for the moment. We can revisit later.
Common packages for working on Go projects. I frequently use this from my editor with: - https://github.com/flox/flox-direnv And the following in `.envrc`: use flox --remote floxenvs/go In future the editor dependencies could be broken out to a separate `go-editor` or `go-lsp` environment. The `GOENV` hook is copied from our `init --auto-setup` hook with the exception of: 1. Path is modified from `goenv` to `go` to match the other example environments in this repo 2. `go get .` is omitted because it's surprising to fetch dependencies when activating an environment and we have plans to remove it from the default manifest. The example module which includes a third-party module to prove that dependency fetching still works is taken from: - https://go.dev/blog/using-go-modules The minimum Go version is currently pinned, both in the `manifest.toml` and `go.mod`, at the latest stable major and minor version. It should continue to work after a `flox upgrade` assuming that there are no breaking changes.
@garbas I've rebased in the changes that we paired on. |
Common packages for working on Go projects.
I frequently use this from my editor with:
And the following in
.envrc
:In future the editor dependencies could be broken out to a separate
go-editor
orgo-lsp
environment.The
GOENV
hook is copied from ourinit --auto-setup
hook with theexception of:
goenv
togo
to match the other exampleenvironments in this repo
go get .
is omitted because it's surprising to fetch dependencieswhen activating an environment and we have plans to remove it from
the default manifest.
The example module which includes a third-party module to prove that
dependency fetching still works is taken from:
The minimum Go version is currently pinned, both in the
manifest.toml
and
go.mod
, at the latest stable major and minor version. It shouldcontinue to work after a
flox upgrade
assuming that there are nobreaking changes.