xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.18k stars 786 forks source link

cosmocc toolchain not working in windows #5552

Open Chi-EEE opened 2 months ago

Chi-EEE commented 2 months ago

Xmake Version

xmake v2.9.4+dev.0d2bd1503

Operating System Version and Architecture

Windows 10 22H2

Describe Bug

When I build with the cosmocc toolchain, cosmocc is not found.

Expected Behavior

Builds exe with cosmocc

Project Configuration

Commands: xmake f -p windows -vD xmake -vD

xmake.lua:

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

add_requires("cosmocc")

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    set_toolchains("@cosmocc")

Additional Information and Error Logs

PS C:\Users\admin\Downloads\cosmocc_test> xmake f -p windows -vD
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(github.com) ... 31 ms
pinging the host(gitlab.com) ... 33 ms
pinging the host(gitee.com) ... 267 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
configure
{
    mode = release
    buildir = build
    ccache = true
    kind = static
    host = windows
    arch = x64
    vs = 2022
    ndk_stdcxx = true
    plat = windows
}
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD
checking for the linker (ld: cosmoc++) ... no
checking for the linker (ld: cosmocc) ... no
checking for the shared library linker (sh: cosmoc++) ... no
checking for the shared library linker (sh: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the c++ compiler (cxx: cosmocc) ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c++ compiler (cxx) ... cl.exe
checking for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe ... ok
checking for flags (-O2) ... ok
> cl.exe "-O2" "-nologo"
checking for flags (-DNDEBUG) ... ok
> cl.exe "-DNDEBUG" "-nologo"
[ 50%]: cache compiling.release src\main.cpp
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -O2 /EHsc -DNDEBUG -Fobuild\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
checking for flags (cl_sourceDependencies) ... ok
> cl.exe "/sourceDependencies" "C:\Users\admin\AppData\Local\Temp\.xmake\240901\_328DAA1C8EFE436089F081D32302B4A0.json" "-nologo"
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
[ 75%]: linking.release test.exe
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.o
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the c compiler (cc: cosmocc) ... no

build cache stats:
cache directory: C:\Users\admin\Downloads\cosmocc_test\build\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 1
cache miss total time: 0.016s
new cached files: 1
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.328s

[100%]: build ok, spent 1.11s
waruqi commented 2 months ago

checkinfo: cannot runv(C:\Users\admin\AppData\Local.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory

not found, you can check it, or run xmake f -c -vD to clear cache.

Chi-EEE commented 2 months ago

cosmocc cannot be found because it is not an exe file

PS C:\Users\admin\Downloads\cosmocc_test> xmake f -c -vD              
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory 
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
configure
{
    host = windows
    kind = static
    vs = 2022
    ccache = true
    buildir = build
    plat = windows
    arch = x64
    mode = release
    clean = true
    ndk_stdcxx = true
}
PS C:\Users\admin\Downloads\cosmocc_test> xmake clean -a
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD     
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(gitlab.com) ... 32 ms
pinging the host(github.com) ... 27 ms
pinging the host(gitee.com) ... 190 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++.exe --version), No such file or directory
checkinfo: cannot runv(cosmoc++.exe --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the c++ compiler (cxx: cosmocc) ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c++ compiler (cxx) ... cl.exe
checking for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe ... ok
checking for flags (-O2) ... ok
> cl.exe "-O2" "-nologo"
checking for flags (-DNDEBUG) ... ok
> cl.exe "-DNDEBUG" "-nologo"
[ 50%]: cache compiling.release src\main.cpp
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -O2 /EHsc -DNDEBUG -Fobuild\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
checking for flags (cl_sourceDependencies) ... ok
> cl.exe "/sourceDependencies" "C:\Users\admin\AppData\Local\Temp\.xmake\240901\_86C45AAD2F9242508C58936DD6B08D70.json" "-nologo"
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
[ 75%]: linking.release test.exe
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.o
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc.exe --version), No such file or directory
checkinfo: cannot runv(cosmocc.exe --version), No such file or directory
checking for cosmocc ... no
checking for the c compiler (cc: cosmocc) ... no

build cache stats:
cache directory: C:\Users\admin\Downloads\cosmocc_test\build\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 1
cache miss total time: 0.000s
new cached files: 1
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.360s

[100%]: build ok, spent 1.125s

cosmocc

waruqi commented 2 months ago

it does not support for windows. because cosomcc is not a exe program, it's a shell file.

we need bash/sh to load it.

you can try this patch. https://github.com/xmake-io/xmake/pull/5553

But it's not perfect yet now and we should automatically load sh/bash in the toolchain

Chi-EEE commented 2 months ago
PS C:\Users\admin\Downloads\cosmocc_test> xmake update --scriptonly github:xmake-io/xmake#cosmocc
update version cosmocc from https://github.com/xmake-io/xmake.git ..
  => download https://github.com/xmake-io/xmake.git .. ok
  => install script to C:\Users\admin\xmake .. ok
PS C:\Users\admin\Downloads\cosmocc_test> xmake clean -a
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
PS C:\Users\admin\Downloads\cosmocc_test> xmake f -c -vD
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(github.com) ... 25 ms
pinging the host(gitee.com) ... 260 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
configure
{
    arch = x64
    clean = true
    vs = 2022
    plat = windows
    ndk_stdcxx = true
    buildir = build
    host = windows
    ccache = true
    kind = static
    mode = release
}
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD
checking for the linker (ld: cosmoc++) ... no
checking for the linker (ld: cosmocc) ... no
checking for the shared library linker (sh: cosmoc++) ... no
checking for the shared library linker (sh: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c++ compiler (cxx: cosmocc) ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c++ compiler (cxx) ... cl.exe
checking for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe ... ok
checking for flags (-O2) ... ok
> cl.exe "-O2" "-nologo"
checking for flags (-DNDEBUG) ... ok
> cl.exe "-DNDEBUG" "-nologo"
[ 50%]: cache compiling.release src\main.cpp
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -O2 /EHsc -DNDEBUG -Fobuild\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
checking for flags (cl_sourceDependencies) ... ok
> cl.exe "/sourceDependencies" "C:\Users\admin\AppData\Local\Temp\.xmake\240901\_F6E9825D2A7B4E608C2E4FDA2C2C6FD0.json" "-nologo"
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
[ 75%]: linking.release test.exe
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.o
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c compiler (cc: cosmocc) ... no

build cache stats:
cache directory: C:\Users\admin\Downloads\cosmocc_test\build\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 1
cache miss total time: 0.000s
new cached files: 1
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.344s

[100%]: build ok, spent 1.204s
waruqi commented 2 months ago

Did you add msys2 package to your project now?

Chi-EEE commented 2 months ago

I have now added it and it still does not use cosmocc:

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

if is_subhost("windoows") then
    add_requires("msys2")
    add_packages("msys2")
end

add_requires("cosmocc")

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    set_toolchains("@cosmocc")
PS C:\Users\admin\Downloads\cosmocc_test> xmake clean -a
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
PS C:\Users\admin\Downloads\cosmocc_test> xmake f -c -vD
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory 
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(github.com) ... 29 ms
pinging the host(gitlab.com) ... 29 ms
pinging the host(gitee.com) ... 263 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
configure
{
    ndk_stdcxx = true
    kind = static
    plat = windows
    clean = true
    vs = 2022
    buildir = build
    arch = x64
    host = windows
    mode = release
    ccache = true
}
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD     
checking for the linker (ld: cosmoc++) ... no
checking for the linker (ld: cosmocc) ... no
checking for the shared library linker (sh: cosmoc++) ... no
checking for the shared library linker (sh: cosmocc) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c++ compiler (cxx: cosmocc) ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c++ compiler (cxx) ... cl.exe
checking for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe ... ok
checking for flags (-O2) ... ok
> cl.exe "-O2" "-nologo"
checking for flags (-DNDEBUG) ... ok
> cl.exe "-DNDEBUG" "-nologo"
[ 50%]: cache compiling.release src\main.cpp
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -O2 /EHsc -DNDEBUG -Fobuild\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
checking for flags (cl_sourceDependencies) ... ok
> cl.exe "/sourceDependencies" "C:\Users\admin\AppData\Local\Temp\.xmake\240901\_247B7C02D1A7412082C556E89C5F9D40.json" "-nologo"
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
[ 75%]: linking.release test.exe
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.o
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc --version), No such file or directory
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c compiler (cc: cosmocc) ... no

build cache stats:
cache directory: C:\Users\admin\Downloads\cosmocc_test\build\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 1
cache miss total time: 0.016s
new cached files: 1
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.328s

[100%]: build ok, spent 1.094s
PS C:\Users\admin\Downloads\cosmocc_test> xrepo scan msys2  
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
scanning packages ..
msys2-latest:
  -> 0a468b1e76cc4be18c3a5623a3c9290b: windows, x64, unused
    -> {base_devel=false,debug=false,diffutils=false,gcc=false,make=false,mingw32_gcc=false,mingw32_toolchain=false,mingw64_gcc=false,mingw64_toolchain=false,pathtype="inherit",pic=true,runtimes="MT",shared=false}
Issues-translate-bot commented 2 months ago

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


Did you add msys2 package to your project now?

waruqi commented 2 months ago

try this patch again, and remove add_requires/add_packages("msys")

image
Chi-EEE commented 2 months ago

cosmocc toolchain works and compiles using cosmocc but setting the toolset to cosmoc++ and compiling with it does not work:

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

add_requires("cosmocc")

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    set_toolchains("@cosmocc")
    set_toolset("cxx", "cosmoc++")
    set_toolset("ld", "cosmoc++")
    set_toolset("sh", "cosmoc++")
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(gitlab.com) ... 27 ms
pinging the host(github.com) ... 24 ms
pinging the host(gitee.com) ... 218 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no  
checking for cosmocc ... no
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
[ 50%]: cache compiling.release src\main.cpp
cosmoc++ -c -fvisibility=hidden -fexceptions -o build\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
error: @programdir\core\main.lua:329: @programdir\actions\build\main.lua:148: @programdir\modules\async\runjobs.lua:325: @programdir\modules\private\action\build\object.lua:91: @programdir\modules\core\tools\gcc.lua:922: cannot runv(cosmoc++ -c -fvisibility=hidden -fexceptions -o build/.objs/test/windows/x64/release/src/main.cpp.o src/main.cpp), No such file or directory
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\modules\core\tools\gcc.lua:922]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\gcc.lua:863]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\compiler.lua:278]: in function 'compile'
    [@programdir\modules\private\action\build\object.lua:91]: in function 'script'
    [@programdir\modules\private\action\build\object.lua:122]: in function 'build_object'
    [@programdir\modules\private\action\build\object.lua:147]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1003: in function 'base/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>**
waruqi commented 2 months ago

please do not call set_toolset() to set it outside toolchain. These configurations are not part of the cosmocc toolchain and do not bind to the cosmocc toolchain environment.

please just use cosmocc toolchain.

waruqi commented 2 months ago

The cosmocc toolchain already use cosmoc++, so you don't need to change it.

https://github.com/xmake-io/xmake/blob/f20c40bf589088ee7738740f73af3504fbfb3317/xmake/toolchains/cosmocc/xmake.lua#L31-L35

Chi-EEE commented 2 months ago

Ok, I updated the xmake.lua and it does not use cosmoc++ to compile the program (It uses cosmocc to compile the program)

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

add_requires("cosmocc")

target("test")
    set_kind("binary")
    set_languages("c++17")
    add_files("src/*.cpp")
    set_toolchains("@cosmocc")
#include <iostream>

int main(int argc, char** argv) {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc
checking for the linker (ld) ... cosmocc
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc
checking for the shared library linker (sh) ... cosmocc
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmoc++ --version), Unknown Error (193)
checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.6.2\7c0c13c9e6eb4f63a70078b888fd9978\bin\cosmocc
checking for the c++ compiler (cxx) ... cosmocc
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.6.2/7c0c13c9e6eb4f63a70078b888fd9978/bin/cosmocc ... ok
checking for flags (-fvisibility-inlines-hidden) ... ok
> cosmocc "-fvisibility-inlines-hidden"
checking for flags (-O3) ... ok
> cosmocc "-O3"
checking for flags (-DNDEBUG) ... ok
> cosmocc "-DNDEBUG"
[ 50%]: cache compiling.release src\main.cpp
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.6.2/7c0c13c9e6eb4f63a70078b888fd9978/bin/cosmocc -c -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++17 -fexceptions -DNDEBUG -o build\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
checking for flags (-MMD -MF) ... no
> cosmocc "-MMD" "-MF" "C:\Users\admin\AppData\Local\Temp\.xmake\240902\_E54A4325D20D4530800B14CCBAAE9370"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: C:/Users/admin/AppData/Local/Temp/.xmake/240902/_CE0C09B2D45D464086CA8FA556251C60: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.baqvc1rt5xo72.aarch64.elf': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fdiagnostics-color=always) ... ok
> cosmocc "-fdiagnostics-color=always"
build/.objs/test/windows/x64/release/src/main.cpp.o: open failed with No such file or directory
[m' is valid for C/ObjC but not for C++
src/main.cpp:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
[ 75%]: linking.release test.exe
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.6.2/7c0c13c9e6eb4f63a70078b888fd9978/bin/cosmocc -o build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.o
cosmocc: fatal error: build/.objs/test/windows/x64/release/src/main.cpp.o: no such file
compilation terminated.
error: @programdir\core\main.lua:329: @programdir\actions\build\main.lua:148: @programdir\modules\async\runjobs.lua:325: @programdir\actions\build\kinds\binary.lua:53: @programdir\core\sandbox\modules\os.lua:378: execv(C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.6.2/7c0c13c9e6eb4f63a70078b888fd9978/bin/cosmocc -o build/windows/x64/release/test.exe build/.objs/test/windows/x64/release/src/main.cpp.o) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\sandbox\modules\os.lua:378]: in function 'execv'
    [@programdir\modules\core\tools\gcc.lua:586]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [@programdir\actions\build\kinds\binary.lua:53]: in function 'callback'
    [@programdir\modules\core\project\depend.lua:217]: in function 'on_changed'
    [@programdir\actions\build\kinds\binary.lua:41]: in function '_do_link_target'
    [@programdir\actions\build\kinds\binary.lua:83]:
    [@programdir\actions\build\kinds\binary.lua:110]: in function '_link_target'
    [@programdir\actions\build\kinds\binary.lua:138]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1003: in function 'base/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>
waruqi commented 2 months ago

cosmoc++ is a symlink of cosmocc, but 7z cannot extract it as symlink on windows, so we cannot run it on windows.

we should improve cosmocc package, and use os.cp to copy and override these symlink files on windows.

image
waruqi commented 2 months ago

https://github.com/xmake-io/xmake-repo/pull/5126

Chi-EEE commented 2 months ago

That PR fixes the cosmoc++ problem, thanks

Chi-EEE commented 2 months ago

Compiling the project with abseil does not work with cosmoc:

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

add_requires("cosmocc")
add_requires("abseil")

