Skip to content

v8: fix build on Windows. #211

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

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6814b83
build: test V8 on Windows.
PiotrSikora Jan 5, 2022
03dd53f
review: take #2.
PiotrSikora Jan 5, 2022
ff5f393
review: /Zm1000 and :generated_inspector_files.
PiotrSikora Jan 5, 2022
7061fad
review: update V8 to v9.9.62.
PiotrSikora Jan 6, 2022
2870761
Merge remote-tracking branch 'origin/master' into PiotrSikora/build_win
PiotrSikora Jan 6, 2022
87dfbb2
review: move "cmd" to bash script.
PiotrSikora Jan 6, 2022
fa15d1f
review: fix typo.
PiotrSikora Jan 6, 2022
ed687dc
review: add "cmd_ps" for Windows.
PiotrSikora Jan 6, 2022
d3945ba
review: fixup.
PiotrSikora Jan 6, 2022
c11699e
review: fixup.
PiotrSikora Jan 6, 2022
670b0d2
review: debug.
PiotrSikora Jan 6, 2022
6b00bbb
review: trace.
PiotrSikora Jan 6, 2022
da6e8e1
review: debug.
PiotrSikora Jan 6, 2022
920c0ca
review: enable runfiles.
PiotrSikora Jan 6, 2022
363ffca
review: quote command.
PiotrSikora Jan 6, 2022
ec4432c
review: more quotes...
PiotrSikora Jan 6, 2022
8513c27
review: Start-Process.
PiotrSikora Jan 6, 2022
aea5378
review: cmd.exe.
PiotrSikora Jan 6, 2022
7084521
review: fix slashes.
PiotrSikora Jan 6, 2022
e14f747
review: Get-ItemProperty.
PiotrSikora Jan 6, 2022
1ef0c44
review: update patchset.
PiotrSikora Jan 6, 2022
09051db
review: fixup.
PiotrSikora Jan 6, 2022
7ae0505
review: update V8 to v9.9.67 and regenerate patches.
PiotrSikora Jan 7, 2022
c740d2f
Merge remote-tracking branch 'origin/master' into PiotrSikora/build_win
PiotrSikora Jan 11, 2022
05c3677
review: revert --enable_runfiles.
PiotrSikora Jan 11, 2022
e2926f1
review: add /DEBUG:FULL on Windows.
PiotrSikora Jan 11, 2022
85dc6b2
review: add trailing comma.
PiotrSikora Jan 11, 2022
6a0e978
review: generate torque files in a separate step.
PiotrSikora Jan 11, 2022
28deaac
review: fix conditional steps.
PiotrSikora Jan 11, 2022
5bbdbb6
review: run only Windows build during testing.
PiotrSikora Jan 11, 2022
0ed058e
review: test different /DEBUG values.
PiotrSikora Jan 11, 2022
28a79ff
review: test /Zi.
PiotrSikora Jan 11, 2022
f6c2dbe
review: try --copt.
PiotrSikora Jan 11, 2022
8fbf0dc
review: try Wasmtime.
PiotrSikora Jan 11, 2022
3768cbd
Revert "review: try Wasmtime."
PiotrSikora Jan 13, 2022
5f362de
Merge remote-tracking branch 'origin/master' into PiotrSikora/build_win
PiotrSikora Jan 13, 2022
ea3903f
review: multiline fix?
PiotrSikora Jan 12, 2022
339c787
review: add some Windows hacks.
PiotrSikora Jan 13, 2022
a320f10
review: fix multiline.
PiotrSikora Jan 13, 2022
be11885
Merge remote-tracking branch 'origin/master' into PiotrSikora/build_win
PiotrSikora Jan 28, 2022
8512d9b
review: add /bigobj.
PiotrSikora Jan 28, 2022
f2d0760
review: drop cache.
PiotrSikora Jan 28, 2022
8f05b31
review: fix typo.
PiotrSikora Jan 28, 2022
b5271b6
Merge remote-tracking branch 'origin/master' into PiotrSikora/build_win
PiotrSikora Feb 18, 2022
5b41ac5
review: use bash.
PiotrSikora Feb 18, 2022
7ee8e84
review: try /Os.
PiotrSikora Feb 18, 2022
17cdf3b
review: try /O1, drop /DEBUG:FULL.
PiotrSikora Feb 18, 2022
a56b8ce
Merge remote-tracking branch 'origin/master' into PiotrSikora/build_win
PiotrSikora Feb 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 24 additions & 86 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,97 +117,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: 'NullVM on Linux/x86_64'
engine: 'null'
os: ubuntu-20.04
arch: x86_64
action: test
flags: --config=gcc
- name: 'NullVM on Windows/x86_64'
engine: 'null'
os: windows-2019
arch: x86_64
action: test
- name: 'V8 on Linux/x86_64'
engine: 'v8'
repo: 'v8'
os: ubuntu-20.04
arch: x86_64
action: test
flags: --config=clang --define=crypto=system
cache: true
- name: 'V8 on Linux/aarch64'
- name: 'V8 on Windows/x86_64'
engine: 'v8'
repo: 'v8'
os: ubuntu-20.04
arch: aarch64
action: test
flags: --config=zig-cc-linux-aarch64 --@v8//bazel/config:v8_target_cpu=arm64
deps: qemu-user-static libc6-arm64-cross
cache: true
- name: 'V8 on macOS/x86_64'
engine: 'v8'
repo: 'v8'
os: macos-11
arch: x86_64
action: test
cache: true
- name: 'WAMR on Linux/x86_64'
engine: 'wamr'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: ubuntu-20.04
arch: x86_64
action: test
flags: --config=clang
- name: 'WAMR on macOS/x86_64'
engine: 'wamr'
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
os: macos-11
arch: x86_64
action: test
- name: 'Wasmtime on Linux/x86_64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: x86_64
action: test
flags: --config=clang
- name: 'Wasmtime on Linux/aarch64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: aarch64
action: build
flags: --config=zig-cc-linux-aarch64
deps: qemu-user-static libc6-arm64-cross
- name: 'Wasmtime on Linux/s390x'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: s390x
action: test
flags: --config=clang
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-5.0.0-clang-13-gcc-11
cache: true
- name: 'Wasmtime on macOS/x86_64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: macos-11
arch: x86_64
action: test
- name: 'Wasmtime on Windows/x86_64'
engine: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: windows-2019
arch: x86_64
action: test
- name: 'WAVM on Linux/x86_64'
engine: 'wavm'
repo: 'com_github_wavm_wavm'
os: ubuntu-20.04
arch: x86_64
action: test
flags: --config=clang
cache: true

