Commit Graph

2269 Commits

Author SHA1 Message Date
Jakub Konka
8ee4bed226 Add testcase for fd_seek and fd_tell 2019-07-22 16:05:30 -07:00
Jakub Konka
919262b5b9 Make fd_tell host independent 2019-07-22 16:05:30 -07:00
Jakub Konka
5bbf59e1c5 Make fd_seek host independent 2019-07-22 16:05:30 -07:00
Jakub Konka
0d571a4e6d Move extracting fds from context into hostcalls 2019-07-22 15:56:46 -07:00
Jakub Konka
14391bab56 Clean up more hostcalls 2019-07-22 15:56:46 -07:00
Jakub Konka
13823e2b39 Clean up fd_renumber 2019-07-22 15:56:46 -07:00
Jakub Konka
310ecb5b5b Create helper Result<T> type 2019-07-22 15:56:46 -07:00
Marcin Mielniczuk
a264787897 Enable __chkstk only on MSVC compilers, use ___chkstk on MinGW 2019-07-19 13:13:13 -07:00
Jakub Konka
08aa61f066 WASI paths as &str and String (#37)
* Check if RawString operates on valid encodings

* Use &str and String for WASI paths
2019-07-19 11:09:27 -07:00
Dan Gohman
19e4f42d50 Fix compilation of wasmtime-environ from within wasmtime-jit. (#201)
* Fix compilation of wasmtime-environ from within wasmtime-jit.

Enable wasmtime-environ/std when wasmtime-jit's std feature is enabled.

Fixes #200.

* Fix wasmtime-debug build too.
2019-07-19 11:01:27 -07:00
Artur Jamro
c80508c8a9 Make the calls to wasm's memory.grow and memory.size indirect (#194)
* Make the calls to wasm's memory.grow and memory.size indirect
2019-07-18 14:40:03 -07:00
Yury Delendik
d27d190b74 reverse dependency
https://github.com/CraneStation/wasmtime/pull/186#discussion_r302780035
2019-07-16 17:15:02 -07:00
Yury Delendik
748abd97d6 https://github.com/CraneStation/wasmtime/pull/186#discussion_r302781231 2019-07-16 17:15:02 -07:00
Yury Delendik
5362bd1a23 Improve performance of BTreeMap::search().last() 2019-07-16 17:15:02 -07:00
Yury Delendik
cafe821f24 Properly collect/identify used DWARF entries. 2019-07-16 17:15:02 -07:00
Yury Delendik
efe9dd7b86 Update gimli version; refactor debug data structures 2019-07-16 17:15:02 -07:00
Jakub Konka
c3994bf57b Use Travis for Win builds as well 2019-07-16 08:41:20 +02:00
Jakub Konka
adadf835f0 Bump required Rust version to 1.36 2019-07-15 15:51:31 -07:00
Jakub Konka
1531fabf43 Update wasmtime-wasi to new wasi-common interface 2019-07-15 15:36:12 -07:00
Jakub Konka
667f272edd Rewrite majority of impl reusing libstd (#34)
* Rewrite FdEntry reusing as much libstd as possible

* Use the new FdEntry, FdObject, Descriptor struct in *nix impl

* Adapt Windows impl

* Remove unnecessary check in fd_read

Check `host_nread == 0` caused premature FdEntry closure and removal
which ultimately was resulting in an attempt at "double closing" of
the same file descriptor at the end of the Wasm program:
...
fd_close(fd=4)
    -> errno=WASI_ESUCCESS
fd_close(fd=4)
    -> errno=WASI_EBADF

* Use libstd vectored IO

* Use std:🧵:yield_now to implement sched_yield

* Add logging to integration tests

* Add preliminary support for host-specific errors

* Operate on std::fs::File in path_get on *nix

* Add cross-platform RawString type encapsulating OsStrExt

* Fix Windows build

* Update Travis and README to Rust v1.36

* Remove unused winx::handle::close helper

* Refactor Descriptor into raw handles/fds

* Strip readlinkat in prep for path_get host-independent

* Strip openat in prep for path_get host-independent

* Move ManuallyDrop up one level from Descriptor to FdObject

* Make (c)iovec host fns unsafe

* Swap unwraps/expects for Results in fdentry_impl on nix

* Rewrite fd_pread/write and implement for Win

* Use File::sync_all to impl fd_sync

* Use File::sync_data to impl fd_datasync

* Rewind file cursor after fd_p{read, write} on Windows

* Add fd_p{read, write} tests

* Handle errors instead of panicking in path_get

* Use File::set_len to impl fd_allocate

* Add test for fd_allocate

* Replace all panics with Results

* Document the point of RawString
2019-07-15 15:34:28 -07:00
Jef
7cc6a1d9f3 Fix stack depth in rem, update cranelift-codegen 2019-07-11 13:10:47 +02:00
Dan Gohman
6b7ebfdddc Rust 1.36, with wasm32-wasi support, is now stable! 2019-07-10 12:27:21 -07:00
Jef
f53dc0b309 Fix problems found by fuzzing 2019-07-08 13:52:10 +02:00
Dan Gohman
9d91a937dc Update wasmtime-wasi-c to cloudabi-utils 223dadc5.
We already had a forward-port of d5abd351d, so this just contains a
minor and unobservable bug fix.
2019-07-06 07:18:36 +02:00
Jakub Konka
93e1657bae Update cranelift 2019-07-05 16:51:54 +02:00
Dan Gohman
1a10f4a002 Update to Cranelift 1.33 and require Rust 1.35.
Cranelift requires Rust 1.35; update accordingly.
2019-07-03 11:16:55 -07:00
Salim Shaaban Salim
89cd327c97 Print correct version of bin tools (#183)
* Print correct version of bin tools

Not something important, but I use these tools for some testing and
they print wrong version with --version flag.
2019-07-03 11:12:32 -07:00
Yury Delendik
210e959333 Allow jump tables in wasmtime. 2019-07-02 14:07:30 -07:00
Yury Delendik
fb9d6061e4 Update cranelift, faerie, target-lexicon and wasmparser deps 2019-07-02 14:07:30 -07:00
Yury Delendik
8b9c170a91 Update cranelift (v0.32) and wasmparser deps 2019-07-02 15:58:41 -05:00
Dan Gohman
e3c021cc59 Downgrade memoffset to 0.2.1.
Version 0.3.0 was yanked from crates.io.
2019-07-02 13:27:03 -07:00
Jakub Konka
b4280d6cd6 Use ManuallyDrop instead of forget 2019-07-02 12:52:27 -07:00
Jakub Konka
7287767a3f Add enough Windows functionality to run WASI tutorial (#22)
* Add partial impl of determine_type_rights fn

* Add draft of fd_fdstat_get hostcall

* Add writev wrapper for writing IoVec in RawHandle

* Move IoVec and writev to separate helper crate

* Add Win error handling

Clean up closing and duplicating RawHandle

* Wrap Win file type result

* Add draft impl of fd_close and fd_read

* Refactor getting file access rights

* Remove winapi from the main Cargo.toml

* Add very rough draft of open_path (very incomplete)

* Clean up WinError with macro

* Ignore dir handle in openat if path absolute

* Decode oflags and advance open_path hostcall

* Clean up AccessRight and FlagsAndAttributes flags

* Implement path_get (without symlink expansion yet!)

* Add ShareMode and fix path_get for nested paths

* Add some error mappings between Win and WASI

* Clean up fdflags conversions

* Fix sharing violation when calling openat at '.'

* Apply Alex's fix of using ManuallyDrop instead forget

* Clean up

* Explicitly specify workspace to avoid comp errors at tests
2019-06-27 17:10:15 -07:00
Jakub Konka
22c69f46f9 Use build.rs to generate test cases automatically
Now, test binaries are bundled with the repo, and
just like in CraneStation/wasmtime, the test cases
are generated automatically using build.rs. So all
it takes is to drop a new test binary in the
testsuite dir to get the test case for it generated
(with some caveats to do with handling preopens).
2019-06-26 15:24:21 -07:00
Jakub Konka
656112d00b Patch wasmtime-wasi to use this wasi-common version 2019-06-26 15:24:21 -07:00
Jakub Konka
81b673f908 Fix typos 2019-06-26 15:24:21 -07:00
Jakub Konka
b9c04d431f Move workspace creation outside of runtime instantiation 2019-06-26 15:24:21 -07:00
Jakub Konka
d0eac815f0 Fix Windows CI 2019-06-26 15:24:21 -07:00
Jakub Konka
ae63b33a23 Refactor 2019-06-26 15:24:21 -07:00
Jakub Konka
20d228f29e Modify test-all.sh script 2019-06-26 15:24:21 -07:00
Jakub Konka
982dbab1f2 Add misc-tests as a submodule dep 2019-06-26 15:24:21 -07:00
Jakub Konka
6ca01ce546 Add wasmtime as default runtime for integration tests 2019-06-26 15:24:21 -07:00
Yury Delendik
d52ab02835 Fix skipping dead DWARF records 2019-06-26 14:26:26 -07:00
Yury Delendik
19cfec6e8f Ignore non-existent refs in the transformed DWARF 2019-06-26 14:25:45 -07:00
Dan Gohman
c0ba4753eb Enable wasi-common by default (#177)
This removes the --wasi-common, as it's now on by default, and adds a
--wasi-c option to enable the wasi-c implementation.
2019-06-25 02:05:49 -07:00
Jakub Konka
513429f1b8 Port trace log from wasmtime-wasi-c crate 2019-06-24 22:47:41 +02:00
Jakub Konka
dc05d89a08 Fix path_readlink: with a 0-sized buffer should succeed 2019-06-24 11:54:18 -07:00
Jakub Konka
7fef91c1e4 Fix fd_renumber when trying to renumber a preopen 2019-06-24 11:54:18 -07:00
Jakub Konka
a11f2b1d3a Refactor path_get and fix flags in path_open 2019-06-24 11:54:18 -07:00
Jakub Konka
b35719fe4a Add fixes so that misc-tests pass 2019-06-24 11:54:18 -07:00