libxml2: Set environment variables#7014
libxml2: Set environment variables#7014brian6932 wants to merge 2 commits intoScoopInstaller:masterfrom
Conversation
|
All changes look good. Wait for review from human collaborators. libxml2
|
|
I’d avoid setting |
What's the point of installing the package if you don't want to set the environment variables? This is a library package used for building with CMake and other generators. If someone wants to change the value, they're free to do that, but it should definitely be in the package. |
What I mean is that you cannot assume user is using CMake generator, and we should not set all possible env var for user. |
I don't agree, it's only a benefit to set it, we're packaging a library. Why package it at all if you don't set the environment variables? All library packages set the relevant environment variables. We're not modifying the Do you have any idea how many environment variables a developer would have to set if every single packaged library lacked necessary environment variables on large codebases? This is literally one of the largest reasons why people use vcpkg, conan, and linux distro package managers instead of manually downloading dependencies. |
|
Thanks for opening this and for thinking about downstream dev experience—totally with you on making library packages “just work.” As a developer myself, I appreciate when dependencies are easy to wire up. That said, exporting The portable discovery interfaces are:
This approach matches the official docs and avoids global env pollution and version pinning issues across multiple installs/versions. Suggestion: instead of # CMake (either of these works)
$prefix = "$env:SCOOP\apps\libxml2\current"
cmake -S . -B build -DLibXml2_ROOT="$prefix"
# or
$env:CMAKE_PREFIX_PATH = "$prefix;$env:CMAKE_PREFIX_PATH"
cmake -S . -B build# Meson / pkg-config
$prefix = "$env:SCOOP\apps\libxml2\current"
$env:PKG_CONFIG_PATH = "$prefix\lib\pkgconfig;$env:PKG_CONFIG_PATH"
# meson setup build # then dependency('libxml-2.0')References:
|
|
I don't think we should be modifying package config path, or CMake prefix path, you're generally not supposed to use package config on Windows. Sure, I wouldn't be opposed to adding |
https://cmake.org/cmake/help/latest/module/FindLibXml2.html
<manifest-name[@version]|chore>: <general summary of the pull request>