target("test")
    set_kind("binary")
    set_languages("c++17")
    add_packages("abseil")

    add_files("src/*.cpp")
    set_toolchains("@cosmocc")
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... C:\Program Files\CMake\bin\cmake
finding abseil from xmake ..
checking for xmake::abseil ... abseil 20240722.0
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the linker (ld) ... cosmoc++
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the shared library linker (sh) ... cosmoc++
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ ... ok
checking for flags (-fvisibility-inlines-hidden) ... ok
> cosmoc++ "-fvisibility-inlines-hidden"
checking for flags (-O3) ... ok
> cosmoc++ "-O3"
checking for flags (-DNDEBUG) ... ok
> cosmoc++ "-DNDEBUG"
[ 50%]: cache compiling.release src\main.cpp
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -c -fvisibility=hidden -fvisibility-inlines-hidden -O3 -std=c++17 -fexceptions -isystem C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\2fb24eff77a9413781385fd7616d4ab4\include -DNDEBUG -o build\.objs\test\windows\x64\release\src\main.cpp.o src\main.cpp
checking for flags (-MMD -MF) ... no
> cosmoc++ "-MMD" "-MF" "C:\Users\admin\AppData\Local\Temp\.xmake\240903\_0A1BD8E256EA4C40898BF2B391A7B670"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: C:/Users/admin/AppData/Local/Temp/.xmake/240903/_5C6262D1E7124140844C654BAC5A02A0: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.9sehvq6xkour2.aarch64.elf': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fdiagnostics-color=always) ... ok
> cosmoc++ "-fdiagnostics-color=always"
[ 75%]: linking.release test.exe
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -o build\windows\x64\release\test.exe build\.objs\test\windows\x64\release\src\main.cpp.o -LC:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\2fb24eff77a9413781385fd7616d4ab4\lib -labsl_statusor -labsl_status -labsl_scoped_set_env -labsl_random_seed_sequences -labsl_random_internal_pool_urbg -labsl_random_seed_gen_exception -labsl_random_internal_seed_material -labsl_random_internal_randen -labsl_random_internal_randen_slow -labsl_random_internal_randen_hwaes -labsl_random_internal_randen_hwaes_impl -labsl_random_internal_platform -labsl_random_internal_distribution_test_util -labsl_random_distributions -labsl_poison -labsl_periodic_sampler -labsl_log_initialize -labsl_log_flags -labsl_flags_parse -labsl_flags_usage -labsl_flags_usage_internal -labsl_flags_reflection -labsl_raw_hash_set 
-labsl_hashtablez_sampler -labsl_flags_private_handle_accessor -labsl_flags_internal -labsl_flags_marshalling -labsl_flags_config -labsl_flags_program_name -labsl_flags_commandlineflag -labsl_flags_commandlineflag_internal -labsl_failure_signal_handler -labsl_die_if_null -labsl_leak_check -labsl_cordz_sample_token -labsl_cord -labsl_cordz_info -labsl_cordz_handle -labsl_cordz_functions -labsl_exponential_biased -labsl_cord_internal -labsl_crc_cord_state -labsl_crc32c -labsl_crc_internal -labsl_crc_cpu_detect -labsl_bad_any_cast_impl -labsl_log_internal_conditions -labsl_log_internal_check_op -labsl_log_internal_message -labsl_strerror -labsl_log_internal_log_sink_set -labsl_log_sink -labsl_log_entry -labsl_log_globals -labsl_vlog_config_internal -labsl_synchronization -labsl_kernel_timeout_internal -labsl_graphcycles_internal -labsl_log_internal_fnmatch -labsl_hash -labsl_low_level_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_city -labsl_log_internal_proto -labsl_log_internal_format -labsl_str_format_internal -labsl_log_internal_globals -labsl_time -labsl_time_zone -labsl_civil_time -labsl_examine_stack -labsl_symbolize -labsl_malloc_internal -labsl_demangle_internal -labsl_demangle_rust -labsl_decode_rust_punycode -labsl_utf8_for_code_point -labsl_stacktrace -labsl_debugging_internal -labsl_strings -labsl_int128 -labsl_strings_internal -labsl_string_view -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_log_internal_nullguard
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_statusor: No such 
file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_status: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_scoped_set_env: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_seed_sequences: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_pool_urbg: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_seed_gen_exception: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_seed_material: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_randen: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_randen_slow: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_randen_hwaes: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_randen_hwaes_impl: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_platform: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_internal_distribution_test_util: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_random_distributions: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_poison: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_periodic_sampler: 
No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_initialize: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_flags: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_parse: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_usage: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_usage_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_reflection: 
No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_raw_hash_set: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_hashtablez_sampler: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_private_handle_accessor: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_marshalling: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_config: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_program_name: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_commandlineflag: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_flags_commandlineflag_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_failure_signal_handler: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_die_if_null: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_leak_check: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_cordz_sample_token: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_cord: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_cordz_info: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_cordz_handle: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_cordz_functions: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_exponential_biased: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_cord_internal: No 
such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_crc_cord_state: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_crc32c: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_crc_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_crc_cpu_detect: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_bad_any_cast_impl: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_conditions: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_check_op: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_message: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_strerror: No such 
file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_log_sink_set: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_sink: No such 
file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_entry: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_globals: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_vlog_config_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_synchronization: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_kernel_timeout_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_graphcycles_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_fnmatch: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_hash: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_low_level_hash: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_bad_variant_access: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_bad_optional_access: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_city: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_proto: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_format: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_str_format_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_globals: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_time: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_time_zone: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_civil_time: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_examine_stack: No 
such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_symbolize: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_malloc_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_demangle_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_demangle_rust: No 
such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_decode_rust_punycode: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_utf8_for_code_point: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_stacktrace: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_debugging_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_strings: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_int128: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_strings_internal: 
No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_string_view: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_throw_delegate: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_base: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_spinlock_wait: No 
such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_raw_logging_internal: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_severity: No such file or directory
/C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/../libexec/gcc/x86_64-linux-cosmo/14.1.0/ld.bfd: cannot find -labsl_log_internal_nullguard: No such file or directory
collect2: error: ld returned 1 exit status
C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.90uyvh6dvkl62.com.dbg: open failed with No such file or directory
C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.90uyvh6dvkl62.com.dbg: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.90uyvh6dvkl62.com.dbg': No such file or directory
error: @programdir\core\main.lua:329: @programdir\actions\build\main.lua:148: @programdir\modules\async\runjobs.lua:325: @programdir\actions\build\kinds\binary.lua:53: @programdir\core\sandbox\modules\os.lua:378: execv(C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -o build/windows/x64/release/test.exe build/.objs/test/windows/x64/release/src/main.cpp.o -LC:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\2fb24eff77a9413781385fd7616d4ab4\lib -labsl_statusor -labsl_status -labsl_scoped_set_env -labsl_random_seed_sequences -labsl_random_internal_pool_urbg -labsl_random_seed_gen_exception -labsl_random_internal_seed_material -labsl_random_internal_randen -labsl_random_internal_randen_slow -labsl_random_internal_randen_hwaes -labsl_random_internal_randen_hwaes_impl -labsl_random_internal_platform -labsl_random_internal_distribution_test_util -labsl_random_distributions -labsl_poison -labsl_periodic_sampler -labsl_log_initialize -labsl_log_flags -labsl_flags_parse -labsl_flags_usage -labsl_flags_usage_internal -labsl_flags_reflection -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_flags_private_handle_accessor -labsl_flags_internal -labsl_flags_marshalling -labsl_flags_config -labsl_flags_program_name -labsl_flags_commandlineflag -labsl_flags_commandlineflag_internal -labsl_failure_signal_handler -labsl_die_if_null -labsl_leak_check -labsl_cordz_sample_token -labsl_cord -labsl_cordz_info -labsl_cordz_handle -labsl_cordz_functions -labsl_exponential_biased -labsl_cord_internal -labsl_crc_cord_state -labsl_crc32c -labsl_crc_internal -labsl_crc_cpu_detect -labsl_bad_any_cast_impl -labsl_log_internal_conditions -labsl_log_internal_check_op -labsl_log_internal_message -labsl_strerror -labsl_log_internal_log_sink_set -labsl_log_sink -labsl_log_entry -labsl_log_globals -labsl_vlog_config_internal -labsl_synchronization -labsl_kernel_timeout_internal -labsl_graphcycles_internal -labsl_log_internal_fnmatch -labsl_hash -labsl_low_level_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_city -labsl_log_internal_proto -labsl_log_internal_format -labsl_str_format_internal -labsl_log_internal_globals -labsl_time -labsl_time_zone -labsl_civil_time -labsl_examine_stack -labsl_symbolize -labsl_malloc_internal -labsl_demangle_internal -labsl_demangle_rust -labsl_decode_rust_punycode -labsl_utf8_for_code_point -labsl_stacktrace -labsl_debugging_internal -labsl_strings -labsl_int128 -labsl_strings_internal -labsl_string_view -labsl_throw_delegate -labsl_base -labsl_spinlock_wait -labsl_raw_logging_internal -labsl_log_severity -labsl_log_internal_nullguard) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\sandbox\modules\os.lua:378]: in function 'execv'
    [@programdir\modules\core\tools\gcc.lua:586]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [@programdir\actions\build\kinds\binary.lua:53]: in function 'callback'
    [@programdir\modules\core\project\depend.lua:217]: in function 'on_changed'
    [@programdir\actions\build\kinds\binary.lua:41]: in function '_do_link_target'
    [@programdir\actions\build\kinds\binary.lua:83]:
    [@programdir\actions\build\kinds\binary.lua:110]: in function '_link_target'
    [@programdir\actions\build\kinds\binary.lua:138]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1003: in function 'base/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>
waruqi commented 2 months ago

you need move set_toolchains("@cosmocc") to the root description scope, otherwise abseil still use platform toolchain.

Chi-EEE commented 2 months ago

Compiling with abseil with set_toolchains("@cosmocc") in the root description scope works but compiling with the package zlib does not work:

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

add_requires("cosmocc")
set_toolchains("@cosmocc")
add_requires("zlib")

target("test")
    set_kind("binary")
    set_languages("c++17")
    add_packages("zlib")

    add_files("src/*.cpp")
PS C:\Users\admin\Downloads\cosmocc_test> xmake -vD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
finding zlib from xmake ..
checking for xmake::zlib ... no
finding zlib from find_zlib ..
finding zlib from vcpkg ..
finding zlib from conan ..
finding zlib from pkgconfig ..
checkinfo: cannot runv(pkg-config.exe --version), No such file or directory
checking for pkg-config ... no
checkinfo: cannot runv(pkgconf.exe --version), No such file or directory
checking for pkgconf ... no
finding zlib from system ..
checkinfo: <3>WSL (10) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (10) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c compiler (cc: cosmocc) ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_2A43E3760ABD4D60827887CF3709E5C0.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_775FB00633BC4F66BF87D39CCDE5CF30.c
checkinfo: <3>WSL (13) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (13) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checkinfo: <3>WSL (16) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (16) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c++ compiler (cxx: cosmocc) ... no
checkinfo: <3>WSL (19) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (19) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: <3>WSL (22) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (22) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 zlib.lib -out:C:\Users\admin\AppData\Local\Temp\.xmake\240904\_2A43E3760ABD4D60827887CF3709E5C0.b C:\Users\admin\AppData\Local\Temp\.xmake\240904\_2A43E3760ABD4D60827887CF3709E5C0.o
> checking for c links(zlib)
> checking for c snippet(find_package/zlib)
checkinfo: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\modules\core\tools\link.lua:175: LINK : fatal error LNK1181: cannot open input file 'zlib.lib'   

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\modules\core\tools\link.lua:175]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\link.lua:150]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [@programdir\modules\package\manager\system\find_package.lua:73]:
    [@programdir\modules\package\manager\find_package.lua:84]: in function '_find_package_with_builtin_rule'
    [@programdir\modules\package\manager\find_package.lua:130]: in function '_find_package'
    [@programdir\modules\package\manager\find_package.lua:194]:
    [@programdir\modules\lib\detect\find_package.lua:109]:
    [@programdir\core\package\package.lua:1873]: in function '_fetch_library'
    [@programdir\core\package\package.lua:2043]: in function 'fetch'
    [...modules\private\action\require\impl\install_packages.lua:340]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

