-
Notifications
You must be signed in to change notification settings - Fork 15
@since gates should not transitively apply across package boundaries when worlds are included #325
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
Labels
bug
Something isn't working
Comments
The following WIT demonstrates the issue: package issues:issue325;
world w {
@unstable(feature = active)
include issues:dep1/w@0.1.0;
include issues:unstable/w@0.1.0;
}
package issues:unstable@0.1.0 {
world w {
@unstable(feature = active)
use issues:dep2/[email protected].{r};
}
}
package issues:dep1@0.1.0 {
world w {
include issues:dep2/[email protected];
}
}
package issues:dep2@0.2.0 {
world w {
@since(version = 0.2.0)
import i;
}
interface i {
resource r;
}
} Result when processed through a version of package issues:issue325;
world w {
import issues:dep2/i@0.2.0;
@unstable(feature = active)
use issues:dep2/i@0.2.0.{r};
}
package issues:dep1@0.1.0 {
world w {
import issues:dep2/[email protected];
}
}
package issues:unstable@0.1.0 {
world w {
@unstable(feature = active)
import issues:dep2/[email protected];
@unstable(feature = active)
use issues:dep2/[email protected].{r};
}
}
package issues:dep2@0.2.0 {
interface i {
resource r;
}
world w {
@since(version = 0.2.0)
import i;
}
} When the above is processed through package issues:issue325;
world w {
@unstable(feature = active)
import issues:dep2/i@0.2.0;
@unstable(feature = active)
use issues:dep2/i@0.2.0.{r};
}
package issues:dep1@0.1.0 {
world w {
import issues:dep2/[email protected];
}
}
package issues:unstable@0.1.0 {
world w {
@unstable(feature = active)
import issues:dep2/[email protected];
@unstable(feature = active)
use issues:dep2/[email protected].{r};
}
}
package issues:dep2@0.2.0 {
interface i {
resource r;
}
world w {
@since(version = 0.2.0)
import i;
}
} |
ydnar
added a commit
that referenced
this issue
Mar 23, 2025
…rom different packages Attemped to correct #325.
ydnar
added a commit
that referenced
this issue
Mar 23, 2025
I wrote up some more thoughts here but tl;dr; I think this is a bug in wasm-tools to fix. |
ydnar
added a commit
that referenced
this issue
Apr 18, 2025
…rom different packages Attemped to correct #325.
ydnar
added a commit
that referenced
this issue
Apr 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extending from #306, WIT version gates cannot be correctly represented in the fully-resolved representation of a component, e.g. in JSON.
The problem arises when a
world
in package A includes aworld
from package B, which imports or exports aninterface
with a version gate, e.g.@since(version = 0.2.0)
. The fully-resolved version of the component as emitted fromwasm-tools
will include the package B version gate in the world inside package A.Testdata
wit-bindgen-go
uses[email protected]
internally to parse the WIT, produce aResolve
, and serialize to JSON, which is then loaded and then re-serialized into WIT.The existing test corpus in this repo performs a WIT → JSON → WIT round trip verification for every JSON file in
testdata
. This is currently breaking for 2 files (issues/issue325.wit
andwit-parser/gated-include-use-with-stable.wit
). See #326 for more information.Links:
cc @alexcrichton @Mossaka
The text was updated successfully, but these errors were encountered: