Skip to content

WASM Support - Take 2#147

Merged
iwillspeak merged 2 commits intorust-onig:mainfrom
artichoke:artichoke-vendor
Sep 9, 2020
Merged

WASM Support - Take 2#147
iwillspeak merged 2 commits intorust-onig:mainfrom
artichoke:artichoke-vendor

Conversation

@iwillspeak
Copy link
Copy Markdown
Collaborator

WASM Work from Artichoke courtesy of @lopopolo. Supersedes #122.

- Unwrap env variables only when required.
- Handle cases where `CARGO_CFG_TARGET_FAMILY` is not set. There is no
  need to unwrap this env var since we are only using it to optionally
  set some compiler flags.
- For wasm builds, define `ONIG_DISABLE_DIRECT_THREADING`. This is a new
  macro in oniguruma which disables computed gotos, which are unsupported
  by clang-8 when compiling to wasm targets.
- Override `ONIG_EXTERN` to set function visibility for wasm builds. By
  default, functions are not exported under wasm targets. This flag
  ensures all functions in the static onig library are marked exported.
- Set `-fvisibility=default` for bindgen runs on wasm targets.
Bumps [bindgen](https://github.com/rust-lang/rust-bindgen) from 0.54.1 to 0.55.1.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md)
- [Commits](rust-lang/rust-bindgen@v0.54.1...v0.55.1)
@iwillspeak
Copy link
Copy Markdown
Collaborator Author

Looks like the bump in Bindgen version causes a CI failure due to bumping the minimum Rust version. Do we know what the minimum Version should be now?

@lopopolo
Copy link
Copy Markdown
Contributor

lopopolo commented Sep 8, 2020

The change in MSRV comes from a clang-sys upgrade to v1.0.0. It looks like bindgen now requires Rust 1.40.0

rust-lang/rust-bindgen#1826 (comment)

Copy link
Copy Markdown
Contributor

@lopopolo lopopolo left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for upstreaming

iwillspeak added a commit that referenced this pull request Sep 9, 2020
Needed for the latest version of `clang-sys`. See
<#147 (comment)>
for more information.
@iwillspeak iwillspeak merged commit 5aedb9d into rust-onig:main Sep 9, 2020
iwillspeak added a commit that referenced this pull request Sep 9, 2020
Needed for the latest version of `clang-sys`. See
<#147 (comment)>
for more information.
@iwillspeak iwillspeak mentioned this pull request Sep 9, 2020
iwillspeak added a commit that referenced this pull request Sep 9, 2020
Needed for the latest version of `clang-sys`. See
<#147 (comment)>
for more information.
iwillspeak added a commit that referenced this pull request Sep 9, 2020
Needed for the latest version of `clang-sys`. See
<#147 (comment)>
for more information.
iwillspeak added a commit that referenced this pull request Sep 9, 2020
Onig 6.1.0 and onig_sys 69.5.1 with:

 * Minimum Rust (MSRV) is now 1.40
 * WASM support (#147)
 * Empty matches are only skipped when they overlap the previous
   match (#145)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants