-
Notifications
You must be signed in to change notification settings - Fork 34
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
Windows support #843
base: master
Are you sure you want to change the base?
Windows support #843
Conversation
@@ -25,7 +25,7 @@ if(NOT CMAKE_CONFIGURATION_TYPES) | |||
endif() | |||
|
|||
HunterGate( | |||
URL https://github.com/cpp-pm/hunter/archive/v0.23.294.tar.gz | |||
SHA1 0dd1ee8723d54a15822519c17a877c1f281fce39 | |||
URL https://github.com/cpp-pm/hunter/archive/v0.24.13.tar.gz |
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.
Need to update to 0.23.371 at least in order to support MSVC 2022.
HUNTER_INSTALL_LICENSE_FILES=LICENSE | ||
gtest_force_shared_crt=TRUE | ||
) | ||
#hunter_config( |
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.
The newer Hunter contains this.
@@ -31,22 +31,22 @@ template <typename T> | |||
inline T read(const uint8_t*& input) noexcept | |||
{ | |||
T ret; | |||
__builtin_memcpy(&ret, input, sizeof(ret)); | |||
memcpy(&ret, input, sizeof(ret)); |
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.
To be fixed.
lib/fizzy/parser.cpp
Outdated
@@ -455,8 +456,8 @@ inline parser_result<Data> parse(const uint8_t* pos, const uint8_t* end) | |||
|
|||
std::unique_ptr<const Module> parse(bytes_view input) | |||
{ | |||
if (input.substr(0, wasm_prefix.size()) != wasm_prefix) | |||
throw parser_error{"invalid wasm module prefix"}; | |||
// if (input.substr(0, wasm_prefix.size()) != wasm_prefix) |
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.
To be fixed.
@@ -12,6 +12,14 @@ set(include_dir ${source_dir}/include) | |||
set(uvwasi_library ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}uvwasi_a${CMAKE_STATIC_LIBRARY_SUFFIX}) | |||
set(uv_library ${binary_dir}/_deps/libuv-build/${CMAKE_STATIC_LIBRARY_PREFIX}uv_a${CMAKE_STATIC_LIBRARY_SUFFIX}) | |||
|
|||
# This is hack. Should fix proper uvwasi.cmake integration. |
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.
Theses are imported in https://github.com/nodejs/uvwasi/blob/master/cmake/FindLibUV.cmake, but we do a botched job at cmake-integrating uvwasi.
lib/fizzy/capi.cpp
Outdated
@@ -8,6 +8,8 @@ | |||
#include "instantiate.hpp" | |||
#include "parser.hpp" | |||
#include <fizzy/fizzy.h> | |||
#include <algorithm> | |||
#include <iterator> |
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.
For back_inserter
and some other case I forgot.
@@ -16,7 +16,7 @@ namespace | |||
template <typename T> | |||
inline void store(uint8_t* dst, T value) noexcept | |||
{ | |||
__builtin_memcpy(dst, &value, sizeof(value)); | |||
memcpy(dst, &value, sizeof(value)); |
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.
CWE 805 advisory: suspicious sizeof in strncpy, strncat or memcpy
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -16,7 +16,7 @@ namespace fizzy::test | |||
class WabtEngine final : public WasmEngine | |||
{ | |||
// mutable because getting RefPtr from Ref requires non-const Store | |||
mutable wabt::interp::Store m_store{([]() constexpr noexcept { | |||
mutable wabt::interp::Store m_store{([]() noexcept { | |||
wabt::Features features; | |||
features.disable_multi_value(); |
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.
These are not constexpr
: https://github.com/WebAssembly/wabt/blob/1.0.19/src/feature.h#L39
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.
Found by MSVC:
[48/103] Building CXX object test\utils\CMakeFiles\test-utils.dir\wabt_engine.cpp.obj
FAILED: test/utils/CMakeFiles/test-utils.dir/wabt_engine.cpp.obj
C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1433~1.316\bin\Hostx64\x64\cl.exe /nologo /TP -IC:\Users\circleci.PACKER-633B1A5A\project -IC:\Users\circleci.PACKER-633B1A5A\project\lib\fizzy -IC:\Users\circleci.PACKER-633B1A5A\project\include -external:IC:\Users\circleci.PACKER-633B1A5A\build\_deps\src\wabt -external:IC:\Users\circleci.PACKER-633B1A5A\build\_deps\src\wabt-build -external:IC:\Users\circleci.PACKER-633B1A5A\build\_deps\src\wasm3 -external:IC:\Users\circleci.PACKER-633B1A5A\.hunter\_Base\2bc7384\4753fe5\c0cf92b\Install\include -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /O2 /Ob2 /DNDEBUG -MD /W4 /WX /wd4068 -std:c++20 /showIncludes /Fotest\utils\CMakeFiles\test-utils.dir\wabt_engine.cpp.obj /Fdtest\utils\CMakeFiles\test-utils.dir\test-utils.pdb /FS -c C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(19): error C3615: constexpr function 'fizzy::test::WabtEngine::<lambda_1>::operator ()' cannot result in a constant expression
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(21): note: failure was caused by call of undefined function or one not declared 'constexpr'
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(21): note: see usage of 'wabt::Features::disable_multi_value'
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(22): note: failure was caused by call of undefined function or one not declared 'constexpr'
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(22): note: see usage of 'wabt::Features::disable_sat_float_to_int'
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(23): note: failure was caused by call of undefined function or one not declared 'constexpr'
C:\Users\circleci.PACKER-633B1A5A\project\test\utils\wabt_engine.cpp(23): note: see usage of 'wabt::Features::disable_sign_extension'
[49/103] Building CXX object test\utils\CMakeFiles\test-utils.dir\asserts.cpp.obj
``
Last piece waiting is fixing the patch system for wasm3 or fixing+merging #739. |
$ErrorActionPreference = "Stop" | ||
& 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' -Arch amd64 | ||
which cmake | ||
cmake -S . -B ~/build -G Ninja -DCMAKE_INSTALL_PREFIX=C:\install -DCMAKE_CXX_STANDARD=20 -DFIZZY_TESTING=ON |
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.
C++20 is forced here.
Closes #544.