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-tool] Error message of the new pkgconfig check is not great #21116

Closed
horenmar opened this issue Nov 1, 2021 · 6 comments
Closed

[vcpkg-tool] Error message of the new pkgconfig check is not great #21116

horenmar opened this issue Nov 1, 2021 · 6 comments
Assignees
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:manifests This PR or Issue pertains to the Manifests feature requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof

Comments

@horenmar
Copy link
Contributor

horenmar commented Nov 1, 2021

Describe the bug
I tried installing gtest with up-to-date vcpkg-tool, and got this error message:

There should be no pkgconfig directories outside of lib and debug/lib.
The following misplaced pkgconfig files were found:

    /opt/vcpkg/packages/gtest_x64-linux/lib/manual-link/pkgconfig/gmock_main.pc
    /opt/vcpkg/packages/gtest_x64-linux/lib/manual-link/pkgconfig/gtest_main.pc
    /opt/vcpkg/packages/gtest_x64-linux/debug/lib/manual-link/pkgconfig/gmock_main.pc
    /opt/vcpkg/packages/gtest_x64-linux/debug/lib/manual-link/pkgconfig/gtest_main.pc

You can move the pkgconfig files with the following commands:
...

Apart from being annoyed that the current port cannot be installed with the current vcpkg-tool, I think the error message is not great. It is easy to read as "pkgconfig folders need to be under lib and debug/lib folders", while the check (going by the commit that added this check, microsoft/vcpkg-tool@72deea4) checks that pkgconfig folder is only be present as lib/pkgconfig or debug/lib/pkgconfig.

I think the message should be more along the lines of "pkgconfig folders can only be present as lib/pkgconfig or debug/lib/pkgconfig".

@BillyONeal
Copy link
Member

Apart from being annoyed that the current port cannot be installed with the current vcpkg-tool

Hmm... we did check that and it doesn't repro for me:

@BillyONeal ➜ /workspaces/vcpkg (master) $ ./bootstrap-vcpkg.sh 
Downloading vcpkg-glibc...
Telemetry
---------
vcpkg collects usage data in order to help us improve your experience.
The data collected by Microsoft is anonymous.
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
passing --disable-metrics to vcpkg on the command line,
or by setting the VCPKG_DISABLE_METRICS environment variable.

Read more about vcpkg telemetry at docs/about/privacy.md
@BillyONeal ➜ /workspaces/vcpkg (master) $ ./vcpkg install gtest
Computing installation plan...
A suitable version of cmake was not found (required v3.21.1). Downloading portable cmake v3.21.1...
Downloading cmake...
  https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-Linux-x86_64.tar.gz -> /workspaces/vcpkg/downloads/cmake-3.21.1-linux-x86_64.tar.gz
Extracting cmake...
The following packages will be built and installed:
    gtest[core]:x64-linux -> 1.11.0#1
Detecting compiler hash for triplet x64-linux...
A suitable version of ninja was not found (required v1.10.2). Downloading portable ninja v1.10.2...
Downloading ninja...
  https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip -> /workspaces/vcpkg/downloads/ninja-linux-1.10.2.zip
Extracting ninja...
Restored 0 packages from /home/codespace/.cache/vcpkg/archives in 35.6 us. Use --debug to see more details.
Starting package 1/1: gtest:x64-linux
Building package gtest[core]:x64-linux...
-- Downloading https://github.com/google/googletest/archive/release-1.11.0.tar.gz -> google-googletest-release-1.11.0.tar.gz...
-- Extracting source /workspaces/vcpkg/downloads/google-googletest-release-1.11.0.tar.gz
-- Applying patch fix-main-lib-path.patch
-- Using source at /workspaces/vcpkg/buildtrees/gtest/src/ase-1.11.0-7d339f16d4.clean
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
CMake Warning at scripts/cmake/vcpkg_configure_cmake.cmake:433 (message):
  The following variables are not used in CMakeLists.txt:

      BUILD_GTEST
      CMAKE_DEBUG_POSTFIX

  Please recheck them and remove the unnecessary options from the
  `vcpkg_configure_cmake` call.

  If these options should still be passed for whatever reason, please use the
  `MAYBE_UNUSED_VARIABLES` argument.
Call Stack (most recent call first):
  ports/gtest/portfile.cmake:17 (vcpkg_configure_cmake)
  scripts/ports.cmake:142 (include)


-- Building x64-linux-dbg
-- Building x64-linux-rel
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest_main.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-all.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-death-test.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-filepath.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-internal-inl.h
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-matchers.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-port.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-printers.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-test-part.cc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/src/gtest-typed-test.cc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/lib/pkgconfig/gmock.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/lib/pkgconfig/gmock_main.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/lib/pkgconfig/gtest.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/lib/pkgconfig/gtest_main.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/debug/lib/pkgconfig/gmock.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/debug/lib/pkgconfig/gmock_main.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/debug/lib/pkgconfig/gtest.pc
-- Fixing pkgconfig file: /workspaces/vcpkg/packages/gtest_x64-linux/debug/lib/pkgconfig/gtest_main.pc
-- Installing: /workspaces/vcpkg/packages/gtest_x64-linux/share/gtest/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: /home/codespace/.cache/vcpkg/archives/c1/c1ee86beb942cd6e490a2f69cefbc5a3370ee979dad04305e63db280b7052428.zip
Installing package gtest[core]:x64-linux...
Elapsed time for package gtest:x64-linux: 15.57 s

Total elapsed time: 20.84 s

The package gtest provides CMake targets:

    find_package(GTest CONFIG REQUIRED)
    target_link_libraries(main PRIVATE GTest::gmock GTest::gtest GTest::gmock_main GTest::gtest_main)

@BillyONeal ➜ /workspaces/vcpkg (master) $

Any ideas what's different?

/cc @autoantwort

@horenmar
Copy link
Contributor Author

horenmar commented Nov 1, 2021

Yeah, sorry for that.

I tried reproing it further, and couldn't. I did some further digging and I think that the problem is that I use vcpkg in manifest mode, and have specified older builtin-baseline than the tool is for, so what happens is that the new tool downloads older registry with older ports and then fails the build...

@BillyONeal
Copy link
Member

Yeah, sorry for that.

I tried reproing it further, and couldn't. I did some further digging and I think that the problem is that I use vcpkg in manifest mode, and have specified older builtin-baseline than the tool is for, so what happens is that the new tool downloads older registry with older ports and then fails the build...

Ah, that would do it, since there were bugfixes to this port. Maybe we should turn off new post-build-lint checks in manifest mode...

@horenmar
Copy link
Contributor Author

horenmar commented Nov 1, 2021

Maybe we should turn off new post-build-lint checks in manifest mode...

It would bring in bunch of complexity, but having a correspondence between baseline version and check addition would be the best of both worlds.

@JackBoosY JackBoosY added category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:manifests This PR or Issue pertains to the Manifests feature labels Nov 2, 2021
@BillyONeal
Copy link
Member

microsoft/vcpkg-tool#245 works to address this

@JackBoosY JackBoosY added the requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof label Nov 4, 2021
@PhoebeHui
Copy link
Contributor

This issue should be fixed in latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:manifests This PR or Issue pertains to the Manifests feature requires:tool-release An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof
Projects
None yet
Development

No branches or pull requests

4 participants