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

[bug] Path to compiler with spaces when building boost #15070

Closed
sogartar opened this issue Jan 2, 2023 · 4 comments · Fixed by #15154
Closed

[bug] Path to compiler with spaces when building boost #15070

sogartar opened this issue Jan 2, 2023 · 4 comments · Fixed by #15154

Comments

@sogartar
Copy link

sogartar commented Jan 2, 2023

Environment details

  • Operating System+version: Microsoft Windows 10 Pro 10.0.19045 Build 19045
  • Compiler+version: clang 15
  • Conan version: 1.56.0
  • Python version: 3.8.6

Steps to reproduce

I am not sure if this error is in Conan or in Boost Jam.
My compiler directory is C:/Program Files/LLVM/bin. It has a space in its path.

I have this profile

[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=clang
compiler.version=15
compiler.cppstd=20
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CONAN_CMAKE_GENERATOR=Ninja
CC=clang
CXX=clang++
CMAKE_GENERATOR=Ninja

When I do

conan workspace install ../conan-workspace.yml --build=missing --profile ../conan-clang-debug-profile

I get this error

...
boost/1.81.0: Applying build-requirement: b2/4.9.2
Downloading conan_sources.tgz completed [0.66k]
Decompressing conan_sources.tgz completed [0.00k]
boost/1.81.0: Configuring sources in C:\.conan\5d11a4\1\src
Downloading boost_1_81_0.tar.bz2 completed [116013.43k]                                  boost/1.81.0: /1.81.0:
boost/1.81.0:
boost/1.81.0: Apply patch (conan): Fails the build when mpi is not configured
boost/1.81.0: Apply patch (conan): Fails the build when there is no iconv backend
boost/1.81.0: Building your package in C:\.conan\c61a72\1
boost/1.81.0: Generator txt created conanbuildinfo.txt
boost/1.81.0: Calling generate()
boost/1.81.0: Aggregating env generators
boost/1.81.0: Calling build()
boost/1.81.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in 'C:\.conan\5d11a4\1\src\boost\stacktrace\detail\libbacktrace_impls.hpp' file.
boost/1.81.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in 'C:\.conan\5d11a4\1\src\boost\stacktrace\detail\libbacktrace_impls.hpp' file.
boost/1.81.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in 'C:\.conan\5d11a4\1\src\tools\build\src\tools\gcc.jam' file.boost/1.81.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in 'C:\.conan\5d11a4\1\src\tools\build\src\tools\gcc.jam' file.
boost/1.81.0: WARN: Patching user-config.jam
boost/1.81.0: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
boost/1.81.0: WARN:
using zlib : 1.2.13 : <include>"C:/Users/sogartary/.conan/data/zlib/1.2.13/_/_/package/01822c8126f3805e61534fa72215516497c36eb2/include" <search>"C:/Users/sogartary/.conan/data/zlib/1.2.13/_/_/package/01822c8126f3805e61534fa72215516497c36eb2/lib" <name>zlib ;
using bzip2 : 1.0.8 : <include>"C:/Users/sogartary/.conan/data/bzip2/1.0.8/_/_/package/664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b/include" <search>"C:/Users/sogartary/.conan/data/bzip2/1.0.8/_/_/package/664a290ff8a4232d40ea8d66ae4e20ff2cb6ef7b/lib" <name>bz2 ;
using "clang-win" :  :  C:/Program Files/LLVM/bin/clang++.EXE :
 ;
boost/1.81.0: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
ZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=off --disable-iconv threading=multi visibility=hidden link=static variant=debug --with-atomic --with-chrono --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-fiber --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-wave toolset=clang-win cxxflags=-std=c++20 pch=on linkflags="-stdlib=None" cxxflags="-fPIC -stdlib=None" install --prefix=C:\.conan\6876cace\1 -j4 --abbreviate-paths -d0 --debug-configuration --build-dir="C:\.conan\c61a72\1\build-debug"
notice: found boost-build.jam at C:/.conan/5d11a4/1/src/boost-build.jam
notice: loading B2 from C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/kernel/bootstrap.jam
notice: Searching 'C:\Users\sogartary' 'C:\Users\sogartary' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/kernel' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/util' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/build' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/tools' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/contrib' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/.' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in 'C:\Users\sogartary' 'C:\Users\sogartary' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/kernel' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/util' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/build' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/tools' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/contrib' 'C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/.'.
notice: Loading explicitly specified user configuration file:
    C:\.conan\5d11a4\1\src\tools\build\user-config.jam
notice: Searching 'C:\.conan\5d11a4\1\src\tools\build' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from 'C:/.conan/5d11a4/1/src/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.2 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\cl.exe'
warning: toolset clang-win initialization:
warning: can not find user-provided command 'C:/Program' 'Files/LLVM/bin/clang++.EXE'
warning: initialized from C:\.conan\5d11a4\1\src\tools\build\user-config.jam:5
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/tools\clang-win.jam:74: in clang-win.init from module clang-win
error: Cannot configure toolset clang-win: no 'clang-cl.exe' command found or given
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/build\toolset.jam:44: in toolset.using from module toolset
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/build\project.jam:1104: in using from module project-rules
C:\.conan\5d11a4\1\src\tools\build\user-config.jam:5: in modules.load from module user-config
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2\build-system.jam:255: in load-config from module build-system
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2\build-system.jam:449: in load-configuration-files from module build-system
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2\build-system.jam:607: in load from module build-system
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/kernel\modules.jam:294: in import from module modules
C:/Users/sogartary/.conan/data/b2/4.9.2/_/_/package/ca33edce272a279b24f87dc0d4cf5bbdcffbc187/bin/.b2/kernel/bootstrap.jam:135: in module scope from module

The interesting line is

warning: can not find user-provided command 'C:/Program' 'Files/LLVM/bin/clang++.EXE'

It seems that somehow the path got treated as two string.

In C:\.conan\5d11a4\1\src\tools\build\user-config.jam I have this:

...
using "clang-win" :  :  C:/Program Files/LLVM/bin/clang++.EXE : 
...

The compiler path is not quoted.

Logs

No response

@memsharded
Copy link
Member

Hi @sogartar

Yes, I think this belongs to boost, in this case, it might be workarounded in the Conan recipe in conan-center-index. So I am transferring this issue to the conan-center-index repo.

In any case, please note that in Windows, it is always problematic for many tools to have spaces in paths or with other special characters. I always avoid that installing things in different places than Program Files.

@memsharded memsharded transferred this issue from conan-io/conan Jan 2, 2023
@SpaceIm
Copy link
Contributor

SpaceIm commented Jan 3, 2023

You can try to replace these lines in boost recipe:

        if is_msvc(self):
            contents += f' "{cxx_fwd_slahes}"'
        else:
            contents += f' {cxx_fwd_slahes}'

by

        if cxx_fwd_slahes:
            contents += f' "{cxx_fwd_slahes}"'

Moreover, pay attention that variables defined in [env] are not listened by recipes migrated to conan v2 (they listen [buildenv] or [conf] like tools.build:compiler_executables).

@Ahmed-Alrubaye
Copy link

Ahmed-Alrubaye commented Jul 31, 2024

Hi @sogartar, @memsharded and @SpaceIm ,

I'm running almost into the same issue, when I used the gcc compiler, it could detect it but I got this error:
...failed updating 0 target...

Then I modified the "user-config.jam" to use msvc like this:

using msvc : 14.3 : "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe" ;

when I run conan install, I get this error:

`notice: Loading explicitly specified user configuration file:

    C:\Users\BEALRUBA\.conan2\p\boostc368a989a1b43\s\src\tools\build\user-config.jam
notice: Searching 'C:\Users\BEALRUBA\.conan2\p\boostc368a989a1b43\s\src\tools\build' for user-config configuration file 'user-config.jam'.

notice: Loading user-config configuration file 'user-config.jam' from 'C:/Users/BEALRUBA/.conan2/p/boostc368a989a1b43/s/src/tools/build'.

notice: [zlib] Using pre-installed library 

notice: [zlib] Condition 

notice: [bzip2] Using pre-installed library

notice: [bzip2] Condition

[errno 2] Visual Studio.jam (No such file or directory)`

The issue is, it overwrites the user-config.jam and it doesn't detect the msvc that I added. How can I fix that please?

@memsharded
Copy link
Member

Hi @Ahmed-Alrubaye

This ticket was solved and closed, so if there is any new issue it would be necessary to create a new ticket with updated details:

  • Exact Conan version, platform, os, compiler, etc
  • The exact starting point, it is the recipe from conan-center-index? Where did you do that change
  • The exact changes you did to the recipe
  • The exact command you did to create the package
  • The full output

Thanks!

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 a pull request may close this issue.

4 participants