checking for zlib ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> zlib v1.3.1 [toolchains:"@cosmocc", runtimes:"MT"]
please input: y (y/n/m)

checking for ping ... ok
pinging the host(github.com) ... 22 ms
checking for tar ... ok
tar -xf C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\z\zlib\v1.3.1\v1.3.1.tar.gz
C:\Users\admin\xmake\xmake.exe f --diagnosis --verbose -y -c --plat=windows --arch=x64 --mode=release --kind=static --vs=2022 --runtimes=MT --buildir=build_458cbb44
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DHAVE_STDDEF_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_B2BB483669CE42408141E7079F2EAB90.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_B3FAE03131E84BCF980C567ED51E281A.c
> checking for c includes(stddef.h)
checking for HAVE_STDDEF_H ... ok
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DHAVE_SYS_TYPES_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_D3324AD8647E4C1083FF0139469A3570.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_83451946B9C94C818D3008591D49D3D1.c
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DZ_HAVE_UNISTD_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_3FC69A25EAF5411083664B3422534350.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_06B26C42C6C94ECCB898078100E7B0D0.c
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DHAVE_STDINT_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_A1D2B4A122B748008F75C87B3129EB00.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_D8DE1803C59C4770864681C4AE1591AF.c
> checking for c includes(sys/types.h)
checking for HAVE_SYS_TYPES_H ... ok
> checking for c includes(stdint.h)
checking for HAVE_STDINT_H ... ok
> checking for c includes(unistd.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\cl.lua:741: _06B26C42C6C94ECCB898078100E7B0D0.c
C:\Users\admin\AppData\Local\Temp\.xmake\240904\_06B26C42C6C94ECCB898078100E7B0D0.c(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\modules\core\tools\cl.lua:741]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\cl.lua:680]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@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:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\project\option.lua:205]: in function '_do_check_cxsnippets'
    [@programdir\core\project\option.lua:257]:
    [@programdir\core\project\option.lua:305]: in function '_check'
    [@programdir\core\project\option.lua:362]: in function 'check'
    [...dir\core\sandbox\modules\import\core\project\project.lua:108]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

checking for Z_HAVE_UNISTD_H ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(github.com) ... 24 ms
pinging the host(gitlab.com) ... 26 ms
pinging the host(gitee.com) ... 262 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
configure
{
    runtimes = MT
    vs = 2022
    clean = true
    host = windows
    mode = release
    kind = static
    plat = windows
    ccache = true
    buildir = build_458cbb44
    arch = x64
    ndk_stdcxx = true
}
C:\Users\admin\xmake\xmake.exe build --diagnosis --verbose
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for flags (-O3) ... ok
> cosmocc "-O3"
checking for flags (-DNDEBUG) ... ok
> cosmocc "-DNDEBUG"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
[ 88%]: cache compiling.release adler32.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\adler32.c.o adler32.c
[ 88%]: compiling.release uncompr.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\uncompr.c.o uncompr.c
[ 88%]: compiling.release gzwrite.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzwrite.c.o gzwrite.c
[ 88%]: compiling.release gzlib.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzlib.c.o gzlib.c
[ 88%]: compiling.release crc32.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\crc32.c.o crc32.c
[ 88%]: compiling.release compress.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\compress.c.o compress.c
[ 88%]: compiling.release zutil.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\zutil.c.o zutil.c
[ 88%]: compiling.release infback.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\infback.c.o infback.c
[ 88%]: compiling.release gzclose.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzclose.c.o gzclose.c
[ 88%]: compiling.release inflate.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\inflate.c.o inflate.c
[ 88%]: compiling.release trees.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\trees.c.o trees.c
[ 88%]: compiling.release deflate.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\deflate.c.o deflate.c
[ 88%]: compiling.release inftrees.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\inftrees.c.o inftrees.c
[ 88%]: compiling.release inffast.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\inffast.c.o inffast.c
[ 88%]: compiling.release gzread.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzread.c.o gzread.c
checking for flags (-MMD -MF) ... no
> cosmocc "-MMD" "-MF" "C:\Users\admin\AppData\Local\Temp\.xmake\240904\_F8758D3073BB467083BA661FA6F276F0"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: C:/Users/admin/AppData/Local/Temp/.xmake/240904/_2E84D52D8E944C608E8CDC4556D4A4C0: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.te3i194ooc141.aarch64.elf': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fdiagnostics-color=always) ... ok
> cosmocc "-fdiagnostics-color=always"
checking for cosmoar ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoar
checking for the static library archiver (ar) ... cosmoar
[ 94%]: archiving.release libzlib.a
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar -cr build_458cbb44\windows\x64\release\libzlib.a build_458cbb44\.objs\zlib\windows\x64\release\adler32.c.o build_458cbb44\.objs\zlib\windows\x64\release\compress.c.o build_458cbb44\.objs\zlib\windows\x64\release\crc32.c.o build_458cbb44\.objs\zlib\windows\x64\release\deflate.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzclose.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzlib.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzread.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzwrite.c.o build_458cbb44\.objs\zlib\windows\x64\release\inflate.c.o build_458cbb44\.objs\zlib\windows\x64\release\infback.c.o build_458cbb44\.objs\zlib\windows\x64\release\inftrees.c.o build_458cbb44\.objs\zlib\windows\x64\release\inffast.c.o build_458cbb44\.objs\zlib\windows\x64\release\trees.c.o build_458cbb44\.objs\zlib\windows\x64\release\uncompr.c.o build_458cbb44\.objs\zlib\windows\x64\release\zutil.c.o

build cache stats:
cache directory: build_458cbb44\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s

[100%]: build ok, spent 4.031s
C:\Users\admin\xmake\xmake.exe install -y --nopkgs -o C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038 --diagnosis --verbose
installing zlib ..
installing zlib to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038 ..
> copy build_458cbb44\windows\x64\release\libzlib.a to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\lib
> copy zlib.h to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\include\zlib.h
> copy zconf.h to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\include\zconf.h
install ok!
finding zlib from xmake ..
checking for xmake::zlib ... zlib v1.3.1
{
  license = "zlib",
  sysincludedirs = {
    "C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\include"
  },
  static = true,
  version = "v1.3.1"
}

patching C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\lib\pkgconfig\zlib.pc ..
checkinfo: <3>WSL (25) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (25) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: <3>WSL (28) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (28) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the shared library linker (sh) ... link.exe
error: @programdir\core\package\package.lua:2444: package(zlib): links not found!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\package\package.lua:2444]: in function '_generate_build_configs'
    [@programdir\core\package\package.lua:2460]: in function 'has_cfuncs'
    [....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89]: 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:432]:

  => install zlib v1.3.1 .. 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:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1003: 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>
waruqi commented 2 months ago

try

xrepo remove --all -y cosmocc
xrepo update-repo
xmake f -cvD
xmake
Chi-EEE commented 2 months ago
add_rules("mode.debug", "mode.release")

add_requires("cosmocc")
set_toolchains("@cosmocc")
add_requires("zlib")

target("test")
    set_kind("binary")
    set_languages("c++17")
    add_packages("zlib")

    add_files("src/*.cpp")
PS C:\Users\admin\Downloads\cosmocc_test> xrepo remove --all -y cosmocc
PS C:\Users\admin\Downloads\cosmocc_test> xrepo update-repo
updating repositories .. ok
PS C:\Users\admin\Downloads\cosmocc_test> xmake f -cvD
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(gitlab.com) ... 30 ms
pinging the host(github.com) ... 23 ms
pinging the host(gitee.com) ... 194 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no  
checking for cosmocc ... no
checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
note: install or modify (m) these toolchain packages first (pass -y to skip confirm)?
in xmake-repo:
  -> cosmocc 3.8.0 
please input: y (y/n/m)

pinging the host(cosmo.zip) ... 141 ms
C:\Users\admin\xmake\winenv\bin\7z x -y cosmocc-3.8.0.zip -osource.tmp

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

Scanning the drive for archives:
1 file, 369235551 bytes (353 MiB)

Extracting archive: cosmocc-3.8.0.zip
--
Path = cosmocc-3.8.0.zip
Type = zip
Physical Size = 369235551

Everything is Ok

Folders: 144
Files: 3007
Size:       1130956924
Compressed: 369235551
checking for sh ... ok
checking for cosmocc ... no
checking for cosmocc ... no
{
  deps = { },
  version = "3.8.0",
  arch = "x64",
  repo = {
    name = "xmake-repo",
    url = "https://github.com/xmake-io/xmake-repo.git",
    branch = "master",
    commit = "2895d01be94e8cb9bf440436d268f902cedc7642"
  },
  description = "build-once run-anywhere c library",
  plat = "windows",
  pathenvs = {
    "LD_LIBRARY_PATH",
    "ACLOCAL_PATH",
    "DYLD_LIBRARY_PATH",
    "PYTHONPATH",
    "PKG_CONFIG_PATH",
    "CMAKE_PREFIX_PATH",
    "PATH"
  },
  kind = "toolchain",
  librarydeps = { },
  license = "ISC",
  artifacts = {
    installdir = "C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5"
  },
  name = "cosmocc",
  envs = {
    PATH = {
      "bin"
    }
  },
  mode = "release",
  configs = {
    runtimes = "MT",
    shared = false,
    pic = true,
    debug = false
  }
}

