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-cmake-config] Wrong *Config.cmake files for CMake 3.29.1 #37968

Closed
SimiPro opened this issue Apr 4, 2024 · 16 comments · Fixed by #38144
Closed

[vcpkg-cmake-config] Wrong *Config.cmake files for CMake 3.29.1 #37968

SimiPro opened this issue Apr 4, 2024 · 16 comments · Fixed by #38144
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@SimiPro
Copy link

SimiPro commented Apr 4, 2024

Describe the bug
Suddenly some of the libraries i use: tinyobjloader, tesseract, effolkronium_random have a wrong path in their corresponding *Config.cmake file.

The vcpkg phase works fine and then when I try to do find_package it crashes usually out of the *Config.cmake file from functions such as set_and_check.

Environment

  • OS: Linux
  • Compiler: revision gcc-11

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install effolkronium-random ( I used manifest mode)
  2. find_package(effolkronium_random CONFIG REQUIRED)
  3. see error

You can also checkout this repo: https://github.com/SimiPro/starter-cmake-vcpkg-simple
and it crashes when you build the target app1.

But if you comment out the "find_package(effolkronium_random CONFIG REQUIRED)" in the apps/app1/CMakeLists.txt
it works.

Expected behavior
No error

Failure logs
[cmake] CMake Error at out/build/dev-debug-test/vcpkg_installed/x64-linux/share/effolkronium_random/effolkronium_randomConfig.cmake:11 (message):
[cmake] File or directory
[cmake] /home/simi/projects/starter_cmake_vcpkg/out/build/dev-debug-test/vcpkg_installed/x64-linux/share/include
[cmake] referenced by variable EFFOLKRONIUM_RANDOM_INCLUDE_DIR does not exist !
[cmake] Call Stack (most recent call first):
[cmake] out/build/dev-debug-test/vcpkg_installed/x64-linux/share/effolkronium_random/effolkronium_randomConfig.cmake:26 (set_and_check)
[cmake] out/build/dev-debug-test/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
[cmake] libs/lib1/CMakeLists.txt:11 (find_package)

Additional context

I can fix them. Usually the path is one to deep or one to less deep. But obviously after each configure i have to re-fix it.

