Commit Graph

9098 Commits

Author SHA1 Message Date
Nick Fitzgerald
9a4afc552f Add notes for Wasmtime 2021-10-28 meeting (#3484) 2021-10-28 11:59:09 -05:00
Pat Hickey
a2d83d4ae6 Merge pull request #3481 from bytecodealliance/pch/ci_apt_update_before_install
CI Check job: run `apt-get update` before `apt-get install`
2021-10-27 13:14:14 -07:00
Pat Hickey
dfebb3e9b6 CI Check job: run apt-get update before apt-get install
trying to fix  https://github.com/bytecodealliance/wasmtime/runs/4025939586?check_suite_focus=true
2021-10-27 12:01:13 -07:00
Nick Fitzgerald
49133f62e6 Merge pull request #3476 from fitzgen/logging-in-cranelift-test-compile
cranelift: in `test_compile` filetest, log disasm not clif
2021-10-26 11:00:23 -07:00
Nick Fitzgerald
8aa8dfe26a cranelift: in test_compile filetest, log disasm not clif
With the old backends, this would log the lowered+legalized clif, but the log is
useles now with the new backends. Logging the disasm is the new moral
equivalent.
2021-10-26 10:21:31 -07:00
Nick Fitzgerald
5c342754f0 Merge pull request #3475 from alexcrichton/discuss-release
wasmtime: Add an agenda item for the release process
2021-10-26 09:51:10 -07:00
Alex Crichton
07e4eb599f wasmtime: Add an agenda item for the release process 2021-10-26 08:28:13 -07:00
Alex Crichton
807b528bfb Automate more of Wasmtime's release process (#3422)
* Automate more of Wasmtime's release process

This change revamps the release process for Wasmtime and intends to make
it nearly 100% automated for major release and hopefully still pretty
simple for patch releases. New workflows are introduced as part of
this commit:

* Once a month a PR is created with major version bumps
* Specifically hinted commit messages to the `main` branch will get
  tagged and pushed to the main repository.
* On tags we'll now not only build releases after running CI but
  additionally crates will be published to crates.io.

In conjunction with other changes this means that the release process
for a new major version of Wasmtime is simply merging a PR. Patch
releases will involve running some steps locally but most of the
nitty-gritty should be simply merging the PR that's generated.

* Use an anchor in a regex
2021-10-26 10:25:40 -05:00
Pat Hickey
7962fe3f43 update tracing-subscriber (#3473)
which gets rid of the transitive dep on `chrono` that was affected by
`RUSTSEC-2020-0159`.
2021-10-26 09:06:45 -05:00
Alex Crichton
490d49a768 Adjust dependency directives between crates (#3420)
* Adjust dependency directives between crates

This commit is a preparation for the release process for Wasmtime. The
specific changes here are to delineate which crates are "public", and
all version requirements on non-public crates will now be done with
`=A.B.C` version requirements instead of today's `A.B.C` version
requirements.

The purpose for doing this is to assist with patch releases that might
happen in the future. Patch releases of wasmtime are already required to
not break the APIs of "public" crates, but no such guarantee is given
about "internal" crates. This means that a patch release runs the risk,
for example, of breaking an internal API. In doing so though we would
also need to release a new major version of the internal crate, but we
wouldn't have a great hole in the number scheme of major versions to do
so. By using `=A.B.C` requirements for internal crates it means we can
safely ignore strict semver-compatibility between releases of internal
crates for patch releases, since the only consumers of the crate will be
the corresponding patch release of the `wasmtime` crate itself (or other
public crates).

The `publish.rs` script has been updated with a check to verify that
dependencies on internal crates are all specified with an `=`
dependency, and dependnecies on all public crates are without a `=`
dependency. This will hopefully make it so we don't have to worry about
what to use where, we just let CI tell us what to do. Using this
modification all version dependency declarations have been updated.

Note that some crates were adjusted to simply remove their `version`
requirement in cases such as the crate wasn't published anyway (`publish
= false` was specified) or it's in the `dev-dependencies` section which
doesn't need version specifiers for path dependencies.

* Switch to normal sever deps for cranelift dependencies

These crates will now all be considered "public" where in patch releases
they will be guaranteed to not have breaking changes.
2021-10-26 09:06:03 -05:00
Nick Fitzgerald
82aad556ea Merge pull request #3472 from fitzgen/no-expect-format
Remove some uses of `foo.expect(&format!(...))` anti-pattern
2021-10-25 19:31:13 -07:00
Nick Fitzgerald
e3a423c3e8 Remove some uses of foo.expect(&format!(...)) pattern
This eagerly evaluates the `format!` and produces a `String` with a heap
allocation, regardless whether `foo` is `Some`/`Ok` or `None`/`Err`. Using
`foo.unwrap_or_else(|| panic!(...))` makes it so that the error message
formatting is only evaluated if `foo` is `None`/`Err`.
2021-10-25 17:35:23 -07:00
Pat Hickey
06a93d3346 Merge pull request #3393 from bytecodealliance/pch/async_limiting
Add ResourceLimiterAsync, which can yield until resource is available
2021-10-25 11:47:48 -07:00
Alex Crichton
2f2c5231b4 Add Alex's solution for null handling in TlsRestore 2021-10-25 10:04:31 -07:00
Anton Kirilov
e9c4164b94 Call membarrier() after making JIT mappings executable on AArch64 Linux
The membarrier() system call ensures that no processor has fetched
a stale instruction stream.

Copyright (c) 2021, Arm Limited.
2021-10-25 13:25:35 +01:00
Pat Hickey
fb549c6ddb actually do some awaiting in the async limiter, which doesnt work
something tls-related is not right
2021-10-22 16:12:07 -07:00
Pat Hickey
5f978dbfdd make feature requirement render in rustdoc for new apis 2021-10-22 14:03:04 -07:00
Pat Hickey
6819459082 fix all docs links 2021-10-22 12:00:56 -07:00
Pat Hickey
996289725d docs 2021-10-22 11:44:54 -07:00
Pat Hickey
bcbd74678a add some tests that show behavior is the same when on wasm stack 2021-10-22 11:08:09 -07:00
Pat Hickey
b00d811e83 code review 2021-10-22 10:43:46 -07:00
Pat Hickey
52542b6c01 mock enough of the store to pass the uffd test 2021-10-22 08:56:13 -07:00
Pat Hickey
efef0769fe make uffd test compile, but not pass 2021-10-22 08:39:00 -07:00
Michael Chesser
da51fae4c3 Rename executable to already_protected 2021-10-22 13:44:47 +01:00
Michael Chesser
61ecccf306 Avoid updating memory protection on allocations that have the right protection. 2021-10-22 13:44:47 +01:00
Pat Hickey
0370d5c1a2 code review suggestion 2021-10-21 16:46:31 -07:00
Pat Hickey
175e72bac4 test that the catch unwind works 2021-10-21 16:43:13 -07:00
Pat Hickey
3fd674c6bc async memory_grow_failed can have a default impl
idk why this didnt work in the old factoring! but im glad it does
2021-10-21 16:38:46 -07:00
Pat Hickey
758abe3963 add table limiting tests 2021-10-21 16:23:54 -07:00
Pat Hickey
538c19589b build out async versions of the existing limiter tests 2021-10-21 15:21:05 -07:00
Pat Hickey
a1301f8dae add table_grow_failed 2021-10-21 15:07:40 -07:00
Pat Hickey
c0a1af94cf fix trap behavior 2021-10-21 15:07:32 -07:00
Pat Hickey
351a51cce6 docs 2021-10-21 14:28:40 -07:00
Pat Hickey
252ba39c27 implement table _async methods, test passes now 2021-10-21 14:15:53 -07:00
Chris Fallin
54896ac86d Merge pull request #3469 from cfallin/machbuffer-quadratic-labels
Avoid quadratic behavior in pathological label-alias case in MachBuffer.
2021-10-21 13:37:40 -07:00
Pat Hickey
5aef8f47c8 catch panic in libcalls for memory and table grow 2021-10-21 12:15:00 -07:00
Pat Hickey
d3deaae99d collapse some common code 2021-10-21 12:10:03 -07:00
Pat Hickey
6c70b81ff5 review feedback 2021-10-21 12:10:03 -07:00
Pat Hickey
abbe28d833 propogate changes to use anyhow::Error instead of Box<dyn Error...> 2021-10-21 12:10:03 -07:00
Pat Hickey
a5007f318f runtime: use anyhow::Error instead of Box<dyn std::error::Error...> 2021-10-21 12:10:03 -07:00
Pat Hickey
2225722373 Memory::new_async, grow_async now work! 2021-10-21 12:10:03 -07:00
Pat Hickey
adf7521e30 introduce a failing test 2021-10-21 12:10:03 -07:00
Pat Hickey
67a6c27e22 pooling needs the store earlier 2021-10-21 12:10:03 -07:00
Pat Hickey
9d1b24632e fix 2021-10-21 12:10:03 -07:00
Pat Hickey
147c8f8ed7 rename 2021-10-21 12:10:03 -07:00
Pat Hickey
18a355e092 give sychronous ResourceLimiter an async alternative 2021-10-21 12:10:03 -07:00
Chris Fallin
472b1b2e8a Avoid quadratic behavior in pathological label-alias case in MachBuffer.
Fixes #3468.

If a program has many instances of the pattern "goto next; next:" in a
row (i.e., no-op branches to the fallthrough address), the branch
simplification in `MachBuffer` would remove them all, as expected.
However, in order to work correctly, the algorithm needs to track all
labels that alias the current buffer tail, so that they can be adjusted
later if another branch chomp occurs.

When many thousands of this branch-to-next pattern occur, many thousands
of labels will reference the current buffer tail, and this list of
thousands of labels will be shuffled between the branch metadata struct
and the "labels at tail" struct as branches are appended and then
chomped immediately.

It's possible that with smarter data structure design, we could somehow
share the list of labels -- e.g., a single array of all labels, in order
they are bound, with ranges of indices in this array used to represent
lists of labels (actually, that seems like a better design in general);
but let's leave that to future optimization work.

For now, we can avoid the quadratic behavior by just "giving up" if the
list is too long; it's always valid to not optimize a branch. It is very
unlikely that the "normal" case will have more than 100 "goto next"
branches in a row, so this should not have any perf impact; if it does,
we will leave 1 out of every 100 such branches un-optimized in a long
sequence of thousands.

This takes total compilation time down on my machine from ~300ms to
~72ms for the `foo.wasm` case in #3441. For reference, the old backend
(now removed), built from arbitrarily-chosen-1-year-old commit
`c7fcc344`, takes 158ms, so we're ~twice as fast, which is what I would
expect.
2021-10-21 12:07:39 -07:00
Chris Fallin
e04357505e Merge pull request #3466 from cfallin/regalloc-0.0.32
Update to regalloc.rs 0.0.32.
2021-10-20 16:07:14 -07:00
Chris Fallin
e9921574d7 Update to regalloc.rs 0.0.32.
It appears that some allocation heuristics have changed slightly since
0.0.31, so some of the golden-output filetests are updated as well.
Ideally we would rely more on runtests rather than golden-compilation
tests; but for now this is sufficient. (I'm not sure exactly what in
regalloc.rs changed to alter these heuristics; it's actually been almost
a year since the 0.0.31 release with several refactorings and tweaks
merged since then.)

Fixes #3441.
2021-10-20 15:28:42 -07:00
Adam Bratschi-Kaye
afd10646c9 List exports of an instance in linking error (#3456)
When there is a linking error caused by an undefined instance, list all
the instances exports in the error message. This will clarify errors for
undefined two-level imports that get desugared to one-level instance
imports under the module-linking proposal.
2021-10-20 16:31:53 -05:00