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

Couldn't find explicitly specified baseline for homebrew/vcpkg #22131

Closed
waruqi opened this issue Dec 21, 2021 · 4 comments
Closed

Couldn't find explicitly specified baseline for homebrew/vcpkg #22131

waruqi opened this issue Dec 21, 2021 · 4 comments

Comments

@waruqi
Copy link

waruqi commented Dec 21, 2021

Describe the bug
I am making xmake to support vcpkg manifest mode. but it will report errors about baseline when it call vcpkg install from homebrew/vcpkg. xmake-io/xmake#1928

fatal: not a git repository: '/usr/local/Cellar/vcpkg/2021.05.12/libexec/.git'

The vcpkg installed by brew does not have a git repository history, and it seems that the baseline cannot be found, but a baseline must be set in vcpkg.json, otherwise other errors will be reported

Environment

  • OS: macOS
  • Compiler: revision

To Reproduce

Use homebrew to install vcpkg

$ brew install vcpkg

Install xmake first

bash <(curl -fsSL https://xmake.io/shget.text) dev
source ~/.xmake/profile

Write a xmake.lua file in am empty directory

add_requires("vcpkg::fmt >=8.0.1", {configs = {baseline = "50fd3d9957195575849a49fa591e645f1d8e7156"}})
add_requires("vcpkg::libpng", {configs = {features = {"apng"}}})

target("test")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("vcpkg::fmt", "vcpkg::libpng")
$ xmake -vD

Expected behavior
A clear and concise description of what you expected to happen.

Failure logs

note: install or modify (m) these packages (pass -y to skip confirm)?
in vcpkg:
  -> vcpkg::fmt >=8.0.1 [baseline:"50fd3d9957195575849a49fa591e645f1d8e7156"]
  -> vcpkg::libpng latest [features:{"apng"}]
please input: y (y/n/m)

installing fmt from vcpkg ..
checking for vcpkg ... /usr/local/bin/vcpkg
/Users/ruki/projects/personal/xmake/tests/projects/package/vcpkg_manifest/build/.packages/v/vcpkg_fmt/8.0.1/51b76d60c6114f0c83d69143d782574c/vcpkg.json
{ 
  name = "stub",
  version = "1.0",
  "builtin-baseline" = "50fd3d9957195575849a49fa591e645f1d8e7156",
  dependencies = { 
    { 
      name = "fmt",
      platform = "osx & x64",
      "version>=" = "8.0.1",
      "default-features" = true 
    } 
  } 
}

/usr/local/bin/vcpkg --feature-flags=\"versions\" install --triplet x64-osx --debug
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] BuiltinRegistry initialized with: ""
[DEBUG] Using vcpkg-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec
[DEBUG] Using manifest-root: /Users/ruki/projects/personal/xmake/tests/projects/package/vcpkg_manifest/build/.packages/v/vcpkg_fmt/8.0.1/51b76d60c6114f0c83d69143d782574c
[DEBUG] Using vcpkg_installed-root: /Users/ruki/projects/personal/xmake/tests/projects/package/vcpkg_manifest/build/.packages/v/vcpkg_fmt/8.0.1/51b76d60c6114f0c83d69143d782574c/vcpkg_installed
[DEBUG] BuiltinRegistry initialized with: ""
[DEBUG] Using buildtrees-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec/buildtrees
[DEBUG] Using downloads-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec/downloads
[DEBUG] Using packages-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec/packages
[DEBUG] Using scripts-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec/scripts
[DEBUG] Using ports-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec/ports
[DEBUG] Using versions-root: /usr/local/Cellar/vcpkg/2021.05.12/libexec/versions
[DEBUG] Default binary cache path is: /Users/ruki/.cache/vcpkg/archives
[DEBUG] Using overlay: /Users/ruki/projects/personal/xmake/tests/projects/package/vcpkg_manifest/build/.packages/v/vcpkg_fmt/8.0.1/51b76d60c6114f0c83d69143d782574c
[DEBUG] Found path: /usr/local/bin/cmake
[DEBUG] popen(/usr/local/bin/cmake --version 2>&1)
[DEBUG] cmd_execute_and_stream_data() returned 0 after    55166 us
[DEBUG] popen(/usr/local/bin/cmake -DVCPKG_ROOT_DIR=/usr/local/Cellar/vcpkg/2021.05.12/libexec -DPACKAGES_DIR=/usr/local/Cellar/vcpkg/2021.05.12/libexec/packages -DBUILDTREES_DIR=/usr/local/Cellar/vcpkg/2021.05.12/libexec/buildtrees -D_VCPKG_INSTALLED_DIR=/Users/ruki/projects/personal/xmake/tests/projects/package/vcpkg_manifest/build/.packages/v/vcpkg_fmt/8.0.1/51b76d60c6114f0c83d69143d782574c/vcpkg_installed -DDOWNLOADS=/usr/local/Cellar/vcpkg/2021.05.12/libexec/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P /usr/local/Cellar/vcpkg/2021.05.12/libexec/buildtrees/0.vcpkg_dep_info.cmake 2>&1)
[DEBUG] cmd_execute_and_stream_data() returned 0 after    13110 us
[DEBUG] Failed to open: /usr/local/Cellar/vcpkg/2021.05.12/libexec/versions/baseline.json
[DEBUG] Failed to find baseline.json
[DEBUG] Found path: /usr/bin/git
[DEBUG] popen(/usr/bin/git --version 2>&1)
[DEBUG] cmd_execute_and_stream_data() returned 0 after    10083 us
[DEBUG] popen(/usr/bin/git --git-dir=/usr/local/Cellar/vcpkg/2021.05.12/libexec/.git --work-tree=/usr/local/Cellar/vcpkg/2021.05.12/libexec/.git -c core.autocrlf=false show 50fd3d9957195575849a49fa591e645f1d8e7156:versions/baseline.json 2>&1)
[DEBUG] cmd_execute_and_stream_data() returned 32768 after     9202 us
[DEBUG] popen(/usr/bin/git --git-dir=/usr/local/Cellar/vcpkg/2021.05.12/libexec/.git --work-tree=/usr/local/Cellar/vcpkg/2021.05.12/libexec -c core.autocrlf=false rev-parse HEAD 2>&1)
[DEBUG] cmd_execute_and_stream_data() returned 32768 after    11800 us
Error: Couldn't find explicitly specified baseline `"50fd3d9957195575849a49fa591e645f1d8e7156"` in the baseline file, and there was no baseline at that commit or the commit didn't exist.
Error: while checking out baseline '50fd3d9957195575849a49fa591e645f1d8e7156:versions/baseline.json':
fatal: not a git repository: '/usr/local/Cellar/vcpkg/2021.05.12/libexec/.git'

