You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, most WIT tooling expects a specific directory layout, typically rooted in a directory named wit/:
wit/*.wit: Mandatory "default" package wit/deps/*/*.wit: Optional "dependency" packages, which can be referenced by other packages
The only way to store multiple packages in the same place is to (often arbitrarily) partition them into one default package and all others as "deps". This is awkward for repositories that don't have exactly one natural default package, such as the WASI 0.2 repo (ref #1433).
I'm proposing two changes:
Relax this directory structure into basically one rule: any directory under a "WIT root" (including the root itself) that contains at least one .wit file will be parsed as a package.
Update tooling to accept multiple WIT root directories to resolve, still defaulting to ["wit/"] where appropriate.
These changes should be backward compatible with the existing layout and permit some new conventions, such as:
The WASI 0.2 repo doesn't have to change; if someone wants to consume it directly they can point at the entire preview2/ directory or individual preview2/* packages as WIT roots.
Projects with many dependencies can organize them by namespace, e.g. wit/wasi/{http,io}/*.wit, wit/my-namespace/[email protected]/*.wit
Registry tooling can use unambiguous paths with e.g. content-addressed files
The text was updated successfully, but these errors were encountered:
Zulip context: https://bytecodealliance.zulipchat.com/#narrow/stream/327223-wit-bindgen/topic/WIT.20directory.20structure
Currently, most WIT tooling expects a specific directory layout, typically rooted in a directory named
wit/
:wit/*.wit
: Mandatory "default" packagewit/deps/*/*.wit
: Optional "dependency" packages, which can be referenced by other packagesThe only way to store multiple packages in the same place is to (often arbitrarily) partition them into one default package and all others as "deps". This is awkward for repositories that don't have exactly one natural default package, such as the WASI 0.2 repo (ref #1433).
I'm proposing two changes:
.wit
file will be parsed as a package.["wit/"]
where appropriate.These changes should be backward compatible with the existing layout and permit some new conventions, such as:
preview2/
directory or individualpreview2/*
packages as WIT roots.wit/wasi/{http,io}/*.wit
,wit/my-namespace/[email protected]/*.wit
The text was updated successfully, but these errors were encountered: