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

panic: package ./. already exists in cache #638

Closed
grepsuzette opened this issue Mar 23, 2023 · 4 comments · Fixed by #1330
Closed

panic: package ./. already exists in cache #638

grepsuzette opened this issue Mar 23, 2023 · 4 comments · Fixed by #1330
Assignees

Comments

@grepsuzette
Copy link
Contributor

grepsuzette commented Mar 23, 2023

Occasionnaly I got panic: package ./. already exists in cache.
The first time I think I just resetted the blockchain (Edit: no lol, it happens during gnodev test).
Are there any special tips to know about that?

@grepsuzette
Copy link
Contributor Author

grepsuzette commented Mar 23, 2023

For who searches the same problem,
it seems to be because my _test file was in a different package.
The error disappears when it's in the same package.

@ltzmaxwell
Copy link
Contributor

hi , can you give more details to reproduce this?

@r3v4s
Copy link
Contributor

r3v4s commented Mar 24, 2023

I don't remember exact message string but shouldn't gnodev return "package name wrong~~" if _test file is in different package??

As @ltzmaxwell mentioned, could you provide more detail info to reproduce

@grepsuzette
Copy link
Contributor Author

grepsuzette commented Mar 24, 2023

I can not for now. In general there are many hard to understand errors returned by the VM when you write invalid code. Occasionnaly bugs.
I saw jae fixed a lot in his workshop PR.

Valid code seems to work well however.
I just opened this bug because it was the 2nd time I faced it, but the fix was as indicated in the reply.
I'll close this and reopen if it happens again. Thanks for your replies.

albttx added a commit to albttx/gno that referenced this issue Nov 2, 2023
@albttx albttx reopened this Nov 2, 2023
albttx added a commit to albttx/gno that referenced this issue Nov 6, 2023
albttx added a commit to albttx/gno that referenced this issue Nov 6, 2023
albttx added a commit to albttx/gno that referenced this issue Nov 6, 2023
thehowl added a commit that referenced this issue Nov 23, 2023
…ackage x_test` (#1330)

Reproduce error from #638 package ./. already exists in cache

EDIT: And fixed it 🎉

```
$ go run ./gnovm/cmd/gno test --verbose ./examples/gno.land/p/demo/lol
panic: package gno.land/p/demo/lol already exists in cache

goroutine 1 [running]:
github.com/gnolang/gno/gnovm/pkg/gnolang.(*defaultStore).SetCachePackage(0x1400020a240, 0x14005f23e00)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/pkg/gnolang/store.go:207 +0x10c
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).RunMemPackage(0x14006aba6c0, 0x1400038ff80, 0x1)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/pkg/gnolang/machine.go:225 +0x190
main.gnoTestPkg({0x16fa42ab0, 0x1e}, {0x1400025f4a0?, 0x1, 0x100a8567c?}, {0x0, 0x0, 0x101374df8?}, 0x1400038e640, 0x14000306820)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/test.go:354 +0x3f8
main.execTest(0x1400038e640, {0x1400025f3b0, 0x1, 0x1}, 0x0?)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/test.go:255 +0x804
main.newTestCmd.func1({0x0?, 0x0?}, {0x1400025f3b0?, 0x14000696e58?, 0x0?})
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/test.go:97 +0x38
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0x0?, {0x100e55608?, 0x14000190010?})
	/Users/albttx/go/src/github.com/gnolang/gno/tm2/pkg/commands/command.go:233 +0x17c
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0x14000696b00?, {0x100e55608?, 0x14000190010?})
	/Users/albttx/go/src/github.com/gnolang/gno/tm2/pkg/commands/command.go:237 +0x12c
github.com/gnolang/gno/tm2/pkg/commands.(*Command).ParseAndRun(0x14000180000?, {0x100e55608, 0x14000190010}, {0x140001a6050?, 0x60?, 0x0?})
	/Users/albttx/go/src/github.com/gnolang/gno/tm2/pkg/commands/command.go:118 +0x4c
main.main()
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/main.go:14 +0x74
exit status 2
```

<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
- [ ] 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>

---------

Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Morgan Bazalgette <morgan@morganbaz.com>
gfanton pushed a commit to moul/gno that referenced this issue Jan 18, 2024
…ackage x_test` (gnolang#1330)

Reproduce error from gnolang#638 package ./. already exists in cache

EDIT: And fixed it 🎉

```
$ go run ./gnovm/cmd/gno test --verbose ./examples/gno.land/p/demo/lol
panic: package gno.land/p/demo/lol already exists in cache

goroutine 1 [running]:
github.com/gnolang/gno/gnovm/pkg/gnolang.(*defaultStore).SetCachePackage(0x1400020a240, 0x14005f23e00)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/pkg/gnolang/store.go:207 +0x10c
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).RunMemPackage(0x14006aba6c0, 0x1400038ff80, 0x1)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/pkg/gnolang/machine.go:225 +0x190
main.gnoTestPkg({0x16fa42ab0, 0x1e}, {0x1400025f4a0?, 0x1, 0x100a8567c?}, {0x0, 0x0, 0x101374df8?}, 0x1400038e640, 0x14000306820)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/test.go:354 +0x3f8
main.execTest(0x1400038e640, {0x1400025f3b0, 0x1, 0x1}, 0x0?)
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/test.go:255 +0x804
main.newTestCmd.func1({0x0?, 0x0?}, {0x1400025f3b0?, 0x14000696e58?, 0x0?})
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/test.go:97 +0x38
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0x0?, {0x100e55608?, 0x14000190010?})
	/Users/albttx/go/src/github.com/gnolang/gno/tm2/pkg/commands/command.go:233 +0x17c
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0x14000696b00?, {0x100e55608?, 0x14000190010?})
	/Users/albttx/go/src/github.com/gnolang/gno/tm2/pkg/commands/command.go:237 +0x12c
github.com/gnolang/gno/tm2/pkg/commands.(*Command).ParseAndRun(0x14000180000?, {0x100e55608, 0x14000190010}, {0x140001a6050?, 0x60?, 0x0?})
	/Users/albttx/go/src/github.com/gnolang/gno/tm2/pkg/commands/command.go:118 +0x4c
main.main()
	/Users/albttx/go/src/github.com/gnolang/gno/gnovm/cmd/gno/main.go:14 +0x74
exit status 2
```

<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
- [ ] 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>

---------

Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Morgan Bazalgette <morgan@morganbaz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

4 participants