xmake-io / xmake

šŸ”„ A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.23k stars 793 forks source link

Invalid generator 'xmake' error on conan package #3378

Closed shaqtsui closed 1 year ago

shaqtsui commented 1 year ago

Xmake Version

2.7.6

Operating System Version and Architecture

Ubuntu 20.04

Describe Bug

After add dependency: conan::mailio/0.21.0, build raise error: ERROR: Invalid generator 'xmake'. Available types: txt, gcc, compiler_args, cmake...

Expected Behavior

Build conan pkg without error.

Project Configuration

      add_requires ("conan::mailio/0.21.0", { alias = "mailio", configs = { build = "missing", build_requires = {} } })

      target "mailioexample"
      set_version "0.1.0"
      ------------------------ compiler arguments ------------------------
      set_languages "c++20"

      ------------------------ input unit ------------------------
      add_files "src/*.cpp"

      ------------------------ include header / link library ------------------------
      add_packages ("mailio")

Additional Information and Error Logs

xmake -vD log:

xmake: /lib64/libncurses.so.6: no version information available (required by xmake)
xmake: /lib64/libncurses.so.6: no version information available (required by xmake)
xmake: /lib64/libtinfo.so.6: no version information available (required by xmake)
checking for gcc ... /usr/bin/gcc
checkinfo: cannot runv(dmd --version), No such file or directory
checking for dmd ... no
checkinfo: cannot runv(ldc2 --version), No such file or directory
checking for ldc2 ... no
checkinfo: cannot runv(gdc --version), No such file or directory
checking for gdc ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /bin/gzip
checking for tar ... /bin/tar
finding mailio/0.21.0 from conan ..
checking for conan::mailio/0.21.0 ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in conan:
  -> conan::mailio/0.21.0 latest [build_requires:{}, build:"missing"]
please input: y (y/n/m)
y
installing mailio/0.21.0 from conan ..
checking for conan ... /mnt/d/shaq/.local/bin/conan
generate /mnt/d/shaq/Projects/zettelkasten/build/.conan/mailio/0.21.0/conanfile.txt ..
/mnt/d/shaq/.local/bin/conan install . --build=missing -s os=Linux -s arch=x86_64 -s build_type=Release
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

conanfile.txt: Installing package
Requirements
    boost/1.81.0 from 'conancenter' - Cache
    bzip2/1.0.8 from 'conancenter' - Cache
    libbacktrace/cci.20210118 from 'conancenter' - Cache
    mailio/0.21.0 from 'conancenter' - Cache
    openssl/1.1.1s from 'conancenter' - Cache
    zlib/1.2.13 from 'conancenter' - Cache
Packages
    boost/1.81.0:9bb382e9c85821936d59f1c4ea5134768df38de2 - Cache
    bzip2/1.0.8:c32092bf4d4bb47cf962af898e02823f499b017e - Cache
    libbacktrace/cci.20210118:dfbe50feef7f3c6223a476cd5aeadb687084a646 - Cache
    mailio/0.21.0:9f1702d891b4c7e5b965bfd05c89852cbea66e6b - Cache
    openssl/1.1.1s:dfbe50feef7f3c6223a476cd5aeadb687084a646 - Cache
    zlib/1.2.13:dfbe50feef7f3c6223a476cd5aeadb687084a646 - Cache

Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
libbacktrace/cci.20210118: Already installed!
openssl/1.1.1s: Already installed!
zlib/1.2.13: Already installed!
boost/1.81.0: Already installed!
mailio/0.21.0: Already installed!
ERROR: Invalid generator 'xmake'. Available types: txt, gcc, compiler_args, cmake, cmake_multi, cmake_paths, cmake_find_package, cmake_find_package_multi, qmake, qbs, scons, visual_studio, visual_studio_multi, visual_studio_legacy, xcode, ycm, virtualenv, virtualenv_python, virtualbuildenv, virtualrunenv, boost-build, pkg_config, json, b2, premake, make, deploy, markdown, CMakeToolchain, CMakeDeps, MSBuildToolchain, MesonToolchain, MSBuildDeps, QbsToolchain, msbuild, VirtualRunEnv, VirtualBuildEnv, AutotoolsDeps, AutotoolsToolchain, BazelDeps, BazelToolchain, PkgConfigDeps, VCVars, IntelCC, XcodeDeps, PremakeDeps, XcodeToolchain, MesonDeps, NMakeToolchain, NMakeDeps
error: @programdir/core/sandbox/modules/os.lua:373: execv(/mnt/d/shaq/.local/bin/conan install . --build=missing -s os=Linux -s arch=x86_64 -s build_type=Release) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:898]:
    [@programdir/core/sandbox/modules/os.lua:373]:
    [@programdir/core/sandbox/modules/os.lua:286]: in function 'vrunv'
    [...ramdir/modules/package/manager/conan/install_package.lua:292]:
    [@programdir/modules/package/manager/install_package.lua:110]:
    [@programdir/core/package/package.lua:2350]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:125]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:277]:

  => install conan::mailio/0.21.0 latest .. failed
error: @programdir/modules/private/async/runjobs.lua:256: .../modules/private/action/require/impl/actions/install.lua:410: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:898]:
    [.../modules/private/action/require/impl/actions/install.lua:410]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:268]:
    [...modules/private/action/require/impl/install_packages.lua:479]: in function 'jobfunc'
    [@programdir/modules/private/async/runjobs.lua:232]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:898: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir/modules/private/async/runjobs.lua:256: in field 'catch'
        @programdir/core/sandbox/modules/try.lua:123: in global 'try'
        @programdir/modules/private/async/runjobs.lua:218: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:404: in function <@programdir/core/base/scheduler.lua:397>
waruqi commented 1 year ago

please remove build_requires = {}

shaqtsui commented 1 year ago

Thanks

raytangRT commented 1 year ago

Sorry for commenting on a closed issue, but I am seeing this error when removing build_requires = {}

ERROR: Unable to find 'xmake_generator/0.1.0@bincrafters/testing' in remotes

According to this https://github.com/xmake-io/xmake/issues/2960 issue, the author recommends adding this to config.

So, what is the official solution for solving this issue? (I know bincrafters shutdown their service for 2 yrs now, so how can we pull this?)

waruqi commented 1 year ago

According to this https://github.com/xmake-io/xmake/issues/2960 issue, the author recommends adding this to config.

he is not xmake's author. and his answer is incorrect.

see

please remove build_requires = {}

raytangRT commented 1 year ago

According to this #2960 issue, the author recommends adding this to config.

he is not xmake's author. and his answer is incorrect.

see

please remove build_requires = {}

This package xmake_generator/0.1.0@bincrafters/testing does not exist in conan-center, so how to download this without installing it manually? https://conan.io/center/search/xmake

waruqi commented 1 year ago

According to this #2960 issue, the author recommends adding this to config.

he is not xmake's author. and his answer is incorrect. see

please remove build_requires = {}

This package xmake_generator/0.1.0@bincrafters/testing does not exist in conan-center, so how to download this without installing it manually? https://conan.io/center/search/xmake

You don't have to care about it or set it. xmake handles it automatically internally, you just need to remove build_requires = {} to avoid overriding the internal xmake settings.

https://github.com/xmake-io/xmake/blob/8d75606dbf979386ed314bcbc01ef38dcfa10a5e/xmake/modules/package/manager/conan/install_package.lua#L92