-
Notifications
You must be signed in to change notification settings - Fork 824
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
Add WASI support to C API #856
Conversation
2390096
to
b45b1c1
Compare
808: Bump rand from 0.7.0 to 0.7.2 r=MarkMcCaskey a=dependabot-preview[bot] Bumps [rand](https://github.com/rust-random/rand) from 0.7.0 to 0.7.2. <details> <summary>Changelog</summary> *Sourced from [rand's changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md).* > ## [0.7.2] - 2019-09-16 > ### Fixes > - Fix dependency on `rand_core` 0.5.1 ([wasmerio#890](https://github-redirect.dependabot.com/rust-random/rand/issues/890)) > > ### Additions > - Unit tests for value stability of distributions added ([wasmerio#888](https://github-redirect.dependabot.com/rust-random/rand/issues/888)) > > ## [0.7.1] - 2019-09-13 > ### Fixes > - Fix `no_std` behaviour, appropriately enable c2-chacha's `std` feature ([wasmerio#844](https://github-redirect.dependabot.com/rust-random/rand/issues/844)) > - `alloc` feature in `no_std` is available since Rust 1.36 ([wasmerio#856](https://github-redirect.dependabot.com/rust-random/rand/issues/856)) > - Fix or squelch issues from Clippy lints ([wasmerio#840](https://github-redirect.dependabot.com/rust-random/rand/issues/840)) > > ### Additions > - Add a `no_std` target to CI to continously evaluate `no_std` status ([wasmerio#844](https://github-redirect.dependabot.com/rust-random/rand/issues/844)) > - `WeightedIndex`: allow adjusting a sub-set of weights ([wasmerio#866](https://github-redirect.dependabot.com/rust-random/rand/issues/866)) </details> <details> <summary>Commits</summary> - [`249ebfc`](rust-random/rand@249ebfc) Merge pull request [wasmerio#888](https://github-redirect.dependabot.com/rust-random/rand/issues/888) from dhardy/master - [`5ac4cbd`](rust-random/rand@5ac4cbd) Prepare rand 0.7.2 - [`f39915a`](rust-random/rand@f39915a) rand_distr: work around tan func issue - [`802ba8f`](rust-random/rand@802ba8f) rand_distr: add missing value_stability tests - [`a43d7f1`](rust-random/rand@a43d7f1) Fix tests - [`2ef2e66`](rust-random/rand@2ef2e66) Add value_stability tests for uniform - [`096a5dd`](rust-random/rand@096a5dd) UniformSampler: add doc on usage of sample_single - [`f78781a`](rust-random/rand@f78781a) Uniform: replace inner field with struct tuple - [`856fdfb`](rust-random/rand@856fdfb) Distribution: add doc of portability - [`72af6f8`](rust-random/rand@72af6f8) Add value_stability tests for bernoulli, int, float and other distrs - Additional commits viewable in [compare view](rust-random/rand@0.7.0...0.7.2) </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=rand&package-manager=cargo&previous-version=0.7.0&new-version=0.7.2)](https://dependabot.com/compatibility-score.html?dependency-name=rand&package-manager=cargo&previous-version=0.7.0&new-version=0.7.2) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot. </details> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
What is left to do? Can I help? |
@Hywan I think it's done, we just wanted to get it tested (I made an example in the C API example repo and I'm working on implementing it in Go). I think I know enough to say with reasonable confidence that we can ship this before finishing the implementation in Go because it just returns an import object but 🤷♂ . One thing this code doesn't do is expose the errors properly. I'd like to hear your thoughts on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the PR looks good. I would love to see some tests though. How hard would it be? I believe high-level WASI tests are really mandatory since WASI is ship as a default feature.
lib/runtime-c-api/src/import.rs
Outdated
}; | ||
if import.is_null() || import_export_value.is_null() { | ||
update_last_error(CApiError { | ||
msg: "pointer to import and import_export_value must not be null".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pointer
+ pointers
@MarkMcCaskey I've created #873 to fix some of my feedbacks in this PR. Feel free to include them if you think they are relevant. |
Update feature/wasi-in-c-api
add headers too
02fa331
to
80cfeb5
Compare
move entry in changelog due to release
38a9597
to
aa82df7
Compare
bors try |
tryBuild failed
|
bors try |
tryBuild succeeded
|
Minor comments. The PR looks good. Nice work! Thanks. |
PRId64 is defined to the right printf format string to print a int64_t on the current system.
bors r+ |
856: Add WASI support to C API r=MarkMcCaskey a=MarkMcCaskey This is an additive change (with one unrelated clean up of `*mut ptr -> *const ptr`). It exposes the functions to get a WASI import object. It also implements a function on import object to get an `import` with namespace and name. These changes should be okay to ship now, we can follow up to finish adding methods to ImportObject on the C API side and start migrating away from `*imports`. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Mark McCaskey <[email protected]> Co-authored-by: Ivan Enderlin <[email protected]> Co-authored-by: Mark McCaskey <[email protected]>
Though both orders work, this is customary.
bors r- |
Canceled |
Move the linkage before the type.
Use printf portably.
bors r+ |
856: Add WASI support to C API r=MarkMcCaskey a=MarkMcCaskey This is an additive change (with one unrelated clean up of `*mut ptr -> *const ptr`). It exposes the functions to get a WASI import object. It also implements a function on import object to get an `import` with namespace and name. These changes should be okay to ship now, we can follow up to finish adding methods to ImportObject on the C API side and start migrating away from `*imports`. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Mark McCaskey <[email protected]> Co-authored-by: Ivan Enderlin <[email protected]> Co-authored-by: Mark McCaskey <[email protected]> Co-authored-by: nlewycky <[email protected]>
Build succeeded
|
This is an additive change (with one unrelated clean up of
*mut ptr -> *const ptr
). It exposes the functions to get a WASI import object. It also implements a function on import object to get animport
with namespace and name.These changes should be okay to ship now, we can follow up to finish adding methods to ImportObject on the C API side and start migrating away from
*imports
.Review