C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc --version
C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc (GCC) 14.1.0
Copyright (c) 2024 Justine Alexandra Roberts Tunney
Cosmopolitan Libc and LLVM libcxx/compiler-rt are subject to non-GPL
notice licenses, e.g. ISC, MIT, etc. Your compiled programs must embed
our copyright notices. This toolchain is configured to do so by default.
Cosmopolitan comes with absolutely NO WARRANTY of any kind.
For more information, see the Cosmopolitan LICENSE files.
Copyright (C) 2022 Free Software Foundation, Inc.
This launches GNU GCC/Binutils subprocesses, which is free software; see
cosmocc's LICENSE files for source code and copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++ --version
C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++ (GCC) 14.1.0
Copyright (c) 2024 Justine Alexandra Roberts Tunney
Cosmopolitan Libc and LLVM libcxx/compiler-rt are subject to non-GPL
notice licenses, e.g. ISC, MIT, etc. Your compiled programs must embed
our copyright notices. This toolchain is configured to do so by default.
Cosmopolitan comes with absolutely NO WARRANTY of any kind.
For more information, see the Cosmopolitan LICENSE files.
Copyright (C) 2022 Free Software Foundation, Inc.
This launches GNU GCC/Binutils subprocesses, which is free software; see
cosmocc's LICENSE files for source code and copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  => install cosmocc 3.8.0 .. ok
finding zlib from xmake ..
checking for xmake::zlib ... no
finding zlib from find_zlib ..
finding zlib from vcpkg ..
finding zlib from conan ..
finding zlib from pkgconfig ..
checkinfo: cannot runv(pkg-config.exe --version), No such file or directory
checking for pkg-config ... no
checkinfo: cannot runv(pkgconf.exe --version), No such file or directory
checking for pkgconf ... no
finding zlib from system ..
checkinfo: <3>WSL (10) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (10) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c compiler (cc: cosmocc) ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_683B58481C8F4D1088DD755512470D30.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_775FB00633BC4F66BF87D39CCDE5CF30.c
checkinfo: <3>WSL (13) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (13) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the c++ compiler (cxx: cosmoc++) ... no
checkinfo: <3>WSL (16) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (16) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the c++ compiler (cxx: cosmocc) ... no
checkinfo: <3>WSL (19) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (19) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the linker (ld: cosmoc++) ... no
checkinfo: <3>WSL (22) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (22) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the linker (ld: cosmocc) ... no
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 zlib.lib -out:C:\Users\admin\AppData\Local\Temp\.xmake\240904\_683B58481C8F4D1088DD755512470D30.b C:\Users\admin\AppData\Local\Temp\.xmake\240904\_683B58481C8F4D1088DD755512470D30.o
> checking for c links(zlib)
> checking for c snippet(find_package/zlib)
checkinfo: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\modules\core\tools\link.lua:175: LINK : fatal error LNK1181: cannot open input file 'zlib.lib'     

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\modules\core\tools\link.lua:175]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\link.lua:150]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [@programdir\modules\package\manager\system\find_package.lua:73]:
    [@programdir\modules\package\manager\find_package.lua:84]: in function '_find_package_with_builtin_rule'
    [@programdir\modules\package\manager\find_package.lua:130]: in function '_find_package'
    [@programdir\modules\package\manager\find_package.lua:194]:
    [@programdir\modules\lib\detect\find_package.lua:109]:
    [@programdir\core\package\package.lua:1873]: in function '_fetch_library'
    [@programdir\core\package\package.lua:2043]: in function 'fetch'
    [...modules\private\action\require\impl\install_packages.lua:340]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

checking for zlib ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> zlib v1.3.1 [runtimes:"MT", toolchains:"@cosmocc"]
please input: y (y/n/m)

checking for tar ... ok
tar -xf C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\z\zlib\v1.3.1\v1.3.1.tar.gz
C:\Users\admin\xmake\xmake.exe f --diagnosis --verbose -y -c --plat=windows --arch=x64 --mode=release --kind=static --vs=2022 --runtimes=MT --buildir=build_458cbb44
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DZ_HAVE_UNISTD_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_2C6814D87C99424081D57A3162091AA0.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_06B26C42C6C94ECCB898078100E7B0D0.c
> checking for c includes(unistd.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\cl.lua:741: _06B26C42C6C94ECCB898078100E7B0D0.c
C:\Users\admin\AppData\Local\Temp\.xmake\240904\_06B26C42C6C94ECCB898078100E7B0D0.c(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\modules\core\tools\cl.lua:741]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\cl.lua:680]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@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:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\project\option.lua:205]: in function '_do_check_cxsnippets'
    [@programdir\core\project\option.lua:257]:
    [@programdir\core\project\option.lua:305]: in function '_check'
    [@programdir\core\project\option.lua:362]: in function 'check'
    [...dir\core\sandbox\modules\import\core\project\project.lua:108]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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]:

checking for Z_HAVE_UNISTD_H ... no
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DHAVE_STDDEF_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_5DCC9C046E3F4F508273B7A7C97BC6A0.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_B3FAE03131E84BCF980C567ED51E281A.c
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DHAVE_SYS_TYPES_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_C4180CDFE03C486085F4A96596D505B0.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_83451946B9C94C818D3008591D49D3D1.c
checking for the c compiler (cc) ... cl.exe
> "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\cl.exe" -c -nologo -DHAVE_STDINT_H -FoC:\Users\admin\AppData\Local\Temp\.xmake\240904\_F8DCA56BBE8049008528215D029D5380.o C:\Users\admin\AppData\Local\Temp\.xmake\240904\_D8DE1803C59C4770864681C4AE1591AF.c
> checking for c includes(stddef.h)
checking for HAVE_STDDEF_H ... ok
> checking for c includes(sys/types.h)
checking for HAVE_SYS_TYPES_H ... ok
> checking for c includes(stdint.h)
checking for HAVE_STDINT_H ... ok
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(github.com) ... 22 ms
pinging the host(gitlab.com) ... 31 ms
pinging the host(gitee.com) ... 65535 ms
git rev-parse HEAD
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
configure
{
    clean = true
    host = windows
    ccache = true
    mode = release
    buildir = build_458cbb44
    ndk_stdcxx = true
    runtimes = MT
    vs = 2022
    kind = static
    plat = windows
    arch = x64
}
C:\Users\admin\xmake\xmake.exe build --diagnosis --verbose
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for flags (-O3) ... ok
> cosmocc "-O3"
checking for flags (-DNDEBUG) ... ok
> cosmocc "-DNDEBUG"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
[ 88%]: cache compiling.release adler32.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\adler32.c.o adler32.c
[ 88%]: compiling.release inftrees.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\inftrees.c.o inftrees.c
[ 88%]: compiling.release gzread.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzread.c.o gzread.c
[ 88%]: compiling.release infback.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\infback.c.o infback.c
[ 88%]: compiling.release gzlib.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzlib.c.o gzlib.c
[ 88%]: compiling.release uncompr.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\uncompr.c.o uncompr.c
[ 88%]: compiling.release gzwrite.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzwrite.c.o gzwrite.c
[ 88%]: compiling.release gzclose.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\gzclose.c.o gzclose.c
[ 88%]: compiling.release deflate.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\deflate.c.o deflate.c
[ 88%]: compiling.release compress.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\compress.c.o compress.c
[ 88%]: compiling.release crc32.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\crc32.c.o crc32.c
[ 88%]: compiling.release trees.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\trees.c.o trees.c
[ 88%]: compiling.release zutil.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\zutil.c.o zutil.c
[ 88%]: compiling.release inflate.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\inflate.c.o inflate.c
[ 88%]: compiling.release inffast.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fvisibility=hidden -O3 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -o build_458cbb44\.objs\zlib\windows\x64\release\inffast.c.o inffast.c
checking for flags (-MMD -MF) ... no
> cosmocc "-MMD" "-MF" "C:\Users\admin\AppData\Local\Temp\.xmake\240904\_FBC24EEFB1E744308DCD436638D6FB30"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: C:/Users/admin/AppData/Local/Temp/.xmake/240904/_0A8FB0D16DBF491088D36F21CA4B3120: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.958zj2957w5v2.aarch64.elf': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fdiagnostics-color=always) ... ok
> cosmocc "-fdiagnostics-color=always"
checking for cosmoar ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoar
checking for the static library archiver (ar) ... cosmoar
[ 94%]: archiving.release libzlib.a
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar -cr build_458cbb44\windows\x64\release\libzlib.a build_458cbb44\.objs\zlib\windows\x64\release\adler32.c.o build_458cbb44\.objs\zlib\windows\x64\release\compress.c.o build_458cbb44\.objs\zlib\windows\x64\release\crc32.c.o build_458cbb44\.objs\zlib\windows\x64\release\deflate.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzclose.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzlib.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzread.c.o build_458cbb44\.objs\zlib\windows\x64\release\gzwrite.c.o build_458cbb44\.objs\zlib\windows\x64\release\inflate.c.o build_458cbb44\.objs\zlib\windows\x64\release\infback.c.o build_458cbb44\.objs\zlib\windows\x64\release\inftrees.c.o build_458cbb44\.objs\zlib\windows\x64\release\inffast.c.o build_458cbb44\.objs\zlib\windows\x64\release\trees.c.o build_458cbb44\.objs\zlib\windows\x64\release\uncompr.c.o build_458cbb44\.objs\zlib\windows\x64\release\zutil.c.o

