microsoft / vcpkg

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

[CMAKE]SDL2 Curl Zlib build failure #12092

Open SufAfrican opened 4 years ago

SufAfrican commented 4 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: .\vcpkg install sdl2 curl

Failure logs PS C:\vcpkg> .\vcpkg install sdl2 curl Computing installation plan... The following packages will be built and installed: curl[core,non-http,ssl,sspi,winssl]:x86-windows sdl2[core]:x86-windows

Call Stack (most recent call first): C:/vcpkg/ports/zlib/portfile.cmake:5 (vcpkg_download_distfile) C:/vcpkg/scripts/ports.cmake:73 (include)

Additional context Old installation of vcpkg broke after installing opencv, removed old installation. Cloned and created new installation of vcpkg, followed steps from readme. I've noticed the double directory

/c/vcpkg/C:/vcpkg/downloads/zlib1211.tar.gz

not sure if that's the issue.

SufAfrican commented 4 years ago

./vcpkg install zlib:x86-windows Computing installation plan... The following packages will be built and installed: zlib[core]:x86-windows Starting package 1/1: zlib:x86-windows Building package zlib[core]:x86-windows... CMake Error at C:/vcpkg/scripts/cmake/vcpkg_download_distfile.cmake:82 (file): file must be called with at least two arguments. Call Stack (most recent call first): C:/vcpkg/ports/zlib/portfile.cmake:5 (vcpkg_download_distfile) C:/vcpkg/scripts/ports.cmake:73 (include)

Could not copy into file: C:\vcpkg\packages\zlib_x86-windows\share\zlib\vcpkg_abi_info.txt

JackBoosY commented 4 years ago

Can you re-clone vcpkg in a non-system partition and try again?

Thanks.

SufAfrican commented 4 years ago
PS D:\git\vcpkg> .\bootstrap-vcpkg.bat

Building vcpkg.exe ...

  pch.cpp
  archives.cpp
  checks.cpp
  chrono.cpp
  cofffilereader.cpp
  downloads.cpp
  enums.cpp
  files.cpp
  hash.cpp
  json.cpp
  machinetype.cpp
  parse.cpp
  strings.cpp
  stringview.cpp
  system.cpp
  system.print.cpp
  system.process.cpp
  unicode.cpp
  binarycaching.cpp
  binaryparagraph.cpp
  build.cpp
  buildenvironment.cpp
  cmakevars.cpp
  commands.autocomplete.cpp
  commands.buildexternal.cpp
  commands.cache.cpp
  commands.ci.cpp
  commands.ciclean.cpp
  commands.contact.cpp
  commands.cpp
  commands.create.cpp
  commands.dependinfo.cpp
  commands.edit.cpp
  commands.env.cpp
  commands.exportifw.cpp
  commands.import.cpp
  commands.integrate.cpp
  commands.list.cpp
  commands.owns.cpp
  commands.porthistory.cpp
  commands.portsdiff.cpp
  commands.search.cpp
  commands.setinstalled.cpp
  commands.upgrade.cpp
  commands.version.cpp
  commands.xvsinstances.cpp
  dependencies.cpp
  export.cpp
  export.chocolatey.cpp
  export.prefab.cpp
  globalstate.cpp
  help.cpp
  input.cpp
  install.cpp
  logicexpression.cpp
  metrics.cpp
  packagespec.cpp
  paragraphparseresult.cpp
  paragraphs.cpp
  portfileprovider.cpp
  postbuildlint.buildtype.cpp
  postbuildlint.cpp
  remove.cpp
  sourceparagraph.cpp
  statusparagraph.cpp
  statusparagraphs.cpp
  tools.cpp
  triplet.cpp
  update.cpp
  userconfig.cpp
  vcpkgcmdarguments.cpp
  vcpkglib.cpp
  vcpkgpaths.cpp
  versiont.cpp
  visualstudio.cpp
  vcpkglib.vcxproj -> D:\git\vcpkg\toolsrc\msbuild.x86.release\vcpkglib.lib
  vcpkg.cpp
  Generating code
  Previous IPDB not found, fall back to full compilation.
  All 18348 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  vcpkg.vcxproj -> D:\git\vcpkg\toolsrc\msbuild.x86.release\vcpkg.exe
  vcpkgmetricsuploader.cpp
  Generating code
  Previous IPDB not found, fall back to full compilation.
  All 7760 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Finished generating code
  vcpkgmetricsuploader.vcxproj -> D:\git\vcpkg\toolsrc\msbuild.x86.release\vcpkgmetricsuploader.exe

Building vcpkg.exe... done.

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
PS D:\git\vcpkg> .\vcpkg integrate install
Applied user-wide integration for this vcpkg root.

All MSBuild C++ projects can now #include any installed libraries.
Linking will be handled automatically.
Installing new libraries will make them instantly available.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=D:/git/vcpkg/scripts/buildsystems/vcpkg.cmake"
PS D:\git\vcpkg> .\vcpkg install sdl2 curl
Computing installation plan...
The following packages will be built and installed:
    curl[core,non-http,ssl,sspi,winssl]:x86-windows
    sdl2[core]:x86-windows
  * zlib[core]:x86-windows
Additional packages (*) will be modified to complete this operation.
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Downloading powershell-core...
  https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip -> D:\git\vcpkg\downloads\PowerShell-6.2.1-win-x86.zip
Extracting powershell-core...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
  https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> D:\git\vcpkg\downloads\7-zip.commandline.18.1.0.nupkg
Extracting 7zip...
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1...
Downloading nuget...
  https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> D:\git\vcpkg\downloads\nuget.exe
Starting package 1/3: zlib:x86-windows
Building package zlib[core]:x86-windows...
A suitable version of git was not found (required v2.26.2). Downloading portable git v2.26.2...
Downloading git...
  https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe -> D:\git\vcpkg\downloads\PortableGit-2.26.2-32-bit.7z.exe
Extracting git...
-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
CMake Error at D:/git/vcpkg/scripts/cmake/vcpkg_download_distfile.cmake:185 (file):
  file RENAME failed to rename

    /d/git/vcpkg/D:/git/vcpkg/downloads/temp/zlib1211.tar.gz

  to

    /d/git/vcpkg/D:/git/vcpkg/downloads/zlib1211.tar.gz

  because: No such file or directory

Call Stack (most recent call first):
  D:/git/vcpkg/ports/zlib/portfile.cmake:5 (vcpkg_download_distfile)
  D:/git/vcpkg/scripts/ports.cmake:73 (include)

Error: Building package zlib:x86-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: zlib:x86-windows
  Vcpkg version: 2020.02.04-nohash

Additionally, attach any relevant sections from the log files above.
PS D:\git\vcpkg>
SufAfrican commented 4 years ago

Can you re-clone vcpkg in a non-system partition and try again?

Thanks

Thank you for taking a look at the problem @JackBoosY I've cloned it into my D: drive this time, same issues.

I've noticed the zlib download in the temp folder has different name styling compared to the compressed file from the zlib download link. Not sure if vcpkg strips some parts out.

zlib site download = zlib-1.2.11.tar.gz vcpkg temp = zlib1211.tar.gz

SufAfrican commented 4 years ago

Seems it could be an issue with Cmake, possibly from a newer version.

SufAfrican commented 4 years ago

Removed Cmake installation -> removed vcpkg -> cloned vcpkg -> did setup -> Redownloaded cmake from vcpkg -> installed SDL2 Curl = Success.

Seems it is an issue with Cmake, read some issues on gitlab which pointed to incorrect virtual directories and ninja.

JackBoosY commented 4 years ago

@SufAfrican Yes, we need to wait for cmake to update.