xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
627 stars 377 forks source link

在Windows中使用llvm工具链安装不了boost #4477

Closed hanasaki666 closed 4 weeks ago

hanasaki666 commented 1 month ago

Xmake 版本

v2.9.2+HEAD.6b6557c54

操作系统版本和架构

Windows10 Version 22H2

描述问题

使用llvm工具链安装不了boost

期待的结果

可以使用llvm工具链正常安装boost

工程配置

add_rules("mode.debug", "mode.releasedbg", "mode.release")

set_languages("c++26")
set_toolchains("llvm")

if is_mode("debug") then
    set_runtimes("MDd")
    add_requires("boost", {configs = {all = true}, debug = true})
else
    set_runtimes("MD")
    add_requires("boost", {configs = {all = true}})
end

target("test")
    set_kind("binary")
    add_packages("boost")
    add_files("projects/src/*.cpp")

附加信息和错误日志

note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> boost 1.85.0 [all:y, debug:y, runtimes:"MDd", toolchains:"llvm"]
please input: y (y/n/m)
y
checking for ping ... ok
pinging the host(github.com) ... 230 ms
D:\xmake\winenv\bin\7z x -y boost-1.85.0-b2-nodocs.tar.gz -oC:\Users\jiajia\AppData\Local\Temp\.xmake\240626\_23F76DBBDD5244108B73C6C922A06160.tar

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 124443962 bytes (119 MiB)

Extracting archive: boost-1.85.0-b2-nodocs.tar.gz
--
Path = boost-1.85.0-b2-nodocs.tar.gz
Type = gzip
Headers Size = 10

Everything is Ok

Size:       561520640
Compressed: 124443962
D:\xmake\winenv\bin\7z x -y C:\Users\jiajia\AppData\Local\Temp\.xmake\240626\_23F76DBBDD5244108B73C6C922A06160.tar\boost-1.85.0-b2-nodocs.tar -osource.tmp

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 561520640 bytes (536 MiB)

Extracting archive: C:\Users\jiajia\AppData\Local\Temp\.xmake\240626\_23F76DBBDD5244108B73C6C922A06160.tar\boost-1.85.0-b2-nodocs.tar
--
Path = C:\Users\jiajia\AppData\Local\Temp\.xmake\240626\_23F76DBBDD5244108B73C6C922A06160.tar\boost-1.85.0-b2-nodocs.tar
Type = tar
Physical Size = 561520640
Headers Size = 31918592
Code Page = UTF-8

Everything is Ok

Folders: 5088
Files: 56302
Size:       514872786
Compressed: 561520640
bootstrap.bat msvc
Building Boost.Build engine
Call_If_Exists "bin\VCVARS32.BAT"
###
### Using 'msvc' toolset.
###

D:\Cache\.xmake\cache\packages\2406\b\boost\1.85.0\source\tools\build\src\engine>"cl" /nologo /MP /MT /TP /Feb2 /wd4996 /O2 /GL /EHsc   -DNDEBUG  bindjam.cpp builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filent.cpp filesys.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp jam_strings.cpp startup.cpp tasks.cpp timestamp.cpp value.cpp variable.cpp w32_getreg.cpp mod_jam_builtin.cpp mod_jam_class.cpp mod_jam_errors.cpp mod_jam_modules.cpp mod_order.cpp mod_path.cpp mod_property_set.cpp mod_regex.cpp mod_sequence.cpp mod_set.cpp mod_string.cpp mod_summary.cpp mod_sysinfo.cpp mod_version.cpp /link kernel32.lib advapi32.lib 
user32.lib /MANIFEST:EMBED /MANIFESTINPUT:b2.exe.manifest
bindjam.cpp
builtins.cpp
class.cpp
command.cpp
compile.cpp
constants.cpp
cwd.cpp
debug.cpp
debugger.cpp
execcmd.cpp
execnt.cpp
execunix.cpp
filent.cpp
filesys.cpp
fileunix.cpp
frames.cpp
function.cpp
glob.cpp
hash.cpp
hcache.cpp
hdrmacro.cpp
headers.cpp
jam.cpp
jamgram.cpp
lists.cpp
make.cpp
make1.cpp
md5.cpp
mem.cpp
modules.cpp
native.cpp
option.cpp
output.cpp
parse.cpp
pathnt.cpp
pathsys.cpp
pathunix.cpp
regexp.cpp
rules.cpp
scan.cpp
search.cpp
jam_strings.cpp
startup.cpp
tasks.cpp
timestamp.cpp
value.cpp
variable.cpp
w32_getreg.cpp
mod_jam_builtin.cpp
mod_jam_class.cpp
mod_jam_errors.cpp
mod_jam_modules.cpp
mod_order.cpp
mod_path.cpp
mod_property_set.cpp
mod_regex.cpp
mod_sequence.cpp
mod_set.cpp
mod_string.cpp
mod_summary.cpp
mod_sysinfo.cpp
mod_version.cpp
Generating code
Finished generating code

