Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcpkg dependencies miss resolved #4858

Open
shaqtsui opened this issue Mar 21, 2024 · 9 comments
Open

vcpkg dependencies miss resolved #4858

shaqtsui opened this issue Mar 21, 2024 · 9 comments
Labels

Comments

@shaqtsui
Copy link
Contributor

Xmake Version

2.8.8

Operating System Version and Architecture

windows 10

Describe Bug

Dependencies resolution failed for packages(with no pkgconfig) form vcpkg.

e.g. vcpkg::boost

vcpkg depend-info boost

Above command can list all depencies: boost-test, boost-json, ...
But xmake failed to get these inforations.

FYI:
Additional package meta info file in:
vcpkg/ports/xxx/vcpkg.json

Expected Behavior

Dependencies resolution success for packages(with no pkgconfig) form vcpkg.

Project Configuration

add_requires("vcpkg::boost", { alias = "boost" })

target "test"
add_packages "boost"
add_files "src/*.cxx"

Additional Information and Error Logs

PS D:\Projects\vcpkgex> xmake -vyD
checking for platform ... windows
checking for architecture ... x64
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.38.33130
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(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... D:\Programs\Scoop\apps\xmake\current\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(gitee.com) ... 32 ms
pinging the host(github.com) ... 194 ms
pinging the host(gitlab.com) ... 65535 ms
finding boost from vcpkg ..
checking for vcpkg::boost ... no
installing boost from vcpkg ..
checking for vcpkg.exe ... D:\Projects\vcpkg\vcpkg.exe
D:\Projects\vcpkg\vcpkg.exe install boost:x64-windows-static --debug
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from D:\Projects\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: D:\Projects\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Using scripts-root: D:\Projects\vcpkg\scripts
[DEBUG] Using builtin-ports: D:\Projects\vcpkg\ports
[DEBUG] Using installed-root: D:\Projects\vcpkg\installed
[DEBUG] Using buildtrees-root: D:\Projects\vcpkg\buildtrees
[DEBUG] Using packages-root: D:\Projects\vcpkg\packages
[DEBUG] Using vcpkg-root: D:\Projects\vcpkg
[DEBUG] Using scripts-root: D:\Projects\vcpkg\scripts
[DEBUG] Using builtin-registry: D:\Projects\vcpkg\versions
[DEBUG] Using downloads-root: D:\Projects\vcpkg\downloads
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] Detecting host with IsWow64Process2
Computing installation plan...
[DEBUG] Loading dep info for: boost:x64-windows-static
[DEBUG] Found path: D:\Programs\Scoop\shims\cmake.exe
[DEBUG] 1000: CreateProcessW("D:\Programs\Scoop\shims\cmake.exe" --version)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after    26128 us
[DEBUG] 1001: CreateProcessW("D:\Programs\Scoop\shims\cmake.exe" -DVCPKG_ROOT_DIR=D:/Projects/vcpkg -DPACKAGES_DIR=D:/Projects/vcpkg/packages -DBUILDTREES_DIR=D:/Projects/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/Projects/vcpkg/installed -DDOWNLOADS=D:/Projects/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\Projects\vcpkg\buildtrees\0.vcpkg_dep_info.cmake")
[DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after    18056 us
The following packages are already installed:
    boost:x64-windows-static@1.84.0
[DEBUG] Default binary cache path is: C:\Users\shaq\AppData\Local\vcpkg\archives
boost:x64-windows-static is already installed
Total install time: 65.2 us
[DEBUG] D:\a\_work\1\s\src\vcpkg\commands.install.cpp(1426):
[DEBUG] Time in subprocesses: 44184us
[DEBUG] Time in parsing JSON: 6217us
[DEBUG] Time in JSON reader: 4429us
[DEBUG] Time in filesystem: 12894us
[DEBUG] Time in loading ports: 36597us
[DEBUG] Exiting after 99.4 ms (90468us)
finding boost from vcpkg ..
checking for vcpkg::boost ... no

error: ...\modules\private\action\require\impl\actions\install.lua:398: fetch vcpkg::boost-latest failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:957]: in function 'raiselevel'
    [@programdir\core\sandbox\modules\utils.lua:149]: in function 'assert'
    [...\modules\private\action\require\impl\actions\install.lua:398]:

  => install vcpkg::boost latest .. failed
error: @programdir\core\main.lua:306: @programdir\core\sandbox\modules\import\core\base\task.lua:65: @programdir\modules\async\runjobs.lua:320: ...\modules\private\action\require\impl\actions\install.lua:474: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:957]:
    [...\modules\private\action\require\impl\actions\install.lua:474]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:333]:
    [...modules\private\action\require\impl\install_packages.lua:479]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:237]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:957: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir\core\main.lua:306: in upvalue 'cotask'
        @programdir\core\base\scheduler.lua:404: in function <@programdir\core\base\scheduler.lua:397>
@shaqtsui shaqtsui added the bug label Mar 21, 2024
@Codinablack
Copy link

I can confirm this bug. I am also unable to get xmake to find anything that is already installed from vcpkg.

F:\Tutorial\secret work\xmakeforgotten>xmake -vyD
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.39.33521
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\codin\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
finding Boost from vcpkg ..
checking for vcpkg::Boost ... no
finding cryptopp from vcpkg ..
checking for vcpkg::cryptopp ... no
finding fmt from vcpkg ..
checking for vcpkg::fmt ... no
finding Threads from vcpkg ..
checking for vcpkg::Threads ... no
finding Lua from vcpkg ..
checking for vcpkg::Lua ... no
finding unofficial-libmariadb from vcpkg ..
checking for vcpkg::unofficial-libmariadb ... no
finding pugixml from vcpkg ..
checking for vcpkg::pugixml ... no
note: the following packages were not found on your system, try again after installing them:
  -> vcpkg::Boost latest
  -> vcpkg::cryptopp latest
  -> vcpkg::fmt latest
  -> vcpkg::Threads latest
  -> vcpkg::Lua latest
  -> vcpkg::unofficial-libmariadb latest
  -> vcpkg::pugixml latest
error: @programdir\core\main.lua:329: @programdir\core\sandbox\modules\import\core\base\task.lua:65: stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:968]:
    [...modules\private\action\require\impl\install_packages.lua:754]:
    [@programdir\modules\private\action\require\install.lua:85]:
    [@programdir\actions\config\main.lua:387]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\base\task.lua:491]: in function 'run'
    [@programdir\core\sandbox\modules\import\core\base\task.lua:63]: in function 'run'
    [@programdir\actions\build\main.lua:191]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\base\task.lua:491]: in function 'run'
    [@programdir\core\main.lua:327]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

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

F:\Tutorial\secret work\xmakeforgotten>

@Codinablack
Copy link

image

@Issues-translate-bot
Copy link

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


image

@Codinablack
Copy link

Yo pretty much anyone who wants to use this program who also uses vcpkg right now can't. So most are probably skipping over this build system and moving on to another, it should be a very big priority to fix this as soon as possible.

@waruqi
Copy link
Member

waruqi commented Mar 24, 2024

There are two issues here:

  1. please use vcpkg::boost[core] instead of vcpkg::boost, in vcpkg the boost is split into various subpackages and we can't find any library linking information directly from vcpkg::boost

and we can use other some boost subpackages. vcpkg::boost[mpi], vcpkg::boost-array

$ xrepo search vcpkg::boost
The package names:
    vcpkg::boost: 
      -> vcpkg::boost[mpi]: Build with MPI support 
      -> vcpkg::boost-accumulators-1.73.0: Boost accumulators module 
      -> vcpkg::boost-algorithm-1.73.0: Boost algorithm module 
      -> vcpkg::boost-align-1.73.0: Boost align module 
      -> vcpkg::boost-any-1.73.0: Boost any module 
      -> vcpkg::boost-array-1.73.0: Boost array module 
      -> vcpkg::boost-asio-1.73.0#2: Boost asio module 
      -> vcpkg::boost-assert-1.73.0: Boost assert module 
      -> vcpkg::boost-assign-1.73.0: Boost assign module 
      -> vcpkg::boost-atomic-1.73.0: Boost atomic module 
      -> vcpkg::boost-beast-1.73.0#2: Boost beast module 
      -> vcpkg::boost-bimap-1.73.0: Boost bimap module 
      -> vcpkg::boost-bind-1.73.0: Boost bind module 
      ...

duplicated issues:

  1. xmake does not support cascading package dependencies from third-party package managers, except for packages inside xmake-repo.

It's not a bug, I just haven't had enough time to support it yet.

If you want to use cascading dependency support for packages, use packages from xmake-repo if possible, or be patient, maybe in the future I'll support this feature for repositories like vcpkg/conan. But I can't guarantee the timing.

@Codinablack
Copy link

There are two issues here:

1. please use `vcpkg::boost[core]` instead of `vcpkg::boost`, in vcpkg the boost is split into various subpackages and we can't find any library linking information directly from `vcpkg::boost`

and we can use other some boost subpackages. vcpkg::boost[mpi], vcpkg::boost-array

$ xrepo search vcpkg::boost
The package names:
    vcpkg::boost: 
      -> vcpkg::boost[mpi]: Build with MPI support 
      -> vcpkg::boost-accumulators-1.73.0: Boost accumulators module 
      -> vcpkg::boost-algorithm-1.73.0: Boost algorithm module 
      -> vcpkg::boost-align-1.73.0: Boost align module 
      -> vcpkg::boost-any-1.73.0: Boost any module 
      -> vcpkg::boost-array-1.73.0: Boost array module 
      -> vcpkg::boost-asio-1.73.0#2: Boost asio module 
      -> vcpkg::boost-assert-1.73.0: Boost assert module 
      -> vcpkg::boost-assign-1.73.0: Boost assign module 
      -> vcpkg::boost-atomic-1.73.0: Boost atomic module 
      -> vcpkg::boost-beast-1.73.0#2: Boost beast module 
      -> vcpkg::boost-bimap-1.73.0: Boost bimap module 
      -> vcpkg::boost-bind-1.73.0: Boost bind module 
      ...

duplicated issues:

