microsoft / vcpkg

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

How do I force vcpkg to use downloaded tools only? #17917

Closed zcream closed 3 years ago

zcream commented 3 years ago

I am facing a build error that I would like to debug. I see that vcpkg is using ninja from my system. -- Found external ninja('1.10.2').

As a method of debug I wish to tell vcpkg to ignore the system ninja and download its own copy. I'm not sure how to do that.

Build Error.

D:/vcpkg/downloads/tools/meson/meson-753954be868ed78b3e339e8811fd1d29eb2af237/me
son.py -Dmmx=enabled -Dsse2=enabled -Dssse3=enabled -Dlibpng=enabled --buildtype
 plain --backend ninja --wrap-mode nodownload --native D:/vcpkg/buildtrees/pixma
n/meson-nativ-x64-windows-static.log --default-library static --libdir lib --nat
ive D:/vcpkg/buildtrees/pixman/meson-nativ-x64-windows-static-debug.log -Ddebug=
true --prefix D:/vcpkg/packages/pixman_x64-windows-static/debug --includedir ../
include -Dcmake_prefix_path=['D:/vcpkg/installed/x64-windows-static/debug','D:/v
cpkg/installed/x64-windows-static','D:/vcpkg/installed/x64-windows-static/share'
] D:/vcpkg/buildtrees/pixman/src/0.40.0-9a8e17d6df.clean
    Working Directory: D:/vcpkg/buildtrees/pixman/x64-windows-static-dbg
    Error code: Exit code 0xc0000135

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_meson.cmake:455 (vcpkg_execute_required_process)

  ports/pixman/portfile.cmake:45 (vcpkg_configure_meson)
  scripts/ports.cmake:142 (include)

Error: Building package pixman:x64-windows-static failed with: BUILD_FAILED
zcream commented 3 years ago

For reference, I was able to build a number of other libs. Is the pixman build broken on windows 7 vcpkg?

DeveloperPaul123 commented 3 years ago

https://github.com/microsoft/vcpkg/blob/master/docs/users/config-environment.md#vcpkg_force_system_binaries

zcream commented 3 years ago

@DeveloperPaul123 VCPKG_FORCE_SYSTEM_BINARIES is not set. The build uses downloaded tools for all except ninja. The only set env is VCPKG_DEFAULT_TRIPLET with x64-windows-static

dg0yt commented 3 years ago

VCPKG_FORCE_SYSTEM_BINARIES works in the other direction, IIUC.

DeveloperPaul123 commented 3 years ago

@zcream @dg0yt Yes looking back at the original comment it seems that I misunderstood what OP was after; sorry about that. I'm not sure if it's possible honestly with the given options that are currently available with vcpkg.

dg0yt commented 3 years ago

As a method of debug I wish to tell vcpkg to ignore the system ninja and download its own copy. I'm not sure how to do that.

If the system ninja is taken from the PATH, it should be possible to change the PATH before running vcpkg.

zcream commented 3 years ago

Its odd. I cannot find it in my path. I get an error if I type ninja in cmd or powershell.

Also, pixman seems to fail using both x86 and x64 triplets while I can build many other libs. I do believe the issues is not ninja, pixman current build is broken at least on Windows 7.

zcream commented 3 years ago

@JackBoosY I have opened a build failure report at https://github.com/microsoft/vcpkg/issues/17924

I believe these issues are related to a build failure. The version of ninja is not the issue.

JackBoosY commented 3 years ago

vcpkg will find the path of the ninja in the PATH, if it cannot find it, it will download the appropriate version and use it.

NancyLi1013 commented 3 years ago

@zcream

Is this still a problem for you now?

zcream commented 3 years ago

@NancyLi1013 I have posted a general question https://github.com/microsoft/vcpkg/issues/18352 about using Visual Studio as generator instead of ninja. Some of my problems may be due to documented build failure after ninja 1.10

https://github.com/microsoft/vcpkg/pull/10964

NancyLi1013 commented 3 years ago

As you can see here https://github.com/microsoft/vcpkg/pull/10964#issuecomment-656362040, for the problem caused by Ninja, it would be better to fix on ports sides.

The original problem is different from the one in #10964. I also noticed that you opened another issue #17924, but you closed it. So please let me know if you have other concerns about the original problem in this issue.