holepunchto / bare-dev

Development tooling for Bare
Apache License 2.0
8 stars 2 forks source link

Unable to build bare on Windows #9

Closed TchaikaBtc closed 8 months ago

TchaikaBtc commented 8 months ago

I am getting error while building bare from source on Windows machine

versions: node: v20.11.0 npm: 10.4.0 bare-dev: 0.7.14

Steps:

  1. Clone repo bare
  2. npx bare-dev vendor sync
  3. npx bare-dev configure [--debug]

Step 3 produces error:

-- Selecting Windows SDK version 10.0.22621.0 to target Windows .
CMake Error at test/fixtures/CMakeLists.txt:9 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"

-- Configuring incomplete, errors occurred!
error: spawn() failed
mafintosh commented 8 months ago

Can you share how you installed node?

TchaikaBtc commented 8 months ago

Using Windows installer https://nodejs.org/en/download

mafintosh commented 8 months ago

Yea thats what I do also, will see if @kasperisager has any ideas

kasperisager commented 8 months ago

@TchaikaBtc Could you try enabling verbose output:

npx bare-dev configure --verbose
TchaikaBtc commented 8 months ago
# C:\Program Files\CMake\bin\cmake.EXE -S C:\Users\Tchaika\Work\pear\bare -B C:\Users\Tchaika\Work\pear\bare\build -G Visual Studio 17 2022 -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -DCMAKE_MODULE_PATH=C:/Users/Tchaika/AppData/Roaming/npm/node_modules/bare-dev/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_LIBRARY_ARCHITECTURE=x64
-- Selecting Windows SDK version 10.0.22621.0 to target Windows .
-- Mirroring drive qogbhqbcxknrpeotyz7hk4x3mxuf6d9mhb1dxm6ms5sdn6hh1uso into C:/Users/Tchaika/Work/pear/bare/prebuilds
-- summary of build options:
    Install prefix:  C:/Program Files/bare
    Target system:   Windows
    Compiler:
      C compiler:    C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe (MSVC)
      CFLAGS:         /DWIN32 /D_WINDOWS

--
-- No build type selected, default to: Release
-- Use the C++ compiler to compile (MI_USE_CXX=ON)
--
-- Library base name: mimalloc
-- Version          : 2.1
-- Build type       : release
-- C++ Compiler     : C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe
-- Compiler flags   : /Zc:__cplusplus
-- Compiler defines : MI_WIN_NOREDIRECT=1
-- Link libraries   : psapi;shell32;user32;advapi32;bcrypt
-- Build targets    : shared
--
CMake Error at test/fixtures/CMakeLists.txt:9 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"

-- Configuring incomplete, errors occurred!
error: spawn() failed
kasperisager commented 8 months ago

Ah, it's the test fixture configuration that's failing! The original error message also mentions test/fixtures/CMakeLists.txt:9. To configure the tests you actually need bare in your path, it's a bit, ehr, recursive.

Try doing npm i -g bare-runtime and then run the configuration again.

mafintosh commented 8 months ago

We should add that to the readme 👍

TchaikaBtc commented 8 months ago

It's working. Thank you 👍

kasperisager commented 8 months ago

Pleasure! I'll add prebuilds for the test addon and check them in to fix that.

kasperisager commented 8 months ago

Fixed in https://github.com/holepunchto/bare/commit/47f000d9b334f13f3b859248419ffe8d6f726196.