concrete example would be the path effolkronium_randomConfig.cmake
this line:
get_filename_component(PACKAGE_${CMAKE_FIND_PACKAGE_NAME}_COUNTER_1 "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE)

Should be: get_filename_component(PACKAGE_${CMAKE_FIND_PACKAGE_NAME}_COUNTER_1 "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)

You can also see the error in the github action on the project:
https://github.com/SimiPro/starter-cmake-vcpkg-simple/actions/runs/8553715519/job/23437459032

@yhyu13
Copy link

yhyu13 commented Apr 4, 2024

Hi,

My vcpkg fork is a bit old 53bef89 but having a similar problem just poped out today!

I am having similar problem with vckpkg install opentelementry-cpp on linux-64 with find_package(opentelemetry-cpp CONFIG REQUIRED ). Instead of missing one ../, my case was having one extra ../:

Error

CMake Error at Build/Release/vcpkg_installed/x64-linux/share/absl/abslConfig.cmake:16 (message):
  File or directory
  /home/hangyu5/Documents/Gitrepo-My/HLVM-Engine/Engine/Source/Common/Build/Release/vcpkg_installed/include
  referenced by variable OPENTELEMETRY_CPP_INCLUDE_DIRS does not exist !

Where Build/Release/vcpkg_installed/x64-linux/share/absl/abslConfig.cmake:16 reads as

get_filename_component(PACKAGE_${CMAKE_FIND_PACKAGE_NAME}_COUNTER_1 "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)

but it should be "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE). The errorneous cmake config has ignored the x64-linux directory

Note, my build directory passed to cmake binary is ./Build/Release. I'm not sure if vcpkg has handled these path correctly.

Thanks!

@m-kuhn
Copy link
Contributor

m-kuhn commented Apr 4, 2024

same with libwebp (used by tiff) since a couple of hours

Building tiff[core,jpeg,lzma,zip]:[email protected]#3...
-- Downloading https://gitlab.com/libtiff/libtiff/-/archive/v4.6.0/libtiff-v4.6.0.tar.gz -> libtiff-libtiff-v4.6.0.tar.gz...
-- Extracting source /home/runner/builddir/_deps/vcpkg-src/downloads/libtiff-libtiff-v4.6.0.tar.gz
-- Applying patch FindCMath.patch
-- Applying patch requires-lerc.patch
-- Using source at /home/runner/builddir/_deps/vcpkg-src/buildtrees/tiff/src/v4.6.0-83f89a977c.clean
-- Found external ninja('1.11.1.git.kitware.jobserver-1').
-- Configuring x64-linux
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: /home/runner/work/_temp/-736618759/ninja-1.11.1.g95dee.kitware.jobserver-1_x86_64-linux-gnu/ninja -v
    Working Directory: /home/runner/builddir/_deps/vcpkg-src/buildtrees/tiff/x64-linux-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      /home/runner/builddir/_deps/vcpkg-src/buildtrees/tiff/config-x64-linux-rel-CMakeCache.txt.log
      /home/runner/builddir/_deps/vcpkg-src/buildtrees/tiff/config-x64-linux-out.log
Call Stack (most recent call first):
  /home/runner/builddir/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:252 (vcpkg_execute_required_process)
  ports/tiff/portfile.cmake:33 (vcpkg_cmake_configure)
  scripts/ports.cmake:170 (include)
error: building tiff:x64-linux failed with: BUILD_FAILED
Elapsed time to handle tiff:x64-linux: 2.1 s
CMake Error at /home/runner/builddir/vcpkg_installed/x64-linux/share/WebP/WebPConfig.cmake:15 (message):
  File or directory /home/runner/builddir/vcpkg_installed/include referenced
  by variable WebP_INCLUDE_DIR does not exist !
Call Stack (most recent call first):
  /home/runner/builddir/vcpkg_installed/x64-linux/share/WebP/WebPConfig.cmake:38 (set_and_check)
  /home/runner/builddir/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
  cmake/WebPCodec.cmake:29 (find_package)
  CMakeLists.txt:123 (include)

where WebPConfig.cmake:38 reads

set_and_check(WebP_INCLUDE_DIR "${PACKAGE_${CMAKE_FIND_PACKAGE_NAME}_COUNTER_1}/include")

@dg0yt
Copy link
Contributor

dg0yt commented Apr 4, 2024

Does CMake 3.29 generate different config files? It smells like vcpkg_cmake_config_fixup no longer correctly handling moving the directory to share.

@m-kuhn
Copy link
Contributor

m-kuhn commented Apr 4, 2024

I discover https://github.com/Kitware/CMake/releases/tag/v3.29.1 was released yesterday

@SimiPro
Copy link
Author

SimiPro commented Apr 4, 2024

Does CMake 3.29 generate different config files? It smells like vcpkg_cmake_config_fixup no longer correctly handling moving the directory to share.

Yea you are absolutely right!

https://github.com/SimiPro/starter-cmake-vcpkg-simple/actions/runs/8558878135/job/23454354767

Fixing the cmake version to ~3.28 we build successfully. I don't remember updating, thanks for the help!

I think we should still keep this issue open to fix it for 3.29 ?

--> EDIT: 3.29.0 as by @m-kuhn also correct.

@m-kuhn
Copy link
Contributor

m-kuhn commented Apr 4, 2024

3.29.0 is also fine, see https://github.com/opengisch/QField/actions/runs/8558906456/job/23454442829?pr=5149

m-kuhn added a commit to opengisch/QField that referenced this issue Apr 4, 2024
@m-kuhn
Copy link
Contributor

m-kuhn commented Apr 4, 2024

It would be nice to open an upstream issue, but my inexistant knowledge about the construct ${PACKAGE_${CMAKE_FIND_PACKAGE_NAME}_COUNTER_1} doesn't allow me to come up with a wording

nirvn pushed a commit to opengisch/QField that referenced this issue Apr 5, 2024
qfield-fairy pushed a commit to opengisch/QField that referenced this issue Apr 5, 2024
nirvn pushed a commit to opengisch/QField that referenced this issue Apr 5, 2024
@dg0yt
Copy link
Contributor

dg0yt commented Apr 5, 2024

I don't think it is fair to attribute this to CMake. That tool doesn't do anything wrong this time. (But they really shouldn't change it in patch releases.) It is vcpkg_cmake_config_fixup which promises to be able to move cmake config.

timoschwarzer added a commit to ori-community/wotw-rando-client that referenced this issue Apr 5, 2024
@WangWeiLin-MV WangWeiLin-MV added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Apr 7, 2024
@WangWeiLin-MV
Copy link
Contributor

CMake regression in 3.29.1 at Kitware - CMake - !9390.

@WangWeiLin-MV WangWeiLin-MV changed the title Wrong *Config.cmake files [vcpkg-cmake-config] Wrong *Config.cmake files in CMake 3.29.1 Apr 7, 2024
@WangWeiLin-MV WangWeiLin-MV changed the title [vcpkg-cmake-config] Wrong *Config.cmake files in CMake 3.29.1 [vcpkg-cmake-config] Wrong *Config.cmake files for CMake 3.29.1 Apr 7, 2024
@WangWeiLin-MV WangWeiLin-MV added category:port-bug The issue is with a library, which is something the port should already support and removed category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) labels Apr 7, 2024
@goeiecool9999
Copy link

The glslang port is also affected.

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glslang DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/glslang-config.cmake"
[[${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake]]
[[${CMAKE_CURRENT_LIST_DIR}/glslang-targets.cmake]]
)

It tries to replace ${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake with ${CMAKE_CURRENT_LIST_DIR}/glslang-targets.cmake but can't because ${PACKAGE_PREFIX_DIR} is now ${PACKAGE_${CMAKE_FIND_PACKAGE_NAME}_COUNTER_1}

kou added a commit to apache/arrow that referenced this issue Apr 12, 2024
### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
raulcd pushed a commit to apache/arrow that referenced this issue Apr 12, 2024
### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
vibhatha pushed a commit to vibhatha/arrow that referenced this issue Apr 15, 2024
…1151)

### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
daschuer added a commit to daschuer/vcpkg that referenced this issue Apr 15, 2024
daschuer added a commit to mixxxdj/vcpkg that referenced this issue Apr 16, 2024
JavierMatosD pushed a commit that referenced this issue Apr 22, 2024
Since `CMake` version `3.29.2` reverted [Kitware -CMake -
9390](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9390) in
[Kitware - CMake -
9420](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9420),
update it.

Fix #37968. Take the place of #38017.

See [Kitware - CMake -
25873](https://gitlab.kitware.com/cmake/cmake/-/issues/25873) and
[Kitware - CMake -
25827](https://gitlab.kitware.com/cmake/cmake/-/issues/25827)

Co-authored-by: FrankXie <[email protected]>
@WangWeiLin-MV WangWeiLin-MV added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly and removed category:port-bug The issue is with a library, which is something the port should already support labels Apr 23, 2024
tolleybot pushed a commit to tmct/arrow that referenced this issue May 2, 2024
…1151)

### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
tolleybot pushed a commit to tmct/arrow that referenced this issue May 4, 2024
…1151)

### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
rok pushed a commit to tmct/arrow that referenced this issue May 8, 2024
…1151)

### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
rok pushed a commit to tmct/arrow that referenced this issue May 8, 2024
…1151)

### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
vibhatha pushed a commit to vibhatha/arrow that referenced this issue May 25, 2024
…1151)

### Rationale for this change

vcpkg doesn't work with CMake 3.29.1.

See also: microsoft/vcpkg#37968

### What changes are included in this PR?

Use CMake 3.29.0 temporary.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41124

Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Jacob Wujciak-Jens <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
9 participants