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

[boost] boost 1.85.0 使用clang-cl工具链开启asan,在测试时显示找不到头文件"string.hpp" #4503

Open
Arteiimis opened this issue Jun 28, 2024 · 4 comments
Labels

Comments

@Arteiimis
Copy link
Contributor

Xmake 版本

2.9.3

操作系统版本和架构

win10

描述问题

当使用clang-cl作为boost的构建工具时,不开启asan可以正常编译测试通过,开启asan会提示找不到"string.hpp"

期待的结果

开启asan,正常使用clang-cl构建

工程配置

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

set_policy("build.sanitizer.address", true)
set_languages("c++23")
set_toolchains("clang-cl")
set_runtimes("MD")

add_requires("boost")

target("test")
    add_files("src/*.cpp")

    add_packages("boost")
    set_toolchains("clang-cl")
target_end()

附加信息和错误日志

> checking for c++ snippet(test)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\clang_cl.lua:199: C:\Users\LEGION\AppData\Local\Temp\.xmake\240628\_30B5E98FD1734C4383CE607874386DE7.cpp(4,22): fatal error: 'boost/algorithm/string.hpp' file not found
    4 |             #include <boost/algorithm/string.hpp>
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\modules\core\tools\clang_cl.lua:199]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\clang_cl.lua:152]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\tool\compiler.lua:278]: in function 'compile'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:82]: in function 'compile'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:244]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [...al\.xmake\repositories\github\packages\b\boost\xmake.lua:408]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...dir\modules\private\action\require\impl\actions\test.lua:41]:
    [...\modules\private\action\require\impl\actions\install.lua:444]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:370]:
    [...modules\private\action\require\impl\install_packages.lua:491]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\async\runjobs.lua:223]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

error: ...al\.xmake\repositories\github\packages\b\boost\xmake.lua:408: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\clang_cl.lua:199: C:\Users\LEGION\AppData\Local\Temp\.xmake\240628\_30B5E98FD1734C4383CE607874386DE7.cpp(4,22): fatal error: 'boost/algorithm/string.hpp' file not found
    4 |             #include <boost/algorithm/string.hpp>
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\modules\core\tools\clang_cl.lua:199]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\clang_cl.lua:152]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\tool\compiler.lua:278]: in function 'compile'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:82]: in function 'compile'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:244]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [...al\.xmake\repositories\github\packages\b\boost\xmake.lua:408]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...dir\modules\private\action\require\impl\actions\test.lua:41]:
    [...\modules\private\action\require\impl\actions\install.lua:444]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:370]:
    [...modules\private\action\require\impl\install_packages.lua:491]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\async\runjobs.lua:223]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

  => install boost 1.85.0 .. failed
error: @programdir\core\main.lua:329: @programdir\core\sandbox\modules\import\core\base\task.lua:65: @programdir\modules\async\runjobs.lua:325: ...\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:491]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

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>   
@Arteiimis Arteiimis added the bug label Jun 28, 2024
@Issues-translate-bot
Copy link

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


Title: [boost] boost 1.85.0 uses the clang-cl tool chain to open asan, and during testing it shows that the header file "string.hpp" cannot be found.

@star-hengxing
Copy link
Contributor

When I remove this configs, it work. Maybe we need to disable clang toolchain When debug on.
Any idea? @SirLynix

"variant=" .. (package:is_debug() and "debug" or "release"),
"runtime-debugging=" .. (package:is_debug() and "on" or "off")

@SirLynix
Copy link
Member

I suppose it's just a matter of folders, better check where the header and libs are installed when using clang-cl

@star-hengxing
Copy link
Contributor

star-hengxing commented Jun 28, 2024

Nothing

$ eza -a -R -T bin.v2
bin.v2
├── config.log
├── libs
│  ├── config
│  │  └── checks
│  │     ├── 53fbd48eb61920ae4a542b5dfe4e2925
│  │     └── architecture
│  │        ├── 9a84ceb2f523f2fc5565f4d00c523123
│  │        ├── 53fbd48eb61920ae4a542b5dfe4e2925
│  │        └── msvc-14.3
│  │           └── debug
│  │              └── threading-multi
│  │                 ├── 64.obj
│  │                 └── x86.obj
│  └── filesystem
│     └── config
│        ├── 0d7ef2339ba85b289af1d517e6dda136
│        └── 53fbd48eb61920ae4a542b5dfe4e2925
├── project-cache.jam
├── standalone
│  └── msvc
│     └── msvc-14.3
│        └── msvc-setup.bat
└── tools
   └── boost_install
      └── d41d8cd98f00b204e9800998ecf8427e
         └── BoostConfigVersion.cmake
$ eza -a -R -T installdir.failed
installdir.failed
├── lib
│  ├── cmake
│  │  ├── Boost-1.85.0
│  │  │  ├── BoostConfig.cmake
│  │  │  └── BoostConfigVersion.cmake
│  │  └── BoostDetectToolset-1.85.0.cmake
│  └── pkgconfig
│     └── boost.pc
├── logs
├── manifest.txt
└── references.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants