microsoft / vcpkg

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

Dependency too heavy #14603

Closed playgithub closed 3 years ago

playgithub commented 3 years ago

I'm trying to port poppler It depends on clang-format vcpkg install llvm[clang-tools-extra] clang-format is small, but for dependencies, it builds for hours

λ vcpkg install llvm[clang-tools-extra]
Computing installation plan...
The following packages will be built and installed:
    llvm[clang,clang-tools-extra,core,default-targets,disable-abi-breaking-checks,disable-assertions,disable-clang-static-analyzer,enable-rtti,lld,target-x86,tools]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: llvm:x64-windows
Building package llvm[clang,clang-tools-extra,core,default-targets,disable-abi-breaking-checks,disable-assertions,disable-clang-static-analyzer,enable-rtti,lld,target-x86,tools]:x64-windows...
Could not locate cached archive: 
%localappdata%\vcpkg\archives\4c\4c9803c9697ac545a97a8cbb5bbe8485f2c767d2.zip
-- Note: llvm only supports static library linkage. Building static library.
-- Downloading https://github.com/llvm/llvm-project/archive/llvmorg-10.0.0.tar.gz...
-- Extracting source /vcpkg-root/downloads/llvm-llvm-project-llvmorg-10.0.0.tar.gz
-- Applying patch 0001-allow-to-use-commas.patch
-- Applying patch 0002-fix-install-paths.patch
-- Applying patch 0003-fix-vs2019-v16.6.patch
-- Applying patch 0004-fix-dr-1734.patch
-- Applying patch 0005-fix-tools-path.patch
-- Using source at /vcpkg-root/buildtrees/llvm/src/org-10.0.0-cfac4b4b0f.clean
-- Downloading https://www.python.org/ftp/python/3.8.3/python-3.8.3-embed-amd64.zip...
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel

Installed successfully, vcpkg-root\buildtrees\llvm takes 102GB (109,870,017,874 bytes) 😭

Something like vcpkg-root\downloads\tools is better in the case, i.e. simply download clang-foramt.exe as a tool.

JackBoosY commented 3 years ago

Sorry for that but we hope that all binaries will be built, which also matches the behavior of open source.

playgithub commented 3 years ago

Give a hint warning about the size is helpful. Then I might choose to download LLVM clang installer (172MB) from the official site, and make clang-format be in PATH.

JackBoosY commented 3 years ago

https://github.com/microsoft/vcpkg/blob/62fe6ffbbbae9149fb8c48cde2a34b809e2a3008/scripts/cmake/vcpkg_find_acquire_program.cmake#L297-L327

We can refer to clang to find clang-format.