microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.27k stars 6.42k forks source link

[vcpkg-tool-meson] Build error on x64-windows #37413

Closed githubmkk closed 5 months ago

githubmkk commented 8 months ago

Trying to install GDAL but vcpkg fails. following commands used to install

1- D:\GDAL\vcpkg-master>bootstrap-vcpkg.bat 2- D:\GDAL\vcpkg-master>vcpkg install gdal --triplet=x64-windows

following is the issue body from D:/GDAL/vcpkg/installed/vcpkg/issue_body.md

Package: vcpkg-tool-meson:x64-windows@1.3.2

Host Environment

To Reproduce

vcpkg install gdal Failure logs


-- Installing: D:/GDAL/vcpkg/packages/vcpkg-tool-meson_x64-windows/share/vcpkg-tool-meson/copyright
-- Downloading https://www.python.org/ftp/python/3.11.8/python-3.11.8-embed-amd64.zip -> python-3.11.8-embed-amd64.zip...
-- Found Python version '3.11.8 at D:/GDAL/vcpkg/downloads/tools/python/python-3.11.8-x64/python.exe'
-- Downloading https://github.com/mesonbuild/meson/archive/614d436232d3a86518164cbe2b8af12db3bde009.tar.gz -> meson-614d436232d3a86518164cbe2b8af12db3bde009.tar.gz...
-- Applying patch D:/GDAL/vcpkg/packages/vcpkg-tool-meson_x64-windows/share/vcpkg-tool-meson/adjust-args.patch
CMake Error at scripts/cmake/z_vcpkg_apply_patches.cmake:34 (message):
  Applying patch failed:
Call Stack (most recent call first):
  packages/vcpkg-tool-meson_x64-windows/share/vcpkg-tool-meson/vcpkg-port-config.cmake:50 (z_vcpkg_apply_patches)
  ports/vcpkg-tool-meson/portfile.cmake:39 (include)
  scripts/ports.cmake:175 (include)
githubmkk commented 8 months ago

FYI: code was taken from master branch

JonLiu1993 commented 8 months ago

@githubmkk, Thanks for posting this issue, I can not reproduce your error on my local machine. Does your computer have anti-virus software or some encrypted directories? When git appy path accesses your buildtrees directory, the inability to access it may cause this error.

githubmkk commented 8 months ago

Thanks for the response. Yes I have antivirus installed on my machine. But directories are NOT encrypted. Can you please guide more what steps I need to take?

Thank you

On Fri, Mar 15, 2024 at 1:31 PM JonLiu1993 @.***> wrote:

@githubmkk https://github.com/githubmkk, Thanks for posting this issue, I can not reproduce your error on my local machine. Does your computer have anti-virus software or some encrypted directories? When git appy path accesses your buildtrees directory, the inability to access it may cause this error.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/37413#issuecomment-1999162943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZR46A6ORJHW64YY7PZVQDYYKWWVAVCNFSM6AAAAABETZVTBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJZGE3DEOJUGM . You are receiving this because you were mentioned.Message ID: @.***>

-- M Khalid Khan

JonLiu1993 commented 8 months ago

Please uninstall the anti-virus software and try again.

ralight commented 8 months ago

I have the same error. I don't have encrypted directories and only have the default Windows AV.

Installing 1/5 vcpkg-tool-meson:x64-windows@1.3.2...
Building vcpkg-tool-meson:x64-windows@1.3.2...
-- Installing: C:/vcpkg/packages/vcpkg-tool-meson_x64-windows/share/vcpkg-tool-meson/copyright
-- Using cached python-3.11.8-embed-amd64.zip.
-- Found Python version '3.11.8 at C:/vcpkg/downloads/tools/python/python-3.11.8-x64/python.exe'
-- Using cached meson-614d436232d3a86518164cbe2b8af12db3bde009.tar.gz.
CMake Error at scripts/cmake/z_vcpkg_apply_patches.cmake:34 (message):
  Applying patch failed:
Call Stack (most recent call first):
  packages/vcpkg-tool-meson_x64-windows/share/vcpkg-tool-meson/vcpkg-port-config.cmake:50 (z_vcpkg_apply_patches)
  ports/vcpkg-tool-meson/portfile.cmake:39 (include)
  scripts/ports.cmake:175 (include)
ralight commented 8 months ago

If I revert to 431eb6bda0950874c8d4ed929cc66e15d8aae46f, i.e. just before meson was updated then it builds fine.

JackBoosY commented 7 months ago

@JonLiu1993 Try to re-make the patch and see the different.

JonLiu1993 commented 7 months ago

@githubmkk, @ralight, Yesterday vcpkg was updated to the latest version. I tried it again locally and still could successfully install vcpkg-tool-meson:X64windows. Please delete your vcpkg and clone the latest version to try it.

PS F:\Feature-test\vcpkg> ./vcpkg install gdal --triplet=x64-windows --editable
Computing installation plan...
The following packages are already installed:
    gdal[core,zstd,webp,sqlite3,recommended-features,qhull,postgresql,png,pcre2,openssl,openjpeg,netcdf,lzma,libxml2,libspatialite,libkml,lerc,jpeg,iconv,hdf5,gif,geos,expat,default-features,curl]:x64-windows@3.8.4
gdal:x64-windows is already installed
Total install time: 1.52 ms
The package GDAL provides CMake targets:

    find_package(GDAL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE GDAL::GDAL)

PS F:\Feature-test\vcpkg> ./vcpkg --version
vcpkg package management program version 2024-03-14-7d353e869753e5609a1f1a057df3db8fd356e49d

See LICENSE.txt for license information.
ralight commented 7 months ago

It worked for me now, thank you.

JonLiu1993 commented 5 months ago

We haven't been able to repro this; if more information comes up, or this issue appears again, please reopen.