Commit Graph

7 Commits

Author SHA1 Message Date
Nuno Cruces
6503e82d3c Follow unsafe rules. (#1449)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
2023-05-09 15:34:08 +01:00
Nuno Cruces
2bf8abe1fe Cleanup scattered documentation TODOs. (#1442)
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
2023-05-08 18:04:02 +01:00
Takeshi Yoneda
d9e5d6b0d3 Avoids unnecessary allocations during mmap executables (#1366)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2023-04-17 14:03:35 +09:00
Crypt Keeper
9a4a372642 renames writefs to syscallfs and implements utimes in gojs (#979)
This renames the internal writefs package to syscallfs as it is largely
dependent on syscall signatures. This also implements utimes in gojs.
WASI will be a follow-up change as it requires more infrastructure.
Notably, we also need non-TinyGo tests because TinyGo doesn't yet
support os.Chtimes or corresponding syscalls.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-12-30 14:18:06 +08:00
Takeshi Yoneda
3b32c2028b Externalize compilation cache by compilers (#747)
This adds the experimental support of the file system compilation cache.
Notably, experimental.WithCompilationCacheDirName allows users to configure
where the compiler writes the cache into.

Versioning/validation of binary compatibility has been done via the release tag
(which will be created from the end of this month). More specifically, the cache
file starts with a header with the hardcoded wazero version.


Fixes #618

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
2022-08-18 19:37:11 +09:00
Crypt Keeper
50d504cfdd Narrows compiler support to operating systems currently known to work (#612)
This narrows to what the `internal/platform` package supports, which is
currently bound by Go SDK source that include `Mprotect` or windows.

Ex. `zsyscall_linux_amd64.go` includes `Mprotect`, but
`zsyscall_freebsd_amd64.go` does not.

This should prevent errors like below, by allowing `wazero.NewRuntime()`
to properly fallback to the interpreter.

```
.../mmap.go:74:16: undefined: syscall.Mprotect
```

A later change will implement FreeBSD. This is just here to ensure users
don't crash on unexpected OS.

See #607

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-06-01 13:49:55 +08:00
Crypt Keeper
e0e9e27326 Extracts platform-specific runtime code into its own package (#608)
This moves the platform-specific runtime code (currently only used by
the compiler) into its own package. Specifically, this moves the mmap
logic, and in doing so makes it easier to test, for example new
operating systems.

This also backfills missing RATIONALE about x/sys and hints at a future
possibility to allow a plugin. However, the next step is to get FreeBSD
working natively on the compiler without any additional dependencies.

See #607

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-06-01 09:24:02 +08:00