Skip to content
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

Error when building on Windows with Python install dir having space in path #4840

Closed
felixfbecker opened this issue Jan 24, 2016 · 16 comments
Closed
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.

Comments

@felixfbecker
Copy link
Contributor

This is the first time I tried to build node from source, when I try to run vcbuild I get this log:

Looking for Visual Studio 2015
Found Visual Studio 2015
configure  --dest-cpu=x86 --tag=
ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles.
creating  icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'host_arch': 'x64',
                 'icu_small': 'false',
                 'node_byteorder': 'little',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'true',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'python': 'C:\\Program Files\\Python\\2.7\\python.exe',
                 'target_arch': 'ia32',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 1}}
creating  config.gypi
creating  config.mk
Project files generated.
  gtest.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\gtest.lib
  cares.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\cares.lib
  http_parser.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\http_parser.lib
  libuv.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\libuv.lib
  node_js2c
  Command "C:\Program" not found
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\felix\git\opensource\node\node_js2c.vcxproj]
  v8_base_0.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_0.lib
  v8_base_2.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_2.lib
  v8_base_1.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_1.lib
  v8_libplatform.vcxproj -> ..\..\..\..\build\Release\lib\v8_libplatform.lib
  v8_libbase.vcxproj -> ..\..\..\..\build\Release\lib\v8_libbase.lib
  zlib.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\zlib.lib
  v8_base_3.vcxproj -> ..\..\..\..\build\Release\lib\v8_base_3.lib
  openssl.vcxproj -> C:\Users\felix\git\opensource\node\Release\lib\openssl.lib

See the line "C:\Progam" not found, it seems like something from C:\Program Files is run but the path is not quoted. I looked at the bat I could not find what is causing this. I don't get any node.exe output. I am using Visual Studio 2015 Update 1 on Windows 10 64 bit.

@r-52 r-52 added windows Issues and PRs related to the Windows platform. build Issues and PRs related to build files or the CI. labels Jan 24, 2016
@r-52
Copy link
Contributor

r-52 commented Jan 24, 2016

cc @nodejs/platform-windows

@seishun
Copy link
Contributor

seishun commented Jan 24, 2016

It seems you have Python installed in C:\Program Files. I guess this line needs quotes.

@felixfbecker
Copy link
Contributor Author

@seishun Yeah. All my programs are installed in Program Files.

@felixfbecker
Copy link
Contributor Author

But it's also in the PATH

@seishun
Copy link
Contributor

seishun commented Jan 24, 2016

Could you try adding quotes in the line I linked? It should look like '"<(python)"',.

@seishun
Copy link
Contributor

seishun commented Jan 24, 2016

This one:

node/node.gyp

Line 528 in 3e2a2e6

'<(python)',

@benjamingr
Copy link
Member

@felixfbecker in your PATH, see this guide for setting up path variables.

Basically, it's looking for Python in C:\Program because Program Files contains a space. You need to quote that.

This has not been a problem before since Python defaults to install in C:\Python27.

@seishun
Copy link
Contributor

seishun commented Jan 24, 2016

@benjamingr you don't need quotes in PATH, and according to his build output his Python installation is found just fine.

@felixfbecker
Copy link
Contributor Author

@benjamingr I know how to setup path, thanks :)
@seishun That fixed it. Should I do a PR?

@seishun
Copy link
Contributor

seishun commented Jan 24, 2016

@felixfbecker I think so. But it makes me wonder why GYP isn't doing its job properly by escaping the path on its own.

@felixfbecker
Copy link
Contributor Author

@benjamingr I dislike programs that install to C:\. It is the equivalent of installing Linux programs in the root path. You wouldnt install python to /python-27, would you? :D

@silverwind
Copy link
Contributor

This issue has come up a few times now. Can we possibly fix it by quoting that path somewhere?

@felixfbecker
Copy link
Contributor Author

@silverwind I opened #4841

@felixfbecker felixfbecker changed the title Error when building on Windows Error when building on Windows with Python install dir having space in path Jan 24, 2016
@benjamingr
Copy link
Member

@felixfbecker well, Program Files isn't much better IMO :D I was only addressing why this isn't broken for most users though, what you're asking for is legit.

@felixfbecker
Copy link
Contributor Author

@benjamingr Program Files is where you install programs (for all users) on Windows... like /usr/local on Linux (I think).

@silverwind
Copy link
Contributor

Closing this issue as it's a dupe of #4012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

5 participants