build cache stats:
cache directory: build_458cbb44\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s

[100%]: build ok, spent 5.109s
C:\Users\admin\xmake\xmake.exe install -y --nopkgs -o C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038 --diagnosis --verbose
installing zlib ..
installing zlib to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038 ..
> copy build_458cbb44\windows\x64\release\libzlib.a to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\lib
> copy zlib.h to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\include\zlib.h
> copy zconf.h to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\include\zconf.h
install ok!
finding zlib from xmake ..
checking for xmake::zlib ... zlib v1.3.1
{
  version = "v1.3.1",
  license = "zlib",
  sysincludedirs = {
    "C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\458cbb44fd774deda1eba8e5e4597038\include"
  },
  static = true
}

checkinfo: <3>WSL (25) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (25) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmoc++ --version), No such file or directory
checking for cosmoc++ ... no
checking for the shared library linker (sh: cosmoc++) ... no
checkinfo: <3>WSL (28) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (28) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

checkinfo: cannot runv(cosmocc --version), No such file or directory
checking for cosmocc ... no
checking for the shared library linker (sh: cosmocc) ... no
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe
checking for the shared library linker (sh) ... link.exe
error: @programdir\core\package\package.lua:2444: package(zlib): links not found!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [@programdir\core\package\package.lua:2444]: in function '_generate_build_configs'
    [@programdir\core\package\package.lua:2460]: in function 'has_cfuncs'
    [....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89]: 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:432]:

  => install zlib v1.3.1 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1003]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1003: 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>
PS C:\Users\admin\Downloads\cosmocc_test> xmake
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> zlib v1.3.1 [toolchains:"@cosmocc", runtimes:"MT"]
please input: y (y/n/m)

  => install zlib v1.3.1 .. failed     

package(zlib): links not found!
if you want to get more verbose errors, please see:
  -> C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\z\zlib\v1.3.1\installdir.failed\logs\install.txt
error: install failed!
waruqi commented 2 months ago

window platform will bind msvc toolchain, it does not support to switch toolchain. please use cross platform

xmake update -s dev
xmake f -p cross -cvD
xmake

BTW, some packages and cmake maybe does not support cosmocc.

Chi-EEE commented 2 months ago

I got a new error while installing zlib and I got a new error while installing abseil:

PS C:\Users\admin\Downloads\cosmocc_test> xmake update -s dev
update version dev from official source ..
  => download https://gitlab.com/tboox/xmake.git .. ok
  => install script to C:\Users\admin\xmake .. ok
PS C:\Users\admin\Downloads\cosmocc_test> xmake f -p cross -cvD
checking for architecture ... none
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
finding zlib from xmake ..
checking for xmake::zlib ... no
finding zlib from find_zlib ..
finding zlib from vcpkg ..
finding zlib from conan ..
finding z from system ..
checking for zlib ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> zlib v1.3.1 [toolchains:"@cosmocc"]
please input: y (y/n/m)

checking for ping ... ok
pinging the host(github.com) ... 29 ms
checking for tar ... ok
tar -xf C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\z\zlib\v1.3.1\v1.3.1.tar.gz
C:\Users\admin\xmake\xmake.exe f --diagnosis --verbose -y -c --plat=cross --arch=none --mode=release --kind=static --bin=C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin --sdk=C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5 --cxflags=-fPIC --buildir=build_9b6c464c --cxflags=-fPIC
checkinfo: cannot runv(gcc.exe --version), No such file or directory
checking for gcc ... no
checking for the c compiler (cc: gcc) ... no
checkinfo: cannot runv(clang.exe --version), No such file or directory
checking for clang ... no
checking for the c compiler (cc: clang) ... no
> checking for c includes(stddef.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37: cannot get program for cc
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37]: in function 'load'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:60]: in function 'compargv'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:44]: in function 'compcmd'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:240]:

checking for HAVE_STDDEF_H ... no
checking for the c compiler (cc: gcc) ... no
> checking for c includes(stdint.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37: cannot get program for cc
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37]: in function 'load'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:60]: in function 'compargv'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:44]: in function 'compcmd'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:240]:

checking for HAVE_STDINT_H ... no
checking for the c compiler (cc: gcc) ... no
> checking for c includes(sys/types.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37: cannot get program for cc
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37]: in function 'load'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:60]: in function 'compargv'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:44]: in function 'compcmd'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:240]:

checking for HAVE_SYS_TYPES_H ... no
checking for the c compiler (cc: gcc) ... no
> checking for c includes(unistd.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37: cannot get program for cc
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37]: in function 'load'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:60]: in function 'compargv'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:44]: in function 'compcmd'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:240]:

