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

fix: block subdirectories on realm packages #2155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Villaquiranm
Copy link
Contributor

@Villaquiranm Villaquiranm commented May 20, 2024

closes #1041

Contributors' checklist...
  • 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, if any. More info here.

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label May 20, 2024
if isRealm && file.IsDir() {
// currently realm packages does not support subpackages https://github.com/gnolang/gno/issues/1041
panic("not supported yet")
}
if file.IsDir() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at this check, we are already ignoring subdirectories.

I don't think panicking is a good idea.

There are many reasons why I want to have subdirectories in realms:

  • Nested Independent Realms:

    Imagine I have two realms: examples/gno.land/p/demo/foo and examples/gno.land/p/demo/foo/bar.
    Right now, I can publish both realms in two transactions. However, with these changes, I won't be able to publish foo since it contains bar.

  • Local Directories:

    Imagine I have directories like /tests or /docs that I don't want to publish but want to keep locally. I need to remove them to be able to publish realm.

Copy link
Contributor Author

@Villaquiranm Villaquiranm May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @harry-hov thanks for your review 👍

I don't think panicking is a good idea.

I think that is just what the issue ask us to do (maybe it not relevant anymore ?)

There are many reasons why I want to have subdirectories in realms:

Nested Independent Realms:

Imagine I have two realms: examples/gno.land/p/demo/foo and examples/gno.land/p/demo/foo/bar.
Right now, I can publish both realms in two transactions. However, with these changes, I won't be able to publish foo since it contains bar.

This should apply only for r Realms not for p Realms so you will be able to keep using the subdirectory on examples/gno.land/p/demo/foo and examples/gno.land/p/demo/foo/bar

Local Directories:

Imagine I have directories like /tests or /docs that I don't want to publish but want to keep locally. I need to remove them to be able to publish realm.

I think you have a really good point here, maybe we will need to only block the subdirectories that contains any of *.gno, gno.mod files ?

Copy link
Contributor

@Kouteki Kouteki Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moul @zivkovicmilos WDYT about the panic comment? The initial issue has panic in the scope.

Copy link

This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months.

@github-actions github-actions bot added the Stale label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Functionality that contains breaking changes 📦 🤖 gnovm Issues or PRs gnovm related Stale
Projects
Status: In Progress
Status: In Review
Development

Successfully merging this pull request may close these issues.

Panic when addpkg a Realm with subpaths
3 participants