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

feat(c-api) Remove the deprecated API #2370

Merged
merged 13 commits into from
Jun 2, 2021

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented May 31, 2021

Description

Until this patch, our C API comes in 2 flavors: deprecated and
wasm_c_api. With the coming 2.x version of Wasmer, we would like to
remove the deprecated API, and keep the wasm_c_api only.

This patch removes the deprecated API from the wasmer-c-api
crate. It also cleans up the Makefile and the documentation
system. Previously, the documentation for the deprecated API was
relying on Doxygen, which was one new dependency the user had to
install. For the wasm_c_api, it relies on rustdoc, which is way
better because all examples are run and tested as part of our test
suite.

This clean up also removes the need to deal with system-libffi both
in the crate itself and in the Makefile, which was an edge case for
macOS on aarch64, and a needle in the foot for some of our users.

Finally, the build.rs is now simplified because we no longer need to
exclude symbols from one header to another. It also means that we only
provide the wasmer_wasm.h header file now; the wasmer.h and
wasmer.hh headers are removed.

Until this patch, our C API comes in 2 flavors: `deprecated` and
`wasm_c_api`. With the coming 2.x version of Wasmer, we would like to
remove the `deprecated` API, and keep the `wasm_c_api` only.

This patch removes the `deprecated` API from the `wasmer-c-api`
crate. It also cleans up the `Makefile` and the documentation
system. Previously, the documentation for the `deprecated` API was
relying on Doxygen, which was one new dependency the user had to
install. For the `wasm_c_api`, it relies on `rustdoc`, which is way
better because all examples are run and tested as part of our test
suite.

This clean up also removes the need to deal with `system-libffi` both
in the crate itself and in the `Makefile`, which was an edge case for
macOS on aarch64, and a needle in the foot for some of our users.

Finally, the `build.rs` is now simplified because we no longer need to
exclude symbols from one header to another. It also means that we only
provide the `wasmer_wasm.h` header file now; the `wasmer.h` and
`wasmer.hh` headers are removed.
@Hywan Hywan added 🎉 enhancement New feature! 📦 lib-c-api About wasmer-c-api labels May 31, 2021
@Hywan Hywan self-assigned this May 31, 2021
@Hywan Hywan requested a review from MarkMcCaskey as a code owner May 31, 2021 16:06
Copy link
Contributor

@jubianchi jubianchi left a comment

Choose a reason for hiding this comment

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

Seems good so far. There are comments in the code on parts I think you are still working on (in lib/c-api/src/wasm_c_api/externals/table.rs for example).

Also, I'd like to wait for the other Prs to be merged to do a second round of review.

@syrusakbary
Copy link
Member

It also means that we only
provide the wasmer_wasm.h header file now; the wasmer.h and
wasmer.hh headers are removed.

I think it will be better to rename wasmer_wasm.h to wasmer.h and have wasmer_wasm.h to be an empty file just importing wasmer.h and emit a compiler warning notifying user to use wasmer.h instead

@Hywan
Copy link
Contributor Author

Hywan commented Jun 1, 2021

Actually, using the wasm suffix make sense. If we want to support or to implement another API, we keep the wasmer_ prefix, and use a suffix to specify the kind of API we support. So I'm in favor of keeping wasmer_wasm.h. Thoughts?

@syrusakbary
Copy link
Member

I think only one API should be encouraged to use at the same time, so using a prefix for wasmer_* doesn’t make that much sense (unless we split it into smaller chunks in the future).

Also, Wasmer is always going to be focused on Wasm, so I see as redundantly recommending wasmer_wasm (we should keep the import working for compatibility thought).

@Hywan
Copy link
Contributor Author

Hywan commented Jun 1, 2021

Let's address that in another PR then, so that it's easier to review.

@syrusakbary
Copy link
Member

Oh, I think I read it wrong. So yeah, let’s keep Wasmer_wasm but just as an empty wrapper that just imports Wasmer.h for now!

@Hywan
Copy link
Contributor Author

Hywan commented Jun 1, 2021

bors try

lib/c-api/src/wasm_c_api/externals/table.rs Outdated Show resolved Hide resolved
lib/c-api/src/wasm_c_api/types/frame.rs Outdated Show resolved Hide resolved
@Hywan
Copy link
Contributor Author

Hywan commented Jun 1, 2021

bors r+

@syrusakbary
Copy link
Member

bors r+

@syrusakbary
Copy link
Member

bors r+

@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Jun 1, 2021
2370: feat(c-api) Remove the `deprecated` API r=syrusakbary a=Hywan

# Description

Until this patch, our C API comes in 2 flavors: `deprecated` and
`wasm_c_api`. With the coming 2.x version of Wasmer, we would like to
remove the `deprecated` API, and keep the `wasm_c_api` only.

This patch removes the `deprecated` API from the `wasmer-c-api`
crate. It also cleans up the `Makefile` and the documentation
system. Previously, the documentation for the `deprecated` API was
relying on Doxygen, which was one new dependency the user had to
install. For the `wasm_c_api`, it relies on `rustdoc`, which is way
better because all examples are run and tested as part of our test
suite.

This clean up also removes the need to deal with `system-libffi` both
in the crate itself and in the `Makefile`, which was an edge case for
macOS on aarch64, and a needle in the foot for some of our users.

Finally, the `build.rs` is now simplified because we no longer need to
exclude symbols from one header to another. It also means that we only
provide the `wasmer_wasm.h` header file now; the `wasmer.h` and
`wasmer.hh` headers are removed.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
@syrusakbary
Copy link
Member

Bors was failing because the PR changed a file inside .workflows which Github doesn't allow somehow

@bors
Copy link
Contributor

bors bot commented Jun 1, 2021

Build failed:

@syrusakbary
Copy link
Member

bors try

@bors
Copy link
Contributor

bors bot commented Jun 2, 2021

try

Already running a review

@syrusakbary
Copy link
Member

bors try-

@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Jun 2, 2021
2370: feat(c-api) Remove the `deprecated` API r=syrusakbary a=Hywan

# Description

Until this patch, our C API comes in 2 flavors: `deprecated` and
`wasm_c_api`. With the coming 2.x version of Wasmer, we would like to
remove the `deprecated` API, and keep the `wasm_c_api` only.

This patch removes the `deprecated` API from the `wasmer-c-api`
crate. It also cleans up the `Makefile` and the documentation
system. Previously, the documentation for the `deprecated` API was
relying on Doxygen, which was one new dependency the user had to
install. For the `wasm_c_api`, it relies on `rustdoc`, which is way
better because all examples are run and tested as part of our test
suite.

This clean up also removes the need to deal with `system-libffi` both
in the crate itself and in the `Makefile`, which was an edge case for
macOS on aarch64, and a needle in the foot for some of our users.

Finally, the `build.rs` is now simplified because we no longer need to
exclude symbols from one header to another. It also means that we only
provide the `wasmer_wasm.h` header file now; the `wasmer.h` and
`wasmer.hh` headers are removed.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
@bors
Copy link
Contributor

bors bot commented Jun 2, 2021

Canceled.

@syrusakbary
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 2, 2021

@bors bors bot merged commit 976d023 into wasmerio:master Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! 📦 lib-c-api About wasmer-c-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants