Skip to content

Windows support#843

Draft
axic wants to merge 22 commits intomasterfrom
ci-windows
Draft

Windows support#843
axic wants to merge 22 commits intomasterfrom
ci-windows

Conversation

@axic
Copy link
Copy Markdown
Member

@axic axic commented Jan 5, 2023

Closes #544.

Comment thread cmake/Hunter/init.cmake
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
Copy link
Copy Markdown
Member Author

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.

Comment thread cmake/Hunter/config.cmake
HUNTER_INSTALL_LICENSE_FILES=LICENSE
gtest_force_shared_crt=TRUE
)
#hunter_config(
Copy link
Copy Markdown
Member Author

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.

Comment thread lib/fizzy/execute.cpp
{
T ret;
__builtin_memcpy(&ret, input, sizeof(ret));
memcpy(&ret, input, sizeof(ret));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed.

Comment thread lib/fizzy/parser.cpp Outdated
{
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)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed.

Comment thread cmake/ProjectUVWASI.cmake
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.
Copy link
Copy Markdown
Member Author

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.

Comment thread lib/fizzy/capi.cpp Outdated
#include "parser.hpp"
#include <fizzy/fizzy.h>
#include <algorithm>
#include <iterator>
Copy link
Copy Markdown
Member Author

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.

Comment thread lib/fizzy/parser_expr.cpp
inline void store(uint8_t* dst, T value) noexcept
{
__builtin_memcpy(dst, &value, sizeof(value));
memcpy(dst, &value, sizeof(value));
Copy link
Copy Markdown

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 ]

mutable wabt::interp::Store m_store{([]() constexpr noexcept {
mutable wabt::interp::Store m_store{([]() noexcept {
wabt::Features features;
features.disable_multi_value();
Copy link
Copy Markdown
Member Author

@axic axic Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

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
``

@axic
Copy link
Copy Markdown
Member Author

axic commented Jan 6, 2023

Last piece waiting is fixing the patch system for wasm3 or fixing+merging #739.

Comment thread circle.yml
$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
Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support compilation with MSVC

1 participant