62 Commits

Author SHA1 Message Date
Alex Crichton
9c5a6dfff6
Merge pull request #2176 from jakobhellermann/deno-target
add deno target
2020-06-03 16:20:30 -05:00
Jakob Hellermann
84c7cf01ce address pr comments 2020-06-03 22:31:05 +02:00
Alex Crichton
8edcda4095
Update threads-xform for current nightly (#2183)
This commit updates the threads transformation for LLVM 10 where LLD has
has breaking changes from LLVM 9. While previously the support here
attempted to straddle multiple LLVM styles this is now removed in favor
of simply supporting LLVM 10's style of output. This means that
wasm-bindgen will only be compatible with recent nightlies and forward.

The major change here is that the `__wasm_init_memory` function is
automatically called by the `start` function. We handle that by placing
the previous `start` function first, before stack/tls allocation. Other
changes are to delete all the old code from pre-llvm-9.

Closes #2175
2020-06-03 11:39:10 -05:00
Alex Crichton
47ccb49e4c
Unpin nightly toolchain (#2161)
Seeing what's left on CI to fix
2020-05-27 09:42:30 -05:00
Alex Crichton
cf45d5b24a Pin to an older nightly to fix CI 2020-05-26 08:26:12 -07:00
Alex Crichton
996e92f3ae
Mass rename anyref to externref (#2142)
Updates a mess of dependencies and tracks the most recent version of the
reference types specification.
2020-05-18 09:36:30 -05:00
Alex Crichton
b0ebc98a64 Don't build webxr example
It requires unstable features currently
2020-03-17 07:50:11 -07:00
Alex Crichton
29fabdddb1 Update macos build agent 2020-03-17 07:26:11 -07:00
Alex Crichton
597af6c2e6
Document unstable APIs in master docs (#2025) 2020-03-03 10:45:59 -06:00
Pauan
3f4acc453b
Dramatically improving the build time of web-sys (#2012)
* Pre-generating web-sys

* Fixing build errors

* Minor refactor for the unit tests

* Changing to generate #[wasm_bindgen} annotations

* Fixing code generation

* Adding in main bin to wasm-bindgen-webidl

* Fixing more problems

* Adding in support for unstable APIs

* Fixing bug with code generation

* More code generation fixes

* Improving the webidl program

* Removing unnecessary cfg from the generated code

* Splitting doc comments onto separate lines

* Improving the generation for unstable features

* Adding in support for string values in enums

* Now runs rustfmt on the mod.rs file

* Fixing codegen for constructors

* Fixing webidl-tests

* Fixing build errors

* Another fix for build errors

* Renaming typescript_name to typescript_type

* Adding in docs for typescript_type

* Adding in CI script to verify that web-sys is up to date

* Fixing CI script

* Fixing CI script

* Don't suppress git diff output

* Remove duplicate definitions of `Location`

Looks to be a preexisting bug in wasm-bindgen?

* Regenerate webidl

* Try to get the git diff command right

* Handle named constructors in WebIDL

* Remove stray rustfmt.toml

* Add back NamedConstructorBar definition in tests

* Run stable rustfmt over everything

* Don't run Cargo in a build script

Instead refactor things so webidl-tests can use the Rust-code-generation
as a library in a build script. Also fixes `cargo fmt` in the
repository.

* Fixup generated code

* Running web-sys checks on stable

* Improving the code generation a little

* Running rustfmt

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-03-02 17:39:36 -06:00
Alex Crichton
381660c49b
Run rustfmt and keep it running on CI (#2023)
Thought we did this awhile back, but looks like we forgot to do so!
2020-03-02 11:44:14 -06:00
Alex Crichton
15e9c54a20
Update CI configuration (#2022)
* Move builders that can back to stable Rust
* Remove comments about sccache since it seems unlikely we'll bring it
  back soon.
2020-03-02 10:52:27 -06:00
Alex Crichton
fb51d9036f Don't doc unstable features on git for now
The generated HTML is too large to upload to gh-pages :(
2020-02-27 07:59:11 -08:00
Alex Crichton
654af576c7 Tweak some CI things for unstable APIs 2020-02-26 14:36:23 -08:00
Josh Groves
99c59a771e
[WIP] Add support for unstable WebIDL (#1997)
* Re-enable WebGPU WebIDL as experimental

* Add `web_sys_unstable_apis` attribute

* Add test for unstable WebIDL

* Include unstable WebIDL in docs.rs builds

* Add docs and doc comment for unstable APIs

* Add unstable API checks to CI
2020-02-26 16:30:11 -06:00
Alex Crichton
0f0d5ee0fb Fix our doc upload step 2020-01-21 11:02:53 -08:00
Richard Dodd (dodj)
762bd0dabd test running rustfmt on web-sys bindings. (#1954) 2020-01-13 09:59:29 -06:00
Alex Crichton
91aaf884d6 Update build of raytrace example to latest nightly
Closes #1935
2020-01-06 08:30:30 -08:00
Alex Crichton
057c9157b3
Add test for consuming interface types inputs (#1900)
This commit adds a test suite for consuming interface types modules as
input and producing a JS polyfill output. The tests are relatively
simple today and don't exercise a ton of functionality, but they should
hopefully cover the breadth of at least some basics of what wasm
interface types supports today.

A few small fixes were applied along the way, such as:

* Don't require modules to have a stack pointer

* Allow passing `*.wat`, `*.wit`, or `*.wasm` files as input to
  `wasm-bindgen` instead of always requiring `*.wasm`.
2019-12-04 22:39:57 -06:00
Alex Crichton
9469c1641b
Remove reliance on wat2wasm in interpreter tests (#1893)
Move usage to the `wat` crate instead.
2019-12-03 14:09:33 -06:00
Alex Crichton
8e56cdacc5
Rewrite wasm-bindgen with updated interface types proposal (#1882)
This commit is a pretty large scale rewrite of the internals of wasm-bindgen. No user-facing changes are expected as a result of this PR, but due to the scale of changes here it's likely inevitable that at least something will break. I'm hoping to get more testing in though before landing!

The purpose of this PR is to update wasm-bindgen to the current state of the interface types proposal. The wasm-bindgen tool was last updated when it was still called "WebIDL bindings" so it's been awhile! All support is now based on https://github.com/bytecodealliance/wasm-interface-types which defines parsers/binary format/writers/etc for wasm-interface types.

This is a pretty massive PR and unfortunately can't really be split up any more afaik. I don't really expect realistic review of all the code here (or commits), but some high-level changes are:

* Interface types now consists of a set of "adapter functions". The IR in wasm-bindgen is modeled the same way not.
* Each adapter function has a list of instructions, and these instructions work at a higher level than wasm itself, for example with strings.
* The wasm-bindgen tool has a suite of instructions which are specific to it and not present in the standard. (like before with webidl bindings)
* The anyref/multi-value transformations are now greatly simplified. They're simply "optimization passes" over adapter functions, removing instructions that are otherwise present. This way we don't have to juggle so much all over the place, and instructions always have the same meaning.
2019-12-03 11:16:44 -06:00
Alex Crichton
ebef7a7aa7
Update toolchain for raytrace example (#1806)
Pulls in an LLVM tweak which emits far fewer `memory.copy`, drastrically
improving performance on Firefox!
2019-10-04 10:54:15 -05:00
Alex Crichton
599ec8b9f4
Use official node releases for anyref test suite (#1798)
Looks like 12.11.0 has all the support we need!
2019-09-26 14:07:21 -05:00
Alex Crichton
025b1d8bca
Switch to Cargo's -Zbuild-std for building libstd (#1796)
This commit switches away from `xargo` to using `-Zbuild-std` to
building the standard library for the raytrace-parallel example (which
needs to rebuild std with new target features).
2019-09-26 12:32:50 -05:00
Alex Crichton
0607a75b78
Switch CI to testing beta toolchains (#1792)
Don't accidentally leak in nightly features and bring a modicum of
stability to the UI tests
2019-09-25 12:45:49 -05:00
Nick Fitzgerald
b2d1165724 CI: Temporarily disable sccache usage
It is failing to install / setup on CI.
2019-09-16 13:15:20 -07:00
Nick Fitzgerald
fc2c502dfb CI: Run the multi-value xform tests in CI 2019-09-10 17:32:30 -07:00
Alex Crichton
3c887c40b7
Default all async support to std::future (#1741)
This commit defaults all crates in-tree to use `std::future` by default
and none of them support the crates.io `futures` 0.1 crate any more.
This is a breaking change for `wasm-bindgen-futures` and
`wasm-bindgen-test` so they've both received a major version bump to
reflect the new defaults. Historical versions of these crates should
continue to work if necessary, but they won't receive any more
maintenance after this is merged.

The movement here liberally uses `async`/`await` to remove the need for
using any combinators on the `Future` trait. As a result many of the
crates now rely on a much more recent version of the compiler,
especially to run tests.

The `wasm-bindgen-futures` crate was updated to remove all of its
futures-related dependencies and purely use `std::future`, hopefully
improving its compatibility by not having any version compat
considerations over time. The implementations of the executors here are
relatively simple and only delve slightly into the `RawWaker` business
since there are no other stable APIs in `std::task` for wrapping these.

This commit also adds support for:

    #[wasm_bindgen_test]
    async fn foo() {
        // ...
    }

where previously you needed to pass `(async)` now that's inferred
because it's an `async fn`.

Closes #1558
Closes #1695
2019-09-05 11:18:36 -05:00
Alex Crichton
ad34fa29d8 Update with list IR from walrus
This commit updates `wasm-bindgen` to the latest version of `walrus`
which transforms all internal IR representations to a list-based IR
instead of a tree-based IR. This isn't a major change other than
cosmetic for `wasm-bindgen` itself, but involves a lot of changes to the
threads/anyref passes.

This commit also updates our CI configuration to actually run all the
anyref tests on CI. This is done by downloading a nightly build of
node.js which is theorized to continue to be there for awhile until the
full support makes its way into releases.
2019-08-13 11:17:55 -07:00
Alex Crichton
8cb792474c Fully update threading support for LLVM 9
Support has landed in rust-lang/rust for full support for LLVM 9's
interpretation of WebAssembly threads. This commit updates our thread
transformation pass to take all this into account, namely:

* The threadign pass now runs by default and is keyed on whether memory
  is shared, not off an env var.
* TLS is initialized in addition to memory on each thread.
* Stack pointer finding is tweaked to account for the TLS base also
  being a mutable global.
* The build of the parallel raytrace example was updated to use today's
  nightly.
2019-07-30 09:17:23 -07:00
Pauan
aef62bd56c Adding in enable-interning to CI test suite 2019-07-19 23:29:27 +02:00
Alex Crichton
b7b92cffe2 Update mdbook install 2019-06-19 13:49:57 -07:00
Alex Crichton
8fc0a38402 Bump to 0.2.46 2019-06-14 11:44:58 -07:00
Alex Crichton
eafc6024cc Rewrite the parallel raytracing example with rayon
One of the best parts about concurrency in Rust is using `rayon` and how
easy it makes parallelization of tasks, so it's the ideal example for
parallel Rust on the web! Previously we've been unable to use `rayon`
because there wasn't a way to customize how rayon threads themselves are
spawned, but [that's now being developed for us][rayon]!

This commit uses that PR to rewrite the `raytrace-parallel` example in
this repository. While not a perfect idiomatic representation of using
`rayon` I think this is far more idiomatic than the previous iteration
of `raytrace-parallel`! I'm hoping that we can continue to iterate on
this, but otherwise show it off as a good example of parallel Rust on
the web.

[rayon]: https://github.com/rayon-rs/rayon/pull/636
2019-06-13 06:48:53 -07:00
Alex Crichton
e24c03182b Attempt to fix CI 2019-06-05 12:26:10 -07:00
ibaryshnikov
e16bb9cd38 exclude websockets from being built using npm 2019-06-01 15:40:32 +03:00
Alex Crichton
4cc730fc41 Migrate to trybuild from compiletest
This migrates our UI tests to the recently published `trybuild` crate
which should hopefully be a bit more robust than `compiletest` over
time!
2019-05-15 14:47:22 -07:00
ibaryshnikov
762989e95c removed duplicate script from pipelines 2019-05-12 19:34:26 +03:00
Alex Crichton
952d9e06f3 Attempt to really fix benchmarks deploy 2019-05-06 11:13:35 -07:00
Alex Crichton
d382ad72a3 Try to debug missing files... 2019-05-03 15:11:50 -07:00
Alex Crichton
7ef1e35a85 Try to fix publication of benchmarks 2019-05-03 14:29:10 -07:00
Alex Crichton
e4fd0fccb5 Add a page of microbenchmarks for wasm-bindgen
This commit starts to add a page of microbenchmarks for wasm-bindgen
which we can hopefully track and compare over time. Right now it's
primarily focused on data collection, making it easy to collect data
across a number of benchmarks for comparison. It doesn't currently do
much in the way of actually comparing the results for you (aka drawing
pretty graphs), so let's left for a future step.

It's hoped though that we can use this to track performance improvements
as well as ensuring that they work over time!
2019-05-03 12:30:11 -07:00
Alex Crichton
77d2c2856e Don't rustfmt web-sys bindings
File is then too large to upload to GitHub!

Closes #1482
2019-04-29 08:20:01 -07:00
Alex Crichton
03299a73b4 Fix raytrace example by using an older nightly
Unfortunately xargo is currently broken against master Rust, so let's
pin to an older nightly while that's sorted out
2019-04-25 19:47:59 -07:00
Alex Crichton
10cbc789a8 Install rustfmt on azure pipelines 2019-04-16 10:53:50 -07:00
Alex Crichton
05fbbb2b92
Merge pull request #1358 from stevebob/book-linkcheck-pr
Installing and running the linkcheck mdbook backend
2019-03-27 08:04:49 -04:00
Stephen Sherratt
3c12e13c04 Use rust template in mdbook test 2019-03-27 07:38:35 +00:00
Alex Crichton
362777fc75 Start implementing a test suite for the CLI
We have very few tests today so this starts to add the basics of a test
suite which compiles Cargo projects on-the-fly which will hopefully help
us bolster the amount of assertions we can make about the output.
2019-03-22 11:32:03 -07:00
Alex Crichton
6522968fb6 Switch UI tests to beta toolchain
Should ideally help reduce breakage!
2019-03-22 07:27:49 -07:00
Stephen Sherratt
47f3247a0e Installing and running the linkcheck mdbook backend 2019-03-16 17:42:15 +00:00