D:\Cache\.xmake\cache\packages\2406\b\boost\1.85.0\source\tools\build\src\engine>dir *.exe 
 Volume in drive D is Data
 Volume Serial Number is A0FE-FCF5

 Directory of D:\Cache\.xmake\cache\packages\2406\b\boost\1.85.0\source\tools\build\src\engine

2024/06/26  20:04           779,264 b2.exe
               1 File(s)        779,264 bytes
               0 Dir(s)  54,422,880,256 bytes free

Generating Boost.Build configuration in project-config.jam for msvc...

Bootstrapping is done. To build, run:

    .\b2

To adjust configuration, edit 'project-config.jam'.
Further information:

    - Command line help:
    .\b2 --help

    - Getting started guide:
    http://boost.org/more/getting_started/windows.html

    - Boost.Build documentation:
    http://www.boost.org/build/

error: ...xmake\repositories\xmake-repo\packages\b\boost\xmake.lua:158: attempt to index a nil value (local 'toolchain')
stack traceback:
    [...xmake\repositories\xmake-repo\packages\b\boost\xmake.lua:158]: in function 'get_compiler'
    [...xmake\repositories\xmake-repo\packages\b\boost\xmake.lua:247]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...\modules\private\action\require\impl\actions\install.lua:404]:

  => install boost 1.85.0 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:322: ...\modules\private\action\require\impl\actions\install.lua:506: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [...\modules\private\action\require\impl\actions\install.lua:506]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:370]:
    [...modules\private\action\require\impl\install_packages.lua:489]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:238]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:973: in function 'os.raiselevel'
        (...tail calls...)
        @programdir\core\main.lua:329: in upvalue 'cotask'
        @programdir\core\base\scheduler.lua:406: in function <@programdir\core\base\scheduler.lua:399>
warning: please use package:runtimes() or package:has_runtime() instead of package:config("vs_runtime")
Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Title: Boost cannot be installed using the llvm tool chain

waruqi commented 1 month ago

可能是这里 toolchain 有可能为 nil 导致,可以调下,提个 pr 过来改进包。。 https://github.com/xmake-io/xmake-repo/blob/c472fa46878c967676b1f4ecf5d6a15ca446e193/packages/b/boost/xmake.lua#L214

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


It may be that the toolchain here may be nil. You can adjust it and submit a PR to improve the package. . https://github.com/xmake-io/xmake-repo/blob/c472fa46878c967676b1f4ecf5d6a15ca446e193/packages/b/boost/xmake.lua#L214

hanasaki666 commented 1 month ago

可能是这里 toolchain 有可能为 nil 导致,可以调下,提个 pr 过来改进包。。

https://github.com/xmake-io/xmake-repo/blob/c472fa46878c967676b1f4ecf5d6a15ca446e193/packages/b/boost/xmake.lua#L214

有教程指导下我吗?我不清楚怎么搞包调试,我对编译、构建、包管理等这部分知识可以说是一无所知

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


It may be that the toolchain here may be nil. You can adjust it and submit a PR to improve the package. .

https://github.com/xmake-io/xmake-repo/blob/c472fa46878c967676b1f4ecf5d6a15ca446e193/packages/b/boost/xmake.lua#L214

Is there any tutorial to guide me? I don't know how to debug packages. I know nothing about compilation, building, package management, etc.