-
Notifications
You must be signed in to change notification settings - Fork 951
internal/task: use asyncify on WASM #2011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,9 @@ commands: | |
qemu-system-arm \ | ||
qemu-user \ | ||
gcc-avr \ | ||
avr-libc | ||
avr-libc \ | ||
cmake \ | ||
ninja-build | ||
install-node: | ||
steps: | ||
- run: | ||
|
@@ -49,6 +51,13 @@ commands: | |
command: | | ||
curl https://wasmtime.dev/install.sh -sSf | bash | ||
sudo ln -s ~/.wasmtime/bin/wasmtime /usr/local/bin/wasmtime | ||
install-cmake: | ||
steps: | ||
- run: | ||
name: "Install CMake" | ||
command: | | ||
wget https://github.com/Kitware/CMake/releases/download/v3.21.4/cmake-3.21.4-linux-x86_64.tar.gz | ||
sudo tar --strip-components=1 -C /usr/local -xf cmake-3.21.4-linux-x86_64.tar.gz | ||
install-xtensa-toolchain: | ||
parameters: | ||
variant: | ||
|
@@ -76,6 +85,39 @@ commands: | |
- llvm-project/clang/include | ||
- llvm-project/lld/include | ||
- llvm-project/llvm/include | ||
hack-ninja-jobs: | ||
steps: | ||
- run: | ||
name: "Hack Ninja to use less jobs" | ||
command: | | ||
echo -e '#!/bin/sh\n/usr/bin/ninja -j3 "$@"' > /go/bin/ninja | ||
chmod +x /go/bin/ninja | ||
build-binaryen-linux: | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- binaryen-linux-v1 | ||
- run: | ||
name: "Build Binaryen" | ||
command: | | ||
make binaryen | ||
- save_cache: | ||
key: binaryen-linux-v1 | ||
paths: | ||
- build/wasm-opt | ||
build-binaryen-linux-stretch: | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- binaryen-linux-stretch-v1 | ||
- run: | ||
name: "Build Binaryen" | ||
command: | | ||
CC=$PWD/llvm-build/bin/clang make binaryen | ||
- save_cache: | ||
key: binaryen-linux-stretch-v1 | ||
paths: | ||
- build/wasm-opt | ||
build-wasi-libc: | ||
steps: | ||
- restore_cache: | ||
|
@@ -100,6 +142,8 @@ commands: | |
- install-node | ||
- install-chrome | ||
- install-wasmtime | ||
- hack-ninja-jobs | ||
- build-binaryen-linux | ||
- restore_cache: | ||
keys: | ||
- go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }} | ||
|
@@ -141,9 +185,13 @@ commands: | |
qemu-system-arm \ | ||
qemu-user \ | ||
gcc-avr \ | ||
avr-libc | ||
avr-libc \ | ||
ninja-build \ | ||
python3 | ||
Comment on lines
+189
to
+190
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
- install-node | ||
- install-wasmtime | ||
- install-cmake | ||
- hack-ninja-jobs | ||
- install-xtensa-toolchain: | ||
variant: "linux-amd64" | ||
- restore_cache: | ||
|
@@ -159,14 +207,9 @@ commands: | |
command: | | ||
if [ ! -f llvm-build/lib/liblldELF.a ] | ||
then | ||
# fetch LLVM source | ||
# fetch LLVM source (may only have headers right now) | ||
rm -rf llvm-project | ||
make llvm-source | ||
# install dependencies | ||
sudo apt-get install cmake ninja-build | ||
# hack ninja to use less jobs | ||
echo -e '#!/bin/sh\n/usr/bin/ninja -j3 "$@"' > /go/bin/ninja | ||
chmod +x /go/bin/ninja | ||
# build! | ||
make ASSERT=1 llvm-build | ||
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \; | ||
|
@@ -175,6 +218,7 @@ commands: | |
key: llvm-build-11-linux-v4-assert | ||
paths: | ||
llvm-build | ||
- build-binaryen-linux-stretch | ||
- run: make ASSERT=1 | ||
- build-wasi-libc | ||
- run: | ||
|
@@ -206,9 +250,13 @@ commands: | |
qemu-system-arm \ | ||
qemu-user \ | ||
gcc-avr \ | ||
avr-libc | ||
avr-libc \ | ||
ninja-build \ | ||
python3 | ||
Comment on lines
+254
to
+255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here. |
||
- install-node | ||
- install-wasmtime | ||
- install-cmake | ||
- hack-ninja-jobs | ||
- install-xtensa-toolchain: | ||
variant: "linux-amd64" | ||
- restore_cache: | ||
|
@@ -224,14 +272,9 @@ commands: | |
command: | | ||
if [ ! -f llvm-build/lib/liblldELF.a ] | ||
then | ||
# fetch LLVM source | ||
# fetch LLVM source (may only have headers right now) | ||
rm -rf llvm-project | ||
make llvm-source | ||
# install dependencies | ||
sudo apt-get install cmake ninja-build | ||
# hack ninja to use less jobs | ||
echo -e '#!/bin/sh\n/usr/bin/ninja -j3 "$@"' > /go/bin/ninja | ||
chmod +x /go/bin/ninja | ||
# build! | ||
make llvm-build | ||
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \; | ||
|
@@ -240,6 +283,7 @@ commands: | |
key: llvm-build-11-linux-v4-noassert | ||
paths: | ||
llvm-build | ||
- build-binaryen-linux-stretch | ||
- build-wasi-libc | ||
- run: | ||
name: "Test TinyGo" | ||
|
@@ -283,7 +327,7 @@ commands: | |
curl https://dl.google.com/go/go1.17.darwin-amd64.tar.gz -o go1.17.darwin-amd64.tar.gz | ||
sudo tar -C /usr/local -xzf go1.17.darwin-amd64.tar.gz | ||
ln -s /usr/local/go/bin/go /usr/local/bin/go | ||
HOMEBREW_NO_AUTO_UPDATE=1 brew install qemu | ||
HOMEBREW_NO_AUTO_UPDATE=1 brew install qemu cmake ninja | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here. |
||
- install-xtensa-toolchain: | ||
variant: "macos" | ||
- restore_cache: | ||
|
@@ -311,11 +355,9 @@ commands: | |
command: | | ||
if [ ! -f llvm-build/lib/liblldELF.a ] | ||
then | ||
# fetch LLVM source | ||
# fetch LLVM source (may only have headers right now) | ||
rm -rf llvm-project | ||
make llvm-source | ||
# install dependencies | ||
HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake ninja | ||
# build! | ||
make llvm-build | ||
find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \; | ||
|
@@ -324,6 +366,20 @@ commands: | |
key: llvm-build-11-macos-v5 | ||
paths: | ||
llvm-build | ||
- restore_cache: | ||
keys: | ||
- binaryen-macos-v1 | ||
- run: | ||
name: "Build Binaryen" | ||
command: | | ||
if [ ! -f build/wasm-opt ] | ||
then | ||
make binaryen | ||
fi | ||
- save_cache: | ||
key: binaryen-macos-v1 | ||
paths: | ||
- build/wasm-opt | ||
- restore_cache: | ||
keys: | ||
- wasi-libc-sysroot-macos-v4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see you've moved the .gitignore line into a separate file in the build directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I needed to keep the |
||
docs/_build | ||
src/device/avr/*.go | ||
src/device/avr/*.ld | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do this installation only when these tools are needed in the build-binaryen step? That speeds up the CI in the common case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this like this for 2 reasons:
I guess I could potentially restore both caches before installing, although it seems to make this build config a lot more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to only make CI 1 second slower. I don't think the extra complexity is worthwhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you measure this? It seems rather unlikely that installing software is that fast.
(If it is really just 1 second, then installing it unconditionally would be fine).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at 2 a build on the
dev
branch and a build from this PR. The "install apt dependencies steps" took 22 seconds on this PR and 23 seconds on the dev branch. Looking through more CI runs ondev
now I see a lot more variation, but the difference in download size is 180 MB to 186 MB which gives me a seemingly appropriate estimate of 3%. These packages are relatively small compared to the other packages which we install.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Well maybe it is fine then. We can revisit this later, especially when we move away from Debian stretch.