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

[package] boost/1.75.0: Build fails on windows #4338

Closed
superschnecke opened this issue Jan 22, 2021 · 3 comments · Fixed by #5099
Closed

[package] boost/1.75.0: Build fails on windows #4338

superschnecke opened this issue Jan 22, 2021 · 3 comments · Fixed by #5099
Labels
bug Something isn't working

Comments

@superschnecke
Copy link

Build of the latest boost package fails on windows using visual studio 19 with the following config:

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost/1.75.0
  • Operating System+version: Windows 10
  • Compiler+version: Visual studio 19/14.2
  • Docker image:
  • Conan version: conan 1.33.0
  • Python version: Python 3.9

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=Release
[options]
[build_requires]
[env]

This is what I think is the relevant part of the log (my highlights with **):

boost/1.75.0: Building your package in C:\.conan\653512\1
boost/1.75.0: Generator txt created conanbuildinfo.txt
boost/1.75.0: Calling build()
Conan:vcvars already set 
notice: found boost-build.jam at C:/.conan/78a320/1/source_subfolder/boost-build.jam
notice: loading B2 from C:/.conan/78a320/1/source_subfolder/tools/build/src
warning: mismatched versions of B2 engine and core
warning: B2 engine (b2.exe) is 4.2.0
warning: B2 core (at C:/.conan/78a320/1/source_subfolder/tools/build/src) is 4.3-git
**notice: Loading explicitly specified user configuration file:
    C:\.conan\78a320\1\source_subfolder\tools\build\user-config.jam**
notice: Searching 'C:\.conan\78a320\1\source_subfolder\tools\build' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from 'C:/.conan/78a320/1/source_subfolder/tools/build'.
notice: [zlib] Using pre-installed library
notice: [zlib] Condition
notice: [bzip2] Using pre-installed library
notice: [bzip2] Condition
notice: [msvc-cfg] msvc-14.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe'
notice: [msvc-cfg] msvc-14.2 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\cl.exe'
notice: [msvc-cfg] msvc-14.1 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\arm\cl.exe'
warning: toolset msvc initialization:
**warning: can not find user-provided command 'C:/Program' 'Files' '(x86)/Microsoft' 'Visual' 'Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe'**
**warning: initialized from C:\.conan\78a320\1\source_subfolder\tools\build\user-config.jam:5**

warning: Did not find command for MSVC toolset. If you have Visual Studio 2017 installed you will need to specify the full path to the command, set VS150COMNTOOLS for your installation, or build from the 'Visual Studio Command Prompt for VS 2017'.

**notice: will use 'C:/Program' 'Files' '(x86)/Microsoft' 'Visual' 'Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe' for msvc, condition <toolset>msvc-14.2** 

The file user-config.jam contains this:

using zlib : 1.2.11 : <include>"C:/Users/username/.conan/data/zlib/1.2.11/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab/include" <search>"C:/Users/username/.conan/data/zlib/1.2.11/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab/lib" <name>zlib ;
using bzip2 : 1.0.8 : <include>"C:/Users/username/.conan/data/bzip2/1.0.8/_/_/package/d16a91eadaaf5829b928b12d2f836ff7680d3df5/include" <search>"C:/Users/username/.conan/data/bzip2/1.0.8/_/_/package/d16a91eadaaf5829b928b12d2f836ff7680d3df5/lib" <name>bz2 ;
using "msvc" : 14.2 :  C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe : 
 ;

It looks like the package tries to use the path to cl.exe given in user-config.jam, but since the path contains spaces and is not enclosed with quitation marks, it fails.
I think the relevant part of conanfile.py is line 1005 and it was changed recently here: #3362. There is some discussion in the pull request that quotation marks might be needed for windows and paths with spaces: "that might be a situation fixing one thing, but breaking another".

@superschnecke superschnecke added the bug Something isn't working label Jan 22, 2021
@db4
Copy link
Contributor

db4 commented Feb 26, 2021

I have the same issue with boost/1.74.0 and VS Build Tools 2017. @madebr, maybe just revert #3362 for now?

@ivabrajer
Copy link
Contributor

Same issue here. Changing original Boost conanfile did the trick.

Replaced this line:

contents += ' %s' % self._cxx.replace("\\", "/")

With this one:

if self._is_msvc:
    contents += ' "%s"' % self._cxx.replace("\\", "/")
else:
    contents += ' %s' % self._cxx.replace("\\", "/")

@vdrumsta
Copy link

vdrumsta commented Jul 19, 2021

Don't mean to resurrect an old thread but I am having the same issues with g++ compiler on Windows. My path to g++ is:

C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe

Because "Program Files" contains spaces it fails to detect g++.exe

Here are the logs I've been getting:

notice: [zlib] Using pre-installed library
notice: [zlib] Condition
notice: [bzip2] Using pre-installed library
notice: [bzip2] Condition
warning: toolset gcc initialization:
warning: can not find user-provided command 'C:/Program' 'Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe'
warning: initialized from C:\.conan\33d3e6\1\source_subfolder\tools\build\user-config.jam:5
C:/.conan/33d3e6/1/source_subfolder/tools/build/src/tools\gcc.jam:164: in gcc.init from module gcc
error: toolset gcc initialization:
error: provided command 'C:/Program' 'Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe' not found
error: initialized from C:\.conan\33d3e6\1\source_subfolder\tools\build\user-config.jam:5

After I moved my mingw-w64 folder to this new path, it worked fine again

"C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe"

The solution would probably be to apply the same fix not only for MSVC, but also for g++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants