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

'make install' should go:embed stdlibs, examples folder, and other dynamic dependencies #1248

Open
moul opened this issue Oct 17, 2023 · 1 comment
Assignees

Comments

@moul
Copy link
Member

moul commented Oct 17, 2023

I propose that when running 'make install,' we should embed the standard libraries, examples folder, and other dynamic dependencies into the binary. This approach allows us to develop without worrying about the location of the cloned directory.

We have a few options to consider:

  1. Utilizing the $GNOROOT environment variable (feat: add 'gno env' subcommand #1233).
  2. Using gno mod download for standard libraries, although this approach can be error-prone during development.
  3. Embedding the source code with go:embed so that the file system is not required to retrieve configuration. This embedding should occur only when running 'make install,' while using 'go run ./...' would allow developers to skip embedding and work with the most up-to-date source.

Initially, I leaned towards option 1, but I recommend considering the third option. It encourages GNOROOT but doesn't make it mandatory.

cc @thehowl, as this relates to #814.

@moul moul moved this to 🌟 Wanted for Launch in 🚀 The Launch [DEPRECATED] Oct 17, 2023
@thehowl thehowl self-assigned this Oct 23, 2023
@thehowl
Copy link
Member

thehowl commented Oct 23, 2023

So, I've given this some thought. While I still believe that long-term, we want to encourage also all "proper" installations to have the stdlibs they use as inspectable files, I do agree that embedding the stdlibs directory will lead to the gno command not needing any configuration to set up, even without other OS configuration.

The standard libraries are a few megabytes. So, my proposed plan is this:

  • go:embed stdlibs
  • gno does not require a GNOROOT / root-dir anymore; gnoland does (for the examples directory)
  • If any of the current methods for finding GNOROOT work (flag, env var, go list), then we use that as a GNOROOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🌟 Wanted for Launch
Development

No branches or pull requests

3 participants