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

feat: more automated and universal cosmos app go builder #203

Open
dzmitry-lahoda opened this issue Jan 6, 2024 · 2 comments
Open

feat: more automated and universal cosmos app go builder #203

dzmitry-lahoda opened this issue Jan 6, 2024 · 2 comments

Comments

@dzmitry-lahoda
Copy link
Collaborator

dzmitry-lahoda commented Jan 6, 2024

#201 (comment)

copy paste out of comment:

pkgs.cosmos.lib.buildGoCosmosApp {   # GoCosmosApp because there are non Go already
  name = Required
  version = Optional evaluated from go.mod or set
  deps = Required vendroHash then build via buildGoModule else if gomod2nix file build via gomod2nix
  buildInputs + prefixup = Optional if not contains wasmd and go.sum contains wasmd and version of wasmd parsed make wasmd work; will work with EVM/SVM machines too (Evmos/Sei)
  goVersion = Optional : parsed from go.mod
  rev = Optional: if set  use it, if not set check src.rev, if not set and ser.rev empty trace warn non set 
  ..rest-args passed to underlying builder as is - so people canfixup and extend as needed (SOLID)
 }

here is parser for go.mod:

https://github.com/nix-community/gomod2nix/blob/master/builder/parser.nix

go.sum is regexable

@JonathanLorimer
Copy link
Collaborator

ultimate builder app.

love this idea

fully forgot to set any version things. so export of some well known attrs in lib could be useful to handle nix native chains. also was thinking about to read out version from go.mod.
so really app version and wasmd input/fixup could be automated from parsing (and in future any well known cpp lib). so l need to set them directly, along with consensus engine.

This is a great idea, I wonder if we should write a small rust lib to do the parsing. The nix parsing logic is a bit unwieldy. Hopefully we could use an external lib without IFD? I am going to make an issue about this.

(reposting here to move the conversation)

@dzmitry-lahoda
Copy link
Collaborator Author

allow-unsafe-native-code-during-evaluation nix can be even extended with functions

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

No branches or pull requests

2 participants