checking for Z_HAVE_UNISTD_H ... no
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
checking for ping ... ok
pinging the host(github.com) ... 22 ms
pinging the host(gitlab.com) ... 24 ms
pinging the host(gitee.com) ... 258 ms
git rev-parse HEAD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
configure
{
    ndk_stdcxx = true
    arch = none
    target_os = linux
    cxflags = -fPIC
    host = windows
    kind = static
    mode = release
    sdk = C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5
    clean = true
    buildir = build_9b6c464c
    plat = cross
    ccache = true
    bin = C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin
}
C:\Users\admin\xmake\xmake.exe build --diagnosis --verbose
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for the c compiler (cc) ... cosmocc
checking for flags (-fPIC) ... ok
> cosmocc "-fPIC"
checking for flags (-O3) ... ok
> cosmocc "-O3"
checking for flags (-DNDEBUG) ... ok
> cosmocc "-DNDEBUG"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
[ 88%]: cache compiling.release adler32.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\adler32.c.o adler32.c
[ 88%]: compiling.release zutil.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\zutil.c.o zutil.c
[ 88%]: compiling.release compress.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\compress.c.o compress.c
[ 88%]: compiling.release crc32.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\crc32.c.o crc32.c
[ 88%]: compiling.release gzclose.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\gzclose.c.o gzclose.c
[ 88%]: compiling.release inflate.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\inflate.c.o inflate.c
[ 88%]: compiling.release infback.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\infback.c.o infback.c
[ 88%]: compiling.release inffast.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\inffast.c.o inffast.c
[ 88%]: compiling.release gzlib.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\gzlib.c.o gzlib.c
[ 88%]: compiling.release inftrees.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\inftrees.c.o inftrees.c
[ 88%]: compiling.release gzread.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\gzread.c.o gzread.c
[ 88%]: compiling.release trees.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\trees.c.o trees.c
[ 88%]: compiling.release deflate.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\deflate.c.o deflate.c
[ 88%]: compiling.release uncompr.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\uncompr.c.o uncompr.c
[ 88%]: compiling.release gzwrite.c
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -fPIC -fvisibility=hidden -O3 -DZEXPORT=__attribute__((visibility(\"default\"))) -D_LARGEFILE64_SOURCE=1 -DNDEBUG -o build_9b6c464c\.objs\zlib\cross\none\release\gzwrite.c.o gzwrite.c
checking for flags (-MMD -MF) ... no
> cosmocc "-MMD" "-MF" "C:\Users\admin\AppData\Local\Temp\.xmake\240905\_51930179B2F443708B07CE5209CD66D0"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: C:/Users/admin/AppData/Local/Temp/.xmake/240905/_2158D52579A04C4080172629C8690190: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.lrzh7hvoga712.aarch64.elf': No such file or directory

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fdiagnostics-color=always) ... ok
> cosmocc "-fdiagnostics-color=always"
In file included from zutil.h:22,
                 from adler32.c:8:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from compress.c:9:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from zutil.c:8:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
zutil.c:27:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
   27 | const char * ZEXPORT zlibVersion(void) {
      | ^~~~~
zutil.c:131:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  131 | const char * ZEXPORT zError(int err) {
      | ^~~~~
In file included from uncompr.c:9:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from crc32.c:30:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
crc32.c:549:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  549 | const z_crc_t FAR * ZEXPORT get_crc_table(void) {
      | ^~~~~
In file included from gzguts.h:21,
                 from gzclose.c:6:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from inftrees.c:6:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from inffast.c:6:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from gzguts.h:21,
                 from gzlib.c:6:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
gzlib.c:487:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  487 | const char * ZEXPORT gzerror(gzFile file, int *errnum) {
      | ^~~~~
In file included from gzguts.h:21,
                 from gzread.c:6:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
gzread.c:499:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  499 | char * ZEXPORT gzgets(gzFile file, char *buf, int len) {
      | ^~~~
In file included from zutil.h:22,
                 from infback.c:13:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from gzguts.h:21,
                 from gzwrite.c:6:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from deflate.h:16,
                 from trees.c:37:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from inflate.c:83:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
In file included from zutil.h:22,
                 from deflate.h:16,
                 from deflate.c:52:
zlib.h:220:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
  220 | ZEXTERN const char * ZEXPORT zlibVersion(void);
      | ^~~~~~~
zlib.h:1494:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1494 | ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
      | ^~~~~~~
zlib.h:1659:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1659 | ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
      | ^~~~~~~
zlib.h:1914:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1914 | ZEXTERN const char   * ZEXPORT zError(int);
      | ^~~~~~~
zlib.h:1916:1: warning: 'visibility' attribute ignored on non-class types [-Wattributes]
 1916 | ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
      | ^~~~~~~
checking for cosmoar ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoar
checking for the static library archiver (ar) ... cosmoar
[ 94%]: archiving.release libz.a
C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar -cr build_9b6c464c\cross\none\release\libz.a build_9b6c464c\.objs\zlib\cross\none\release\adler32.c.o build_9b6c464c\.objs\zlib\cross\none\release\compress.c.o build_9b6c464c\.objs\zlib\cross\none\release\crc32.c.o build_9b6c464c\.objs\zlib\cross\none\release\deflate.c.o build_9b6c464c\.objs\zlib\cross\none\release\gzclose.c.o build_9b6c464c\.objs\zlib\cross\none\release\gzlib.c.o build_9b6c464c\.objs\zlib\cross\none\release\gzread.c.o build_9b6c464c\.objs\zlib\cross\none\release\gzwrite.c.o build_9b6c464c\.objs\zlib\cross\none\release\inflate.c.o build_9b6c464c\.objs\zlib\cross\none\release\infback.c.o build_9b6c464c\.objs\zlib\cross\none\release\inftrees.c.o build_9b6c464c\.objs\zlib\cross\none\release\inffast.c.o build_9b6c464c\.objs\zlib\cross\none\release\trees.c.o build_9b6c464c\.objs\zlib\cross\none\release\uncompr.c.o build_9b6c464c\.objs\zlib\cross\none\release\zutil.c.o

build cache stats:
cache directory: build_9b6c464c\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s

[100%]: build ok, spent 5.156s
C:\Users\admin\xmake\xmake.exe install -y --nopkgs -o C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b --diagnosis --verbose
installing zlib ..
installing zlib to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b ..
> copy build_9b6c464c\cross\none\release\libz.a to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib
> copy zlib.h to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\include\zlib.h
> copy zconf.h to C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\include\zconf.h
install ok!
finding zlib from xmake ..
checking for xmake::zlib ... zlib v1.3.1
{
  license = "zlib",
  version = "v1.3.1",
  links = {
    "z"
  },
  sysincludedirs = {
    "C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\include" 
  },
  static = true,
  libfiles = {
    "C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib\libz.a"
  },
  linkdirs = {
    "C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib"
  }
}

patching C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib\pkgconfig\zlib.pc ..
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for flags (-fPIC) ... ok
> cosmocc "-fPIC"
> C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -c -isystem C:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\include -o C:\Users\admin\AppData\Local\Temp\.xmake\240905\_AE13E212BEC040308AF22FBE36EF5780.o C:\Users\admin\AppData\Local\Temp\.xmake\240905\_DA0C2BE4F695434A847B3B5877F6A479.c
checking for flags (-fdiagnostics-color=always) ... ok
> cosmocc "-fdiagnostics-color=always"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the linker (ld) ... cosmoc++
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ ... ok
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
> C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -o C:\Users\admin\AppData\Local\Temp\.xmake\240905\_AE13E212BEC040308AF22FBE36EF5780.b C:\Users\admin\AppData\Local\Temp\.xmake\240905\_AE13E212BEC040308AF22FBE36EF5780.o -LC:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib -lz
C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.43nc83xp4uk42.aarch64.elf: No such file or directory
C:/Users/admin/AppData/Local/Temp/.xmake/240905/_AE13E212BEC040308AF22FBE36EF5780.b: No such file or directory
mv: cannot stat 'C:/Users/admin/AppData/Local/.xmake/packages/m/msys2-base/2024.01.13/a77fa58bdf6d49bbbfa0c92a5cf82862/tmp/fatcosmocc.43nc83xp4uk42.aarch64.elf': No such file or directory
> checking for c includes(zlib.h)
> checking for c funcs(inflate)
> checking for c links(z)
> checking for c snippet(has_cfuncs)
checkinfo: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\core\sandbox\modules\os.lua:378: execv(C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -o C:/Users/admin/AppData/Local/Temp/.xmake/240905/_AE13E212BEC040308AF22FBE36EF5780.b C:/Users/admin/AppData/Local/Temp/.xmake/240905/_AE13E212BEC040308AF22FBE36EF5780.o -LC:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib -lz) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:378]: in function 'execv'
    [@programdir\modules\core\tools\gcc.lua:586]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89]: 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:432]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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: ....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89: ...gramdir\core\sandbox\modules\import\core\tool\linker.lua:75: @programdir\core\sandbox\modules\os.lua:378: execv(C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -o C:/Users/admin/AppData/Local/Temp/.xmake/240905/_AE13E212BEC040308AF22FBE36EF5780.b C:/Users/admin/AppData/Local/Temp/.xmake/240905/_AE13E212BEC040308AF22FBE36EF5780.o -LC:\Users\admin\AppData\Local\.xmake\packages\z\zlib\v1.3.1\9b6c464cec704cc78620decffbfe079b\lib -lz) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:378]: in function 'execv'
    [@programdir\modules\core\tools\gcc.lua:586]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]:
    [@programdir\core\tool\linker.lua:222]: in function 'link'
    [...gramdir\core\sandbox\modules\import\core\tool\linker.lua:73]: in function 'link'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [@programdir\modules\lib\detect\check_cxsnippets.lua:236]:
    [....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89]: 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:432]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: in function 'trycall'
    [@programdir\core\sandbox\modules\try.lua:117]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:241]: 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 zlib v1.3.1 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1004: in function 'base/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>

abseil:

PS C:\Users\admin\Downloads\cosmocc_test> xmake f -p cross -cvD
checking for architecture ... none
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... C:\Program Files\CMake\bin\cmake
finding abseil from xmake ..
checking for xmake::abseil ... no
finding abseil from vcpkg ..
finding abseil from conan ..
checking for abseil ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> abseil 20240722.0 [toolchains:"@cosmocc"]
please input: y (y/n/m)

checking for ping ... ok
pinging the host(github.com) ... 24 ms
checking for tar ... ok
tar -xf C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\20240722.0.tar.gz
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the assember (as) ... cosmocc
checking for cosmoar ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoar
checking for the static library archiver (ar) ... cosmoar
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the linker (ld) ... cosmoc++
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checkinfo: cannot runv(aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checking for aarch64-linux-cosmo-ranlib ... no
checking for the archive index generator (ranlib: aarch64-linux-cosmo-ranlib) ... no
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for flags (-fPIC) ... ok
> cosmocc "-fPIC"
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ ... ok
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
checking for flags (-fPIC) ... no
> cosmocc "-fPIC"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: cosmocc: fatal error: C:/Users/admin/AppData/Local/Temp/.xmake/240905/_FC21FE6CFF764CC794F7A6A82EEB0C29.s: assembler input files not supported
compilation terminated.

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the shared library linker (sh) ... cosmoc++
checking for flags (-fPIC) ... no
> cosmoc++ "-fPIC" "-shared"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: cosmoc++: fatal error: -shared flag not supported
compilation terminated.

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for cmake ... C:\Program Files\CMake\bin\cmake
C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++.exe -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar.exe -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_OSX_SYSROOT= -DCMAKE_STATIC_LINKER_FLAGS= C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\source
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
error: @programdir\core\sandbox\modules\os.lua:378: execv(C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib 
-G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++.exe -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar.exe -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_OSX_SYSROOT= -DCMAKE_STATIC_LINKER_FLAGS= C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\source) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:378]:
    [@programdir\core\sandbox\modules\os.lua:291]: in function 'vrunv'
    [@programdir\modules\package\tools\cmake.lua:1193]: in function 'configure'
    [@programdir\modules\package\tools\cmake.lua:1235]: in function 'install'
    [...make\repositories\xmake-repo\packages\a\abseil\xmake.lua:49]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...\modules\private\action\require\impl\actions\install.lua:392]:

  => install abseil 20240722.0 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1004: in function 'base/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>
waruqi commented 2 months ago

C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++.exe -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar.exe -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_OSX_SYSROOT= -DCMAKE_STATIC_LINKER_FLAGS= C:\Users\admin\AppData\Local.xmake\cache\packages\2409\a\abseil\20240722.0\source CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. -- Configuring incomplete, errors occurred!

you need to run it on msys2. it need make

Chi-EEE commented 2 months ago

Ok, I ran it in the xrepo env shell using msys bash and got this error:

