Commit Graph

2437 Commits

Author SHA1 Message Date
Marcin Mielniczuk
74d1c11fbe Fix fd_filestat_set_times and enable the fd_filestat_set test on Windows. 2019-08-13 21:34:35 +02:00
Marcin Mielniczuk
2f1afc4846 Implement fd_filestat_set_times using the filetime crate. 2019-08-13 21:34:35 +02:00
dependabot-preview[bot]
e7fd72bd5c Update hashbrown requirement from 0.5.0 to 0.6.0 (#274)
Updates the requirements on [hashbrown](https://github.com/rust-lang/hashbrown) to permit the latest version.
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.5.0...v0.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-13 06:44:30 -07:00
Jakub Konka
46c41abd60 Update tests for pread_pwrite and seek_tell 2019-08-12 11:23:28 +02:00
Jakub Konka
aac7fa766d Add testcase for unbuffered fd_write 2019-08-12 10:44:48 +02:00
Alex Crichton
47eee434d4 Build Linux binary in an older docker container (#268)
Currently our Linux binaries aren't quite as portable as they otherwise could
be. There's two primary reasons for this, and one of them is that the binary is
produced in a relatively recent Linux distribution (Ubuntu 16.04) which means
it has a relatively recent requirement in terms of glibc versions. On
OSX/Windows we can set some flags to rely on older libc implementations, but on
Linux we have to actually build against an older version.

This commit switches the container for the build to CentOS 6 instead of the
default Ubuntu 16.04. The main trick here is also finding a C++11-capable
compiler to compile wabt. Turns out though there's a helpful tutorial for this
at https://edwards.sdsu.edu/research/c11-on-centos-6/ and it was as easy as
installing a few packages.

The second portability concern of our Linux binaries is that they link
dynamically to `libstdc++.so` which isn't always installed on target systems,
or even if it is it may be too old or have a different ABI. This is solved by
statically linking to `libstdc++.a` in the build on Azure by doing a bit of
trickery with libraries and what's available.

After these results the glibc requirements drops from 2.18 (released in 2013)
to 2.6 (released in 2007) and avoids the need for users to have libstdc++.so
installed. We may eventually want to investigate fully-static musl binaries,
but finding a musl compiler for C++ is something I'm not that good at, so I
figure this is probably good enough for now.
2019-08-10 01:07:16 +02:00
Marcin Mielniczuk
b9834e3016 Disable the test on Windows, because it depends on fd_filestat_set_times, which is not implemented yet 2019-08-09 22:20:20 +02:00
Marcin Mielniczuk
a52eb205a4 Add a testcase for fd_filestat_set_*
This PR matches https://github.com/CraneStation/wasi-misc-tests/pull/14.
The file was created using `cargo build --release --target=wasm32-wasi`
2019-08-09 22:20:20 +02:00
Alex Crichton
3039caf65c Delete Travis/AppVeyor configurations (#266)
Now that this repo has migrated to Azure Pipelines they shouldn't be
necessary any more!
2019-08-09 17:43:03 +02:00
Alex Crichton
6def6de5e0 Remove the LLVM/bindgen/cmake dependencies from wasmtime-runtime (#253)
* Remove cmake/bindgen/llvm from wasmtime-runtime

This commit removes the cmake/bindgen dependency (which removes the need
for `llvm-config`) from the `wasmtime-runtime` crate. The C++ code is
instead compiled with the `cc` crate (it's just one file anyway) and the
interface is handwritten since it's quite small anyway.

Some other changes are:

* The `TrapContext` type in C++ was removed since it was unused, and it
  was moved to Rust with a `Cell` on each field.

* Functions between Rust/C++ now return `int` instead of `bool` to make
  them a bit more FFI compatible portably.

* The `jmp_buf` type has a workaround that will be fixed in the next commit.

* Move setjmp/longjmp to C++

This commit moves the definition of setjmp and longjmp into C++. This is
primarily done because it's [debatable whether it's possible to call
`setjmp` from Rust][rfc]. The semantics of `setjmp` are that it returns
twice but LLVM doesn't actually know about this because rustc isn't
telling LLVM this information, so it's unclear whether it can ever be
safe.

Additionally this removes the need for Rust code to know the definition
of `jmp_buf` which is a pretty hairy type to define in Rust across
platforms.

The solution in this commit is to move all setjmp/longjmp code to C++,
and that way we should be able to guarantee that jumps over wasm JIT
code should always go from C++ to C++, removing Rust from the equation
for now from needing to get any fiddly bits working across platforms.
This should overall help it be a bit more portable and also means Rust
doesn't have to know about `jmp_buf` as a type.

The previous `Vec` of `jmp_buf` is now replaced with one thread-local
pointer where previous values are stored on the stack and restored when
the function returns. This is intended to be functionally the same as
the previous implementation.

[rfc]: https://github.com/rust-lang/rfcs/issues/2625

* rustfmt

* Use volatile loads/stores

* Remove mention of cmake from README
2019-08-09 10:11:13 +02:00
Yury Delendik
4f04d7d873 Transform ranges and simple expressions (#63) 2019-08-08 20:44:45 -07:00
Dan Gohman
36b4ff8031 Say "memory" instead of "__wasi_memory" in error messages.
While the "__wasi_memory" name is something we considered, the name
currently being used for the memory exported to WASI is "memory", so
adjust the error message accordingly.
2019-08-08 21:17:59 +02:00
Marcin Mielniczuk
4c9be5909a Add an overflow check
The check will be removed when rust-lang/rust#63326 is fixed
2019-08-08 18:41:41 +02:00
Marcin Mielniczuk
e731965fbb Implement fd_filestat_set_size using libstd 2019-08-08 18:41:41 +02:00
Marcin Mielniczuk
92c2b563fc Reuse errno_from_ioerror to simplify error handling 2019-08-08 18:22:58 +02:00
Jakub Konka
e18175c556 path_get refactor and implementation of missing path_ hostcalls on Windows (#41)
* Move path_get outside of sys module

* Add implementation of readlinkat

* Clean up path_open; use OpenOptions as much as possible

* Enable close_preopen test

* Implement path_create_directory; fix path_open

* Refactor path concatenation onto a descriptor

* Implement path_remove_directory

* Implement path_unlink_file

* Rewrite path_open using specific access mask

* Fix error mapping when unlinking file

* Fix readlinkat to pass nofollow_errors testcase

* Clean up winerror to WASI conversion

* Spoof creating dangling symlinks on windows (hacky!)

* Add positive testcase for readlink

* Implement path_readlink (for nonzero buffers for now)

* Clean up

* Add Symlink struct immitating *nix symlink

* Fix path_readlink

* Augment interesting_paths testcase with trailing slashes example

* Encapsulate path_get return value as PathGet struct

* Remove dangling symlink emulation

* Extract dangling symlinks into its own testcase

This way, we can re-enable nofollow_errors testcase
on Windows also.

* Return __WASI_ENOTCAPABLE if user lacks perms to symlink
2019-08-08 17:06:01 +02:00
Till Schneidereit
1491f31531 Don't publish the Windows installer's wixpdb file (#263)
This file is only useful for debugging the installer itself, which our users really shouldn't need to do.
2019-08-08 13:29:34 +02:00
Jakub Konka
085d700cdc Bump wasi-common rev 2019-08-08 11:06:27 +02:00
Yury Delendik
9263b9df40 Add public Compiler::get_published_trampoline (#243) 2019-08-07 11:48:40 -07:00
Till Schneidereit
ecc9816870 Win installer (#245)
Add a basic Windows msi installer for the `wasmtime` and `wasm2obj` executables. They're also added to the PATH so they can be used in default shells.
2019-08-07 16:03:36 +02:00
Till Schneidereit
2c4e14d361 Don't run CI for 'dev' tag, to avoid endless CI loops 2019-08-07 15:59:05 +02:00
Till Schneidereit
53fda72ce7 Also do dev releases when merging into dev tag branch (#260) 2019-08-07 14:48:38 +02:00
Till Schneidereit
f2a65f1f7a Fix updating github release (#259) 2019-08-07 13:52:53 +02:00
Jakub Konka
8ea7a983d8 Make fd_write unbuffered; fixes CraneStation/wasmtime#255 2019-08-07 04:44:48 -07:00
Artur Jamro
b10f8cf322 Partial hashing of module for faster caching (#221)
* Simple module compilation cache

* Fix base64 encoding bug

* Use warn! everywhere in cache system

* Remove unused import

* Temporary workaround for long path on Windows

* Remove unused import for non-windows builds

* Add command line argument to enable cache system + apply minor review feedback

* Initial implementation of partial module hashing

* Proper module hashing for the cache

* Use newer version of cranelift
2019-08-06 17:19:26 -07:00
Artur Jamro
17d676ecbc Allow colons in Windows host paths (#235) 2019-08-06 16:44:26 -07:00
Till Schneidereit
ef1890ae92 Fix updating github release (#257) 2019-08-06 23:54:17 +02:00
Till Schneidereit
45c280511d Delete old GitHub 'dev' release when creating a new one (#256) 2019-08-06 22:32:31 +02:00
Yury Delendik
5fc2d827b7 Update cranelift requirement from 0.37.0 to 0.38.0 (#254)
closes #248, closes #249, closes #250, closes #251, closes #252
2019-08-06 14:49:28 -05:00
Alex Crichton
8ce68732f6 Compile Windows releases with a static CRT (#247)
This commit compiles all Rust code for the Windows release with
`-Ctarget-feature=+crt-static`. This is targeted at increasing the
binary compatibility of the binaries built to not rely on DLLs that
aren't always installed on Windows. Notably this statically links the C
runtime (notably used by the C++ code) and means that the final binary
relies on fewer dlls.

This in theory means that the binaries are only limited by the number of
APIs they use from Windows. Note that this also matches how we build
releases of Rust for MSVC.
2019-08-06 19:27:02 +02:00
Alex Crichton
3e2344c90b Set MACOSX_DEPLOYMENT_TARGET for macOS releases (#246)
* Set MACOSX_DEPLOYMENT_TARGET for macOS releases

This is an effort to ideally produce "more portable" binaries for the
releases we publish to GitHub. Currently the way macOS works is that
you're generally only guaranteed to work on the same platform you built
on and later (although it may sometimes work on older platforms). By
configuring this environment variable it should be possible to lower the
binary compatibility requirement, allowing running binaries on older OS
releases than the build machine is running.

I've chosen 10.9 here since it seems to be the lowest that "just works",
but there's no particular reason other than that for choosing this. Rust
itself chooses 10.8 (I think) for the compiler and 10.7 for the standard
library. This decision is largely driven by the C++ code from wabt-sys
which has more requirements about binary compatibility than Rust code
does.

Note that I don't actually have older macOS machines to test on as well,
but I can at least confirm that this does affect the build process!

* Comment the env var added
2019-08-06 19:25:04 +02:00
Alex Crichton
0616062f4f Refactor Azure Pipelines config and tweak releases (#244)
* Refactor Azure Pipelines config and tweak releases

* Extract out doc/rustfmt jobs into their own separate builders. Helps
  avoiding having to skip tons of steps and can get failing results more
  quickly.

* Extract out Rust installation logic to a dedicated template.

* Separate out the build/test job matrices, where one matrix runs tests
  and another runs a full build

* Refactor release directory structure to follow a convention where
  `foo.tar.gz` extracts to a folder called `foo` and follow unix-like
  conventions and copy over the license/readme files into the release
  tarballs.

* Swap order of build/test
2019-08-06 18:27:31 +02:00
Till Schneidereit
95bcc63ff8 Rename 'master' release to 'dev' (#242) 2019-08-06 16:02:13 +02:00
Till Schneidereit
41f88745c4 Update log and libc crates (#240)
* Update log crate

* Update libc crate
2019-08-06 09:01:52 -05:00
Jef
e6a8f19315 Fix miscompilations and other nasty errors 2019-08-05 14:01:48 +02:00
Jakub Konka
5159f93d37 Add Azure Pipelines badge to README (#241) 2019-08-03 22:44:40 +02:00
Till Schneidereit
265bc318ca Publish release bundles to CraneStation/wasmtime (#239) 2019-08-03 17:15:33 +02:00
dependabot-preview[bot]
39654ea175 Update hashbrown requirement from 0.1.8 to 0.5.0 (#206)
Updates the requirements on [hashbrown](https://github.com/rust-lang/hashbrown) to permit the latest version.
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.1.8...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-03 16:50:05 +02:00
Till Schneidereit
a988443422 Set up CI and releases with Azure Pipelines (#237)
This Azure Pipelines setup compiles and tests Wasmtime for Linux, macOS, and Windows.

If the CI run was triggered by a new tag being created, a new release for that tag is created with a changelog relative to the last tag release and archives of the builds for all platforms.

If the CI run was triggered by new commits landing on `master`, the release `latest-master` is updated with a new changelog relative to the last tag release and archives of the new builds for all platforms.

Note: This PR also contains changes to disable a bunch of tests on Windows, which are failing due to issues with signal handling.
2019-08-03 13:41:10 +02:00
Jakub Konka
6797db66a2 Add cargo doc and apply cargo fmt to stable only 2019-08-02 14:15:31 +02:00
Jakub Konka
3e68834938 Remove Travis conf and redundant scripts 2019-08-02 12:17:42 +02:00
Jakub Konka
7bd8d5be98 Update CI status in README 2019-08-02 11:54:16 +02:00
Till Schneidereit
fd787c2c99 Merge pull request #49 from kubkon/azure
Add azure pipelines definition
2019-08-02 11:12:15 +02:00
Jakub Konka
a2b99bb74c Add azure pipelines definition 2019-08-02 10:47:33 +02:00
Jakub Konka
3125dc4a79 Update readlink_no_buffer testcase 2019-08-02 10:43:15 +02:00
Yury Delendik
0bc9d1fe6f Update cranelift to 0.37.0 (#236)
Closed #228, #227, #226, #225, #224
2019-08-01 20:46:34 -05:00
Dan Gohman
1bdec4ca36 Remove cranelift-native dependency from wasmtime-wast. (#216) 2019-08-01 12:21:43 -05:00
dependabot-preview[bot]
320ad7d4b3 Update bindgen requirement from 0.50.0 to 0.51.0 (#222)
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.50.0...v0.51.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-31 11:40:10 -05:00
Andrew Brown
5873f697fc Enable SIMD instructions from the command line (#232)
This change adds an `--enable-simd` flag to the binaries in this project. This allows the ISA `enable_simd` flag to be set and to configure the validation configuration used by wasmparser to allow SIMD instructions.
2019-07-31 09:48:43 -05:00
Yury Delendik
fff0198fb7 Fix RelocationTarget::JumpTable handling in wasm2obj (#195) 2019-07-31 09:41:56 -05:00