-
Notifications
You must be signed in to change notification settings - Fork 399
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(gnovm): packages loader #2932
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
…ve download to own file Signed-off-by: Norman Meier <norman@samourai.coop>
Signed-off-by: Norman Meier <norman@samourai.coop>
examples/gno.land/gno.mod
Outdated
@@ -0,0 +1 @@ | |||
module gno.land |
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.
do we need this file?
if we need it, please explain in a comment.
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.
please see #2904 (comment) and tell me what you think
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.
I think the best would be to have a gno.work
file at repo root to support multiple modules in a monorepo
But in that case we need to implement the gno work
commands
gnovm/tests/machine_test.go
Outdated
@@ -40,7 +40,7 @@ func TestMachineTestMemPackage(t *testing.T) { | |||
Name: tt.name, | |||
F: func(t2 *testing.T) { //nolint:thelper | |||
rootDir := filepath.Join("..", "..") | |||
store := TestStore(rootDir, "test", os.Stdin, os.Stdout, os.Stderr, ImportModeStdlibsOnly) | |||
store := TestStore(rootDir, "test", nil, os.Stdin, os.Stdout, os.Stderr, ImportModeStdlibsOnly) |
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.
create a variable that you set to nil, so we now what is this parameter.
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.
done in 0123512
gnovm/pkg/packages/download.go
Outdated
func DownloadModule(pkgPath string, dst string) error { | ||
modFilePath := filepath.Join(dst, ModfileName) | ||
if _, err := os.Stat(modFilePath); os.IsNotExist(err) { | ||
fmt.Fprintln(os.Stderr, "gno: downloading", pkgPath) |
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.
we usually don't use os.StdXXX, but stdouterr from a struct (io something) which is passed when needed.
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.
done in e648305
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
5090ff2
to
31b92be
Compare
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
featuring: - [X] **Lazy reload**: Super fast reload, only loading the needed packages for the current directory package. - [x] **Chain resolver**: You can change the gnodev resolving process so it can resolve packages on-chain and configure a local fallback, allowing you to try your package against the chain before submitting it. - This will probably be updated when #2932 & #3123 will be merged - [x] **Staging Mode**: `gnodev` now starts from the current directory by default. The staging subcommand will reproduce previous behaviors by loading and monitoring the entire example folder. <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests </details> --------- Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com> Co-authored-by: Morgan <git@howl.moe> Co-authored-by: Morgan <morgan@morganbaz.com>
notes from morgan from call
|
WIP
Continuation of #2201
Taking #2904 into account
This implements a
Load
function with a similar interface to thepackages.Load
go functionContributors' checklist...
BREAKING CHANGE: xxx
message was included in the description