steps:
Expand All @@ -223,6 +138,7 @@ jobs:

- name: Set cache key
if: ${{ matrix.cache }}
shell: bash
run: echo "::set-output name=uniq::$(bazel query --output build //external:${{ matrix.repo }} | grep -E 'sha256|commit' | cut -d\" -f2)"
id: cache-key

Expand Down Expand Up @@ -252,6 +168,28 @@ jobs:
echo "filegroup(name = \"$i\", srcs = [\"$i.wasm\"])" >> test/test_data/BUILD; \
done

- name: Generate V8 inspector files
if: ${{ matrix.engine == 'v8' }}
run: >
${{ matrix.run_under }}
bazel build
--verbose_failures
--test_output=errors
--define engine=${{ matrix.engine }}
${{ matrix.flags }}
@v8//:generated_inspector_files

- name: Generate V8 torque files
if: ${{ matrix.engine == 'v8' }}
run: >
${{ matrix.run_under }}
bazel build
--verbose_failures
--test_output=errors
--define engine=${{ matrix.engine }}
${{ matrix.flags }}
@v8//:noicu/generated_torque_files

- name: Bazel build/test
run: >
${{ matrix.run_under }}
Expand Down
13 changes: 13 additions & 0 deletions bazel/external/v8.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 1. Disable pointer compression (limits the maximum number of WasmVMs).
# 2. Don't expose Wasm C API (only Wasm C++ API).
# 3. Fix linking on Windows.

diff --git a/BUILD.bazel b/BUILD.bazel
index 5fb10d3940..a19930d36e 100644
Expand All @@ -14,6 +15,18 @@ index 5fb10d3940..a19930d36e 100644
)

# Default setting for v8_enable_pointer_compression.
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 0e9559a65f..c289f3e866 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -137,6 +137,7 @@ def _default_args():
],
"@v8//bazel/config:is_windows": [
"/std:c++17",
+ "/O1",
],
"//conditions:default": [],
}) + select({
diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc
index ce3f569fd5..dc8a4c4f6a 100644
--- a/src/wasm/c-api.cc
Expand Down