Age | Commit message (Collapse) | Author |
|
There is no need to initialize it twice.
|
|
These should make sure basic functionality is still working.
Using the `-short` flag to avoid taking too long to run all tests (and
to install all the necessary emulators), and because some targets might
not work in older Go/LLVM versions (such as WASI).
This does _not_ run tests and checks against expected IR, because LLVM
IR changes a lot across versions.
|
|
This is needed for the internal/syscall/unix package.
Signed-off-by: leongross <[email protected]>
|
|
It looks like this breaks on Windows:
https://github.com/tinygo-org/tinygo/issues/4557
I haven't confirmed this is indeed the problem, but it would make sense.
And passing through the temporary directory seems like a good idea
regardless, there's not much that could break due to that.
|
|
Use a single package for certain constants that must be the same between
the compiler and the runtime.
While just using the same values in both places works, this is much more
obvious and harder to mess up. It also avoids the need for comments
pointing to the other location the constant is defined. And having it in
code makes it possible for IDEs to analyze the source.
In the future, more such constants and maybe algorithms can be added.
|
|
Signed-off-by: sivchari <[email protected]>
|
|
|
|
This avoids needing to rename them ourselves (which is kinda annoying)
and also avoids mistakes in the process.
|
|
This is similar to https://github.com/tinygo-org/tinygo/pull/3899, but
smaller and hopefully just as efficient.
Thanks to @HattoriHanzo031 for starting this work, benchmarking, and for
improving the performance of the code even further.
|
|
|
|
|
|
Value.Convert
|
|
The git hash that's part of `tinygo version` is now read from the binary
itself instead of embedding it with a `-ldflags` flag. This means it is
also present when building TinyGo using `go build` or `go install`.
|
|
Instead of hanging forever, it should return the exit code from os.Exit.
|
|
This fixes a bug where `//go:wasmexport` functions would not be allowed
anymore after a call to `time.Sleep` (when using `-buildmode=default`).
|
|
This is now fixed for every target in the previous commit.
Also see: https://github.com/tinygo-org/tinygo/pull/4239
|
|
There are rare cases where this can happen, see for example
https://github.com/tinygo-org/tinygo/issues/4568
|
|
Signed-off-by: leongross <[email protected]>
|
|
* internal/wasm-tools, internal/cm: update wasm-tools-go to v0.3.1 and regenerate bindings
* syscall: use new (cm.Result).Result() method instead of OK() and Err()
|
|
|
|
Signed-off-by: Joonas Bergius <[email protected]>
|
|
This is rare, but apparently some programs do this:
defer panic("...")
This is emitted in the IR as a builtin function.
|
|
This avoids some weird behavior when the -extldflags flag cannot be
parsed by TinyGo.
|
|
The alignment wasn't set, so defaulted to 4 (for a 32-bit int). LLVM saw
this, and therefore assumed that a ptrtoint of the pointer would have
had the lowest bits unset. That's an entirely valid optimization, except
that we are using these globals for arbitrary values (and aren't
actually using these globals).
Fixed by setting alignment to 1. It works, though long-term we should
maybe find a different solution for this.
|
|
This was a problem on wasm, where node would exit with a non-zero exit
code when there was a panic.
|
|
|
|
|
|
Volatile loads/stors are only useful for communication with interrupts
or for memory-mapped I/O. They do not provide any sort of safety for
sync.Mutex, while making it *appear* as if it is more safe.
* `sync.Mutex` cannot be used safely inside interrupts, because any
blocking calls (including `Lock`) will cause a runtime panic.
* For multithreading, `volatile` is also the wrong choice. Atomic
operations should be used instead, and the current code would not
work for multithreaded programs anyway.
|
|
Unlike Windows, we can just use the default shell here.
|
|
|
|
This makes it easier to find what actually went wrong in CI.
This flag was added in #4431, I think it was unintentional.
|
|
Every time we overflow the stack, we have to do a full rescan of the heap. Making this larger
means fewer overflows and thus fewer secondary+ heap scans.
|
|
|
|
|
|
|
|
This adds support for enabling and listening to signals on Linux and
MacOS.
|
|
With a few small modifications, all the problems with `-gc=precise` in
WebAssembly seem to have been fixed.
I didn't do any performance measurements, but this is supposed to
improve GC performance.
|
|
compiler: align with current wasm types proposal
https://github.com/golang/go/issues/66984
- Remove int and uint as allowed types in params, results, pointers, or struct fields
- Only allow small integers in pointers, arrays, or struct fields
- enforce structs.HostLayout usage per wasm types proposal
https://github.com/golang/go/issues/66984
- require go1.23 for structs.HostLayout
- use an interface to check if GoVersion() exists
This permits TinyGo to compile with Go 1.21.
- use goenv.Compare instead of WantGoVersion
- testdata/wasmexport: use int32 instead of int
- compiler/testdata: add structs.HostLayout
- compiler/testdata: improve tests for structs.HostLayout
|
|
|
|
I've had this board for a while now, but never added proper TinyGo
support. So here is a PR to do just that.
|
|
These boards probably haven't been working since the addition of I2C,
because they were missing some constants in the machine package.
|
|
This is needed to support switching between input and output.
|
|
strings (#4536)
goenv: parse patch version, add func Compare to compare two Go version strings
* Parse tests
* add Compare function to compare two Go version strings
* goenv, builder: parse patch version in Go version string
|
|
|
|
|
|
I am not entirely sure what it's doing (it seems related to js.FuncOf),
but tests still seem to pass when this code is removed. So let's remove
it.
|
|
While there are some browser tests, Node.js is just a lot better for
testing this kind of stuff because it's much faster and we don't need a
browser for this.
|
|
The macos-12 runner is being deprecated, so we have to switch to a new
runner: https://github.com/actions/runner-images/issues/10721
The next one is macos-13, which is still amd64.
|
|
|
|
Fixes #4525
|