-
Notifications
You must be signed in to change notification settings - Fork 374
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
fix(mempkg): don't attempt to validate name of an empty package #1076
Conversation
…no files) Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
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.
Looks good 💯
Left a few minor comments
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
e95076a
to
ac71814
Compare
modify realm/package validate regexp to support stdlibs package that doesn't have a domain part Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
This reverts commit 6ce9a3e. Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
The panic is expected behavior. We do not want to change it. for foo/bar, only one package node created. pn.Name = bar pn.PkgPath = gnoland/xxx/foo/bar. Try to inject native method at foo should should panic in stdlibs/stdlib.go ( for on chain ) and tests/import.go ( for off chain testing). The native method can only be injected in a valid PackageNode. Plus: No need to check memPkg.IsEmpty(), this method is not needed. Check the reason below |
Added the `net/url` package. This package will be beneficial for manipulating URLs, for instance, parsing query parameters or for URL muxing in realms. depends: - [x] #1076 - [x] #1065 <details><summary>Contributors' checklist...</summary> - [X] 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 - [X] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [X] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> --------- Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Added the `net/url` package. This package will be beneficial for manipulating URLs, for instance, parsing query parameters or for URL muxing in realms. depends: - [x] gnolang#1076 - [x] gnolang#1065 <details><summary>Contributors' checklist...</summary> - [X] 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 - [X] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [X] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details> --------- Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
This PR adjusts the behavior of
ReadMemPackage
. It now skips the package name validation when no gno files are found in the package directory. This modification allows for the utilization of empty parent packages that have a native fallback. For instance, in thefoo/bar
scenario, wherefoo
is an empty package but has a native implementation defined inimports.go
, andbar
is a standard package containing gno files. Previously, this would have triggered a panic onfoo
import due to the empty package name rather than appropriately using the nativefoo
fallback.While I haven't been able to introduce tests for this change, PR #1066, which incorporates the
net/url
package, would fail in the absence of this modification due to emptynet
dependencies.Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description