This may be fixed by updating vcpkg to the latest master via `git pull`.
Failed to determine the current commit:
fatal: not a git repository: '/usr/local/Cellar/vcpkg/2021.05.12/libexec/.git'

[DEBUG] /tmp/vcpkg-20210604-3962-1hutlnu/vcpkg-2021.05.12/buildtrees/_vcpkg/src/vcpkg-tool-2021-05-05-9f849c4c43e50d1b16186ae76681c27b0c1be9d9/src/vcpkg/registries.cpp(412)
[DEBUG] Exiting after 117918 us (114003 us)
error: @programdir/core/sandbox/modules/os.lua:393: execv(/usr/local/bin/vcpkg --feature-flags=\"versions\" install --triplet x64-osx --debug) failed(1)

Additional context

vcpkg --version
Vcpkg package management program version 2021-05-05-unknownhash

See LICENSE.txt for license information

@autoantwort
Copy link
Contributor

Yeah you can't use the brew version of vcpkg. For manifest mode vcpkg must be cloned with git. brew is also not officially supported

@dg0yt
Copy link
Contributor

dg0yt commented Dec 21, 2021

Vcpkg package management program version 2021-05-05-unknownhash

This version is old.

@waruqi
Copy link
Author

waruqi commented Dec 21, 2021

Well, If it is not an officially supported version, I think it should be removed from homebrew or updated to the latest officially supported version. Otherwise, this will cause a lot of trouble. After all, brew has a large number of users. Users are habitual to install vcpkg from brew first. If they are on macOS

@waruqi waruqi closed this as completed Dec 21, 2021
@dg0yt
Copy link
Contributor

dg0yt commented Dec 21, 2021

You cannot use features that are not in the packaged version. This is the same for other brew packages.

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

No branches or pull requests

3 participants