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

Merge with upstream #77

Merged
merged 12 commits into from
Apr 2, 2024
Merged

Merge with upstream #77

merged 12 commits into from
Apr 2, 2024

Conversation

dhil
Copy link
Member

@dhil dhil commented Apr 2, 2024

No description provided.

alexcrichton and others added 12 commits March 28, 2024 02:57
…1472)

* Don't generate exports named `memory` in wit-smith

This fixes a fuzz bug discovered last night and this applies a similar
fix for interfaces which avoids using `memory` that clashes with the
canonical name for linear memory itself.

* Review comments
…nce#1473)

* Bail when doing wit-component::decode on a component

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>

* Add test for component-new-existing-component

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>

---------

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
…iance#1474)

* Add additional error context to ComponentEncoder::encode

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>

* Update tests

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>

---------

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
* Refactor how spans are held in `UnresolvedPackage`

Put them in a `struct` with named fields and group them together by
relevance.

* Disallow returns-of-borrows in WIT

Currently in the component model it's not valid to have a function that
returns a `borrow` resource. In WIT, however, there's no protection
currently against this until a component is actually made. Bindings
generators additionally might panic and/or assume that they won't need
to generate bindings for borrows.

This commit implements a `Resolve`-level validation that a function
never returns a `borrow<T>` transitively within it. This ensures that
the error for returning a borrowed resource shows up earlier in the
development cycle and additionally ensures that bindings generators
don't have to each specifically handle this case.

Closes bytecodealliance/wit-bindgen#907

* Fix test expectation
…iance#1475)

The [shared-everything-threads] proposal adds new `shared` annotations
in more places, new atomic instructions, new component model thread
intrinsics, etc. This change just sets the ground work by adding the
shared-everything-threads flags in all the places I found to be needed;
more PRs to follow.

[shared-everything-threads]: https://github.com/WebAssembly/shared-everything-threads
…ecodealliance#1478)

* add `--use-built-in-libdl` option to `component link` subcommand

This tells `wit-component` to include a prebuilt libdl.so when linking.  This
library provides `dlopen`, `dlsym`, etc. using the lookup tables generated by
the linker when one or more `--dl-openable` options are provided.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* mark `dl` crate unpublishable

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* move libdl.so to hopefully make `./publish verify` happy

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* update link-dl-openable-builtin-libdl/component.wat

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* tweak error message set by `dlsym`

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* update libdl.so and link-dl-openable-builtin-libdl/component.wat

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* address review feedback

- make libdl.so smaller
- remove unnecessary newtype
- check that libdl.so is up-to-date during CI
- use CStr literal syntax
- add `dl` crate to workspace

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* CI fix

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* use LTO and strip when building libdl.so

This helps ensure the build is deterministic and not system-dependent.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* another CI fix

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* exclude `dl` crate when testing on WebAssembly

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* remove debug logging

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

* revert unneeded change in crates/wit-component/tests/components.rs

Signed-off-by: Joel Dice <joel.dice@fermyon.com>

---------

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
We always resolve symbols in the global scope in AOT linking, so we can
safely accept the `RTLD_GLOBAL` flag in the `dlopen` function.
This commit adds to the list of release binaries created in CI to
publish a wasm32-wasi binary alongside the others. I don't expect it to
be used that often but it's a neat showcase.
My earlier PR had a bug that led to an error when `--use-built-in-libdl` was
specified and there were unused libraries provided by the user _and_
`--stub-missing-functions` was _not_ used.  This adds a test to exercise that
case and moves the `self.use_built_in_libdl = false;` statement so that it is
always run prior to a recursive call to `Linker::encode`.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* threads: add `shared` globals

This change allows wasm-tools to encode and decode `shared` global
types as a part of the [shared-everything-threads] proposal. It includes
some initial fuzzing support, though it all should be turned off by
default.

[shared-everything-threads]: https://github.com/WebAssembly/shared-everything-threads

* review: remove wit-component TODOs

* review: use enclosed parser variable

* review: avoid shared-everything-threads in wasm-smith for now

* review: emit new 'malformed' message

* review: add imports to test

* review: add 'missing-features' tests
@dhil dhil merged commit bd76ea6 into wasmfx:main Apr 2, 2024
18 checks passed
@dhil dhil deleted the wasmfx-merge branch April 2, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants