-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 downstream cargo vendor
usage for component adapter crate
#6486
Conversation
c0fc3e0
to
c1a4310
Compare
Temporary, until bytecodealliance/wasmtime#6486 is merged Signed-off-by: Roman Volosatovs <[email protected]>
cargo vendor
Temporary, until bytecodealliance/wasmtime#6486 is merged Signed-off-by: Roman Volosatovs <[email protected]>
Thanks, I'll look at this in detail this afternoon. To answer the first design question, yes lets please use the wit-deps binary in CI just like we did in p2-p. Please make a shell script inside It would also be nice if the shell script had (e.g. |
Temporary, until bytecodealliance/wasmtime#6486 is merged Signed-off-by: Roman Volosatovs <[email protected]>
Theoretically the "verify-publish" step in CI should be checking this by running Do you have an example crate/coment with |
The diff here looks good. Roman and I had a discussion on zulip for how to add the CI check for this. The component-adapter and test-programs crates would not have worked with cargo-vendor before this PR. I don't know which of those was a problem for vendoring into wasmcloud, but both of those are excluded from our verify-publish step. |
For the record, we're vendoring the component adapter as a bindep https://github.com/wasmCloud/wasmCloud/tree/8544ef854e1695381def129c68c341a5fd9940e3/tests/wasi-adapter, if you're interested, that's how it's built: https://github.com/wasmCloud/wasmCloud/blob/8544ef854e1695381def129c68c341a5fd9940e3/tests/actors/build.rs#L116-L134 along with other Wasm as part of tests (so just The trick is that our reproducible build process happens in a sandbox with no access to non-deterministic I/O, e.g. no networking without the matching content hash specified. It looks something like this:
|
c1a4310
to
8ade12b
Compare
d6d6b1c
to
b22c571
Compare
I think it would simplify things for Wasmtime quite a bit if there could only be one set of WIT files managed here, rather than three. A large risk with multiple sets of WIT files that are all duplicates is that they can get out of sync, and there's no protection against that right now. In theory they should all be the exact same and ideally use something like symlinks but that doesn't all work out for windows/vendoring reasons. Would it be possible to update your vendoring process of the component adapter to manually copy around the WIT files or similarly? Or alternatively could the vendored artifact be the Wasmtime repository since that's what the component adapter expects to be built within the context of? Also, as an orthogonal point, right now |
There's only one set of WIT files managed "from external sources" - in
That's exactly how it works in this PR, e.g. https://github.com/rvolosatovs/wasmtime/blob/b22c571b911c1bbdd2d9356d72de18606d3e08ce/crates/test-programs/reactor-tests/wit/deps.toml#L1 this just means copy all WIT definitions from this path along with all transitive dependencies
That's not the case,
Update:
Update 2: Update 3: |
Ah ok this PR has changed radically since I last looked at it, I apologize for not bringing myself back up to speed before leaving a comment. I'll also admit that I have yet to investigate, learn, and understand
Orthogonally from my above comments, why are Additionally the world |
How is this any different from
That's not true, for any given gzipped tarball URL X: Soon it should not have to use Note, that this tool was built originally as a temporary solution to address unmaintainable mess of copy-pasting WIT files around from external sources. Soon, downstream users of WIT interfaces will not need to actually use WIT directly, so it'll only be WIT interface developers, who will need some kind of
It's true that in the absence of an entry in local cache, Note that
The new workspace is only there due to It's nice to provide a working dev environment out-of-the-box. Requiring developers of Wasmtime to manually install development dependencies, to me, is an anti-pattern, that's why a Rust crate instead is very useful - it works cross-platform and developers do not need to install yet another binary executable.
Assuming that every WIT dependency must have an external source (e.g. a standard repo),
Similarly, for the other two WIT packages:
What exactly is different?
Not that I know of, these seem to be WASI-specific, which is why I moved them there. Maybe there should be a |
5d4e19b
to
89aa901
Compare
I've removed all dependency updates and any reorganization from this PR, it's just fixing the |
cargo vendor
cargo vendor
usage for component adapter crate
Sorry this stalled, I was on vacation and am digging myself out. It looks like this diff is down to just using the wit-deps tool to make sure that the two copies of wit remain identical. Can we instead just use |
not relevant for our use case anymore, closing |
(I have removed the old description, since it's no longer relevant)
Duplicate WIT dependencies of
wasi
crate inwasi-preview1-component-adapter
to avoid using relative paths inwit-bindgen
invocations fixing downstream dependencies onwasi-preview1-component-adapter
usingcargo vendor
This is checked in CI, but developers are free to use whichever tool they chose to achieve this. Running
wit-deps lock
fromcrates/wasi-preview1-component-adapter
is one way to do it