* [xmake依赖vcpkg::boost时编译失败 #1998](https://github.com/xmake-io/xmake/issues/1998)

* [Question: What's the appropriate behaviour to use xmake with vcpkg? #1585 (comment)](https://github.com/xmake-io/xmake/issues/1585#issuecomment-901774386)

* [xmake cannot  find the boost installed using vcpkg #1605](https://github.com/xmake-io/xmake/issues/1605)


2. xmake does not support cascading package dependencies from third-party package managers, except for packages inside xmake-repo.

It's not a bug, I just haven't had enough time to support it yet.

If you want to use cascading dependency support for packages, use packages from xmake-repo if possible, or be patient, maybe in the future I'll support this feature for repositories like vcpkg/conan. But I can't guarantee the timing.

When you say "Cascading" I assume you mean, if I wanted spdlog for example, it depends on FMT so that would be cascading right? Trying to import spdlog which relies on another, which might rely on another... this is what I assume you mean.. if that is true, then there is still very much an isssue, as the other packages listed there weren't cascading, they were all necessary packages.

It didn't find FMT, which is required, it didn't find Cryptopp, which is required, it didn't find lua, ect, ect, ect. So yeah, still very much a problem here, as none of those are from "Cascading"...

@waruqi
Copy link
Member

waruqi commented Mar 26, 2024

There are two issues here:

1. please use `vcpkg::boost[core]` instead of `vcpkg::boost`, in vcpkg the boost is split into various subpackages and we can't find any library linking information directly from `vcpkg::boost`

and we can use other some boost subpackages. , vcpkg::boost[mpi]``vcpkg::boost-array

$ xrepo search vcpkg::boost
The package names:
    vcpkg::boost: 
      -> vcpkg::boost[mpi]: Build with MPI support 
      -> vcpkg::boost-accumulators-1.73.0: Boost accumulators module 
      -> vcpkg::boost-algorithm-1.73.0: Boost algorithm module 
      -> vcpkg::boost-align-1.73.0: Boost align module 
      -> vcpkg::boost-any-1.73.0: Boost any module 
      -> vcpkg::boost-array-1.73.0: Boost array module 
      -> vcpkg::boost-asio-1.73.0#2: Boost asio module 
      -> vcpkg::boost-assert-1.73.0: Boost assert module 
      -> vcpkg::boost-assign-1.73.0: Boost assign module 
      -> vcpkg::boost-atomic-1.73.0: Boost atomic module 
      -> vcpkg::boost-beast-1.73.0#2: Boost beast module 
      -> vcpkg::boost-bimap-1.73.0: Boost bimap module 
      -> vcpkg::boost-bind-1.73.0: Boost bind module 
      ...

duplicated issues:

* [xmake依赖vcpkg::boost时编译失败 #1998](https://github.com/xmake-io/xmake/issues/1998)

* [Question: What's the appropriate behaviour to use xmake with vcpkg? #1585 (comment)](https://github.com/xmake-io/xmake/issues/1585#issuecomment-901774386)

* [xmake cannot  find the boost installed using vcpkg #1605](https://github.com/xmake-io/xmake/issues/1605)


2. xmake does not support cascading package dependencies from third-party package managers, except for packages inside xmake-repo.

It's not a bug, I just haven't had enough time to support it yet.
If you want to use cascading dependency support for packages, use packages from xmake-repo if possible, or be patient, maybe in the future I'll support this feature for repositories like vcpkg/conan. But I can't guarantee the timing.

When you say "Cascading" I assume you mean, if I wanted spdlog for example, it depends on FMT so that would be cascading right? Trying to import spdlog which relies on another, which might rely on another... this is what I assume you mean.. if that is true, then there is still very much an isssue, as the other packages listed there weren't cascading, they were all necessary packages.

It didn't find FMT, which is required, it didn't find Cryptopp, which is required, it didn't find lua, ect, ect, ect. So yeah, still very much a problem here, as none of those are from "Cascading"...

right, only xmake-repo packages support it now. if you use vcpkg packages, you need use add_requires and add_packages to add all packages and their deps manually.

@Codinablack
Copy link

Well I didn't start off using the prefix vcpkg::, I only found it, and used it, after trying without failed. When I noticed the prefix, I thought it would surely fix my problem as I already have vcpkg on my system. I tried using my own, fail. Then I found xrepo and tried xrepo via command line, both with the prefix and without. All fail. I have already moved on to using a different build system and now have it up and running. I am also using different package manager now too. I just figured this thread would do good with having another person verifying the bug.

It's your choice to look into it or not.

@waruqi
Copy link
Member

waruqi commented Mar 26, 2024

Well I didn't start off using the prefix vcpkg::, I only found it, and used it, after trying without failed. When I noticed the prefix, I thought it would surely fix my problem as I already have vcpkg on my system. I tried using my own, fail. Then I found xrepo and tried xrepo via command line, both with the prefix and without. All fail. I have already moved on to using a different build system and now have it up and running. I am also using different package manager now too. I just figured this thread would do good with having another person verifying the bug.

It's your choice to look into it or not.

if you use xrepo and fails, you can open an issue and provide logs, otherwise we don't know what error you're experiencing and can't fix it. Even if you don't use xmake anymore, you can still provide an issue, which might help others as well.

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

No branches or pull requests

4 participants