PS C:\Users\admin\Downloads\cosmocc_test> xmake update --scriptonly dev
update version dev from official source ..
  => download https://github.com/xmake-io/xmake.git .. ok
  => install script to C:\Users\admin\xmake .. ok
PS C:\Users\admin\Downloads\cosmocc_test> xrepo env shell
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
[cosmocc_test] PS C:\Users\admin\Downloads\cosmocc_test> bash

admin@DESKTOP-N65NNPO  /c/Users/admin/Downloads/cosmocc_test
$ xmake f -p cross -cvD
checking for architecture ... none
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checking for gzip ... ok
checking for tar ... ok
git rev-parse HEAD     
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022        
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... C:\Program Files\CMake\bin\cmake
finding abseil from xmake ..
checking for xmake::abseil ... no
finding abseil from vcpkg ..
finding abseil from conan ..
checking for abseil ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> abseil 20240722.0 [toolchains:"@cosmocc"]
please input: y (y/n/m)

checking for ping ... ok
pinging the host(github.com) ... 26 ms
tar -xf C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\20240722.0.tar.gz
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the assember (as) ... cosmocc
checking for cosmoar ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoar
checking for the static library archiver (ar) ... cosmoar
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the linker (ld) ... cosmoc++
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\aarch64-linux-cosmo-ranlib.exe --version), No such file or directory        
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\aarch64-linux-cosmo-ranlib.exe --version), No such file or directory        
checkinfo: cannot runv(aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checking for aarch64-linux-cosmo-ranlib ... no
checking for the archive index generator (ranlib: aarch64-linux-cosmo-ranlib) ... no
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for flags (-fPIC) ... ok
> cosmocc "-fPIC"
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ ... ok
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
checking for flags (-fPIC) ... no
> cosmocc "-fPIC"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: cosmocc: fatal error: C:/Users/admin/AppData/Local/Temp/.xmake/240906/_FC21FE6CFF764CC794F7A6A82EEB0C29.s: assembler input files not supported
compilation terminated.

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the shared library linker (sh) ... cosmoc++
checking for flags (-fPIC) ... no
> cosmoc++ "-fPIC" "-shared"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: cosmoc++: fatal error: -shared flag not supported
compilation terminated.

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for cmake ... C:\Program Files\CMake\bin\cmake
C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar.exe -DCMAKE_STATIC_LINKER_FLAGS= -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++.exe C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\source
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:26 (project):
  The CMAKE_CXX_COMPILER:

    C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++.exe

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
error: @programdir\core\sandbox\modules\os.lua:378: execv(C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc.exe -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar.exe -DCMAKE_STATIC_LINKER_FLAGS= -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++.exe C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\source) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:378]:
    [@programdir\core\sandbox\modules\os.lua:291]: in function 'vrunv'
    [@programdir\modules\package\tools\cmake.lua:1193]: in function 'configure'
    [@programdir\modules\package\tools\cmake.lua:1235]: in function 'install'
    [...make\repositories\xmake-repo\packages\a\abseil\xmake.lua:49]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...\modules\private\action\require\impl\actions\install.lua:392]:

  => install abseil 20240722.0 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1004: in function 'base/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>

admin@DESKTOP-N65NNPO  /c/Users/admin/Downloads/cosmocc_test
$ bash --version
GNU bash, version 5.2.26(1)-release (x86_64-pc-msys)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
waruqi commented 2 months ago

try this patch. https://github.com/xmake-io/xmake/pull/5579

Chi-EEE commented 2 months ago

I got this new error:

admin@DESKTOP-N65NNPO  /c/Users/admin/Downloads/cosmocc_test
$ xmake f -p cross -cvD
checking for architecture ... none
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Users\admin\xmake\winenv\bin\7z
checking for git ... ok
checking for gzip ... ok
checking for tar ... ok
checking for ping ... ok
pinging the host(gitlab.com) ... 26 ms
pinging the host(github.com) ... 25 ms
pinging the host(gitee.com) ... 256 ms
git rev-parse HEAD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe   
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.41.34120
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checking for msys2-base ... no
checking for msys2 ... no
checking for cosmocc ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... C:\Program Files\CMake\bin\cmake
finding abseil from xmake ..
checking for xmake::abseil ... no
finding abseil from vcpkg ..
finding abseil from conan ..
checking for abseil ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> abseil 20240722.0 [toolchains:"@cosmocc"]
please input: y (y/n/m)

tar -xf C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\20240722.0.tar.gz
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the c compiler (cc) ... cosmocc
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the c++ compiler (cxx) ... cosmoc++
checking for cosmocc ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmocc
checking for the assember (as) ... cosmocc
checking for cosmoar ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoar
checking for the static library archiver (ar) ... cosmoar
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the linker (ld) ... cosmoc++
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checkinfo: cannot runv(C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checkinfo: cannot runv(aarch64-linux-cosmo-ranlib.exe --version), No such file or directory
checking for aarch64-linux-cosmo-ranlib ... no
checking for the archive index generator (ranlib: aarch64-linux-cosmo-ranlib) ... no
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc ... ok
checking for flags (-fPIC) ... ok
> cosmocc "-fPIC"
checking for C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ ... ok
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
checking for flags (-fPIC) ... no
> cosmocc "-fPIC"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: cosmocc: fatal error: C:/Users/admin/AppData/Local/Temp/.xmake/240906/_FC21FE6CFF764CC794F7A6A82EEB0C29.s: assembler input files not supported
compilation terminated.

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for flags (-fPIC) ... ok
> cosmoc++ "-fPIC"
checking for cosmoc++ ... C:\Users\admin\AppData\Local\.xmake\packages\c\cosmocc\3.8.0\4344cbd8aaa646b9862980b024cbf2e5\bin\cosmoc++
checking for the shared library linker (sh) ... cosmoc++
checking for flags (-fPIC) ... no
> cosmoc++ "-fPIC" "-shared"
checkinfo: @programdir\core\sandbox\modules\os.lua:273: cosmoc++: fatal error: -shared flag not supported
compilation terminated.

stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:273]: in function 'runv'
    [@programdir\modules\detect\tools\cosmocc\has_flags.lua:43]:
checking for cmake ... C:\Program Files\CMake\bin\cmake
C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_OSX_SYSROOT= -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -DCMAKE_STATIC_LINKER_FLAGS= C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\source
-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++
-- Check for working CXX compiler: C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: 'C:/Users/admin/AppData/Local/Temp/.xmake/240906/_D9991535EE184C308B472D7D20D682B0.dir/CMakeFiles/CMakeScratch/TryCompile-llzguc'

    Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/make -f Makefile cmTC_2ffd3/fast
    /C/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/make  -f CMakeFiles/cmTC_2ffd3.dir/build.make CMakeFiles/cmTC_2ffd3.dir/build
    make[1]: Entering directory '/C/Users/admin/AppData/Local/Temp/.xmake/240906/_D9991535EE184C308B472D7D20D682B0.dir/CMakeFiles/CMakeScratch/TryCompile-llzguc'
    make[1]: /bin/sh: No such file or directory (win32 error 3)
    make[1]: *** [CMakeFiles/cmTC_2ffd3.dir/build.make:77: CMakeFiles/cmTC_2ffd3.dir/testCXXCompiler.cxx.o] Error 127
    make[1]: Leaving directory '/C/Users/admin/AppData/Local/Temp/.xmake/240906/_D9991535EE184C308B472D7D20D682B0.dir/CMakeFiles/CMakeScratch/TryCompile-llzguc'
    make: *** [Makefile:127: cmTC_2ffd3/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:26 (project)

-- Configuring incomplete, errors occurred!
error: @programdir\core\sandbox\modules\os.lua:378: execv(C:\Program Files\CMake\bin\cmake -DCMAKE_CXX_STANDARD=17 -DABSL_ENABLE_INSTALL=ON -DABSL_PROPAGATE_CXX_STD=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\admin\AppData\Local\.xmake\packages\a\abseil\20240722.0\195caa6087854884a4361697842d5ea5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_AR=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoar -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_ASM_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH -DCMAKE_OSX_SYSROOT= -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_CXX_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmoc++ -DCMAKE_C_COMPILER=C:/Users/admin/AppData/Local/.xmake/packages/c/cosmocc/3.8.0/4344cbd8aaa646b9862980b024cbf2e5/bin/cosmocc -DCMAKE_STATIC_LINKER_FLAGS= C:\Users\admin\AppData\Local\.xmake\cache\packages\2409\a\abseil\20240722.0\source) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [@programdir\core\sandbox\modules\os.lua:378]:
    [@programdir\core\sandbox\modules\os.lua:291]: in function 'vrunv'
    [@programdir\modules\package\tools\cmake.lua:1194]: in function 'configure'
    [@programdir\modules\package\tools\cmake.lua:1236]: in function 'install'
    [...make\repositories\xmake-repo\packages\a\abseil\xmake.lua:49]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...\modules\private\action\require\impl\actions\install.lua:392]:

  => install abseil 20240722.0 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:1004]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:1004: in function 'base/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>
waruqi commented 2 months ago

make[1]: /bin/sh: No such file or directory (win32 error 3)

maybe cmake does not support cosmocc, it's a cmake issue

or you can try call it on msys2.