Fixes `OUTPUT_VARIABLE`, `ERROR_VARIABLE`.
vcpkg always wants logfiles. CMake (`execute_process`) doesn't send
stdout/stderr to files and variables at the same time, and even "the
precedence is not specified". So simultaneous output has to be handled
in `vcpkg_execute_required_process`.
At this occasion, port the arguments for stripping trailing whitespace.
`tensorflow-common` implicitly relied on the broken behavior. I chose
the minimal fix: drop the pointless calls, just set the empty value.
If a call to `vcpkg_replace_string` makes no changes i.e doesn't
effectively replace a string, A warning is logged.
This should also help identify ports that no longer need these calls to
fix things in `.pc` files etc.
Avoid wrong use of popular but ambiguous variables (`WIN32` etc.) in
scripts and portfiles by detection in CI.
Sometimes the variables are used wrongly, and sometimes this isn't
caught in PR review. This PR tries to catch those variables (when in the
active code path in script mode). [This can happen to every
contributor](https://github.com/microsoft/vcpkg/pull/34356#discussion_r1360074122),
even if he/she knows the rules ... vcpkg is raising the bar higher than
usual, having to deal with targets and hosts even in script mode.
(`b2-options.cmake` (boost fragment) shows where we get if we don't pay
attention: the same code being used in script mode (`WIN32` meaning
host) and in project mode (`WIN32` meaning target).)
The new check doesn't break any user builds because it relies on command
line options. However it changes the ABI hashes.
Fixes#38764, update `7zip` to 24.06.
No feature needs to be tested, the usage test passed on
`x64-windows`(header files found):
```
7zip provides CMake targets:
# this is heuristically generated, and may not be correct
find_package(7zip CONFIG REQUIRED)
target_link_libraries(main PRIVATE 7zip::7zip)
```
msys2-runtime no longer supports Windows 7 since version 3.5.
msys2-runtime-3.4 is the replacement for user who cannot upgrade. YMMV.
autoconf-wrapper is not updated, cf. #36774.
pkgconf is not updated, waiting for 2.2.
While authoring vcpkg_from_git to authenticated servers documentation,
@JavierMatosD and I discovered some failure modes that are not clear in
the output.
Example with REF set to a branch name:
```console
The port under test is:
vcpkg_from_git(
OUT_SOURCE_PATH out
URL https://github.com/microsoft/vcpkg
REF 2024.01.12
)
========== BEFORE ===============
Computing installation plan...
The following packages will be built and installed:
test-port:x64-windows@1 -- D:\test\test-port
Detecting compiler hash for triplet x64-windows...
Installing 1/1 test-port:x64-windows@1...
Building test-port:x64-windows@1...
-- Installing port from location: D:\test\test-port
-- Fetching https://github.com/microsoft/vcpkg 2024.01.12...
CMake Error at scripts/cmake/vcpkg_from_git.cmake:141 (message):
unable to rev-parse 2024.01.12 after fetching git repository
Call Stack (most recent call first):
D:/test/test-port/portfile.cmake:1 (vcpkg_from_git)
scripts/ports.cmake:170 (include)
error: building test-port:x64-windows failed with: BUILD_FAILED
Elapsed time to handle test-port:x64-windows: 1.8 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+test-port
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[test-port]+Build+error+on+x64-windows&body=Copy+issue+body+from+D%3A%2Fvcpkg2%2Finstalled%2Fvcpkg%2Fissue_body.md
========== AFTER ================
Computing installation plan...
The following packages will be built and installed:
test-port:x64-windows@1 -- D:\test\test-port
Detecting compiler hash for triplet x64-windows...
Installing 1/1 test-port:x64-windows@1...
Building test-port:x64-windows@1...
-- Installing port from location: D:\test\test-port
-- Fetching https://github.com/microsoft/vcpkg 2024.01.12...
CMake Error at scripts/cmake/vcpkg_from_git.cmake:142 (message):
After fetching 2024.01.12, the target ref 2024.01.12 appears inaccessible.
A common cause of this failure is setting REF to a named branch or tag
rather than a commit SHA. REF must be a commit SHA. If the git server
does not advertise commit SHAs (uploadpack.allowReachableSHA1InWant is
false), you can set FETCH_REF to a named branch in which the desired commit
SHA is in the history. For example, you may be able to fix this error by
changing "REF 2024.01.12" to "REF a-commit-sha FETCH_REF 2024.01.12". (git
rev-parse 2024.01.12 failed)
Call Stack (most recent call first):
D:/test/test-port/portfile.cmake:1 (vcpkg_from_git)
scripts/ports.cmake:170 (include)
error: building test-port:x64-windows failed with: BUILD_FAILED
Elapsed time to handle test-port:x64-windows: 1.9 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+test-port
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[test-port]+Build+error+on+x64-windows&body=Copy+issue+body+from+D%3A%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
```
Example with REF ste to a branch name with FETCH_REF set:
```console
PS D:\test> run-test
The following packages are not installed:
test-port:x64-windows
The following packages are not installed:
test-port:x64-windows
The port under test is:
vcpkg_from_git(
OUT_SOURCE_PATH out
URL https://github.com/microsoft/vcpkg
REF 2024.01.12
FETCH_REF master
)
========== BEFORE ===============
Computing installation plan...
The following packages will be built and installed:
test-port:x64-windows@1 -- D:\test\test-port
Detecting compiler hash for triplet x64-windows...
Installing 1/1 test-port:x64-windows@1...
Building test-port:x64-windows@1...
-- Installing port from location: D:\test\test-port
-- Fetching https://github.com/microsoft/vcpkg master...
CMake Error at scripts/cmake/vcpkg_from_git.cmake:141 (message):
unable to rev-parse 2024.01.12 after fetching git repository
Call Stack (most recent call first):
D:/test/test-port/portfile.cmake:1 (vcpkg_from_git)
scripts/ports.cmake:170 (include)
error: building test-port:x64-windows failed with: BUILD_FAILED
Elapsed time to handle test-port:x64-windows: 1.6 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+test-port
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[test-port]+Build+error+on+x64-windows&body=Copy+issue+body+from+D%3A%2Fvcpkg2%2Finstalled%2Fvcpkg%2Fissue_body.md
========== AFTER ================
Computing installation plan...
The following packages will be built and installed:
test-port:x64-windows@1 -- D:\test\test-port
Detecting compiler hash for triplet x64-windows...
Installing 1/1 test-port:x64-windows@1...
Building test-port:x64-windows@1...
-- Installing port from location: D:\test\test-port
-- Fetching https://github.com/microsoft/vcpkg master...
CMake Error at scripts/cmake/vcpkg_from_git.cmake:138 (message):
After fetching master, the target ref 2024.01.12 appears inaccessible. A
common cause of this failure is setting REF to a named branch or tag rather
than a commit SHA. REF must be a commit SHA. (git rev-parse 2024.01.12
failed)
Call Stack (most recent call first):
D:/test/test-port/portfile.cmake:1 (vcpkg_from_git)
scripts/ports.cmake:170 (include)
error: building test-port:x64-windows failed with: BUILD_FAILED
Elapsed time to handle test-port:x64-windows: 1.5 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+test-port
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[test-port]+Build+error+on+x64-windows&body=Copy+issue+body+from+D%3A%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
```
---------
Co-authored-by: Thomas1664 <46387399+Thomas1664@users.noreply.github.com>
Pass `share/pkgconfig` instead of `debug/share/pkgconfig`: The `share`
location is for config-independent data.
Integrate `CURRENT_PACKAGES_DIR` locations.
Change the function interface to take a CONFIG parameter instead of
prefix list (suggested below).
Use `z_vcpkg_setup_pkgconfig_path` also for `vcpkg_fixup_pkgconfig`
(which already had proper handling of `CURRENT_PACKAGES_DIR` and
`share`).
Remove redundant trailing slash.
Extend unit test.
Fixes consuming `wayland-protocols` and similar.
Reason:
```
-- Adjusting original rpath of: '/mnt/e/all/vcpkg/installed/x64-linux-release/lib/pkgconfig/../../lib/intel64/'
-- Fixed rpath in: '/mnt/e/all/vcpkg/packages/numpy_x64-linux-release/lib/python3.11/site-packages/numpy/linalg/lapack_lite.cpython-311-x86_64-linux-gnu.so' ('$ORIGIN:$ORIGIN/../../../../:$ORIGIN/../../../../intel64/')
```
needed `$ORIGIN/../../../../intel64/` in there which came from a pc file
via `-Wl,-rpath='${libdir}'`
---------
Co-authored-by: Osyotr <Osyotr@users.noreply.github.com>
* Limit CI
* Update msys2
* Declare msys packages for pkgconfig and fortran...
... with explicit DEPS and PROVIDES, instead of using DIRECT_PACKAGES.
This change makes it possible to notice changed dependencies
in `vcpkg-ci-msys2` update checks. (Current case: zstd.)
It also enables reuse of general declarations from `vcpkg_acquire_msys`
in specialized cases (`vpckg_find_fortran`).
Last not least, using the the Z_DECLARE_EXTRA_PACKAGES_COMMAND
simplifies the implementation of `vcpkg-ci-msys2`, in particular for
checks across platform boundaries.
* Revert "Limit CI"
* Fix lib suffix matching
* Preserve flags when transforming standard libs
* Use separate_arguments
* Fix transform
* [vcpkg_configure_make] Fix SKIP_CONFIGURE
* Update linker flags
* Update linker flags
* Fix regex substitution
* Restore full CI
* Reuse configure's linker flags setup
* Handle ldflags separately from linker flags
* Factor out common definitions
* Control docdir and mandir for debug
* Use vcpkg_list APPEND
* Don't pass -avoid-version into configure
* Restore lost escaping
* Copy --target from LDFLAGS to CC/CXX
* Consolidate macros into one function
* Elaborate ABI flags
* Elaborate flag processing
* Update warnings for embedded space
* Update windows tool path fixup
* [libudns] No cross builds
* [vcpkg_find_acquire_program] Add VSCLANG
Find VS's clang without fallback to the giant LLVM download.
* [gmp] Update CCAS setup
* [nettle] Update CCAS setup
* Fix VSCLANG
* WIP
* Restore processing of isysroot
* [nettle] Fix assembler option
* [liburing] Adjust
* Variable name changes
* Remove redundant separate arguments
* Move -m32/-m64 to ABI flags
* Unify ABIFLAGS spelling
* CI
* Revert VSCLANG
* Use GNU Make to build autotools ports on FreeBSD (microsoft/vcpkg#32282)
* Fix flag removal
* Drop separation of ABI flags
* Handle '-arch=...'
* Revert "Control docdir and mandir for debug"
This reverts commit d8293a1997.
* [icu] Pass uwp option to pkgdata
* Restore old osx flags hook
* Add triplet variable to make libtool pass --target to linker
---------
Co-authored-by: Schaich, Alonso <alonsoschaich@fastmail.fm>
* Extract vcpkg_extract_archive from vcpkg_find_acquire_program.
* Extract vcpkg_download_sourceforge from vcpkg_from_sourceforge.
This allows vcpkg_find_acquire_program to download from SourceForge without needing to temporarily change _VCPKG_EDITABLE.
* Use whether a URI is known for an entity to decide whether to downloads it rather than checking a separate supported_on_unix boolean.
* Add unparsed arguments check to vcpkg_extract_archive
* [vcpkg_configure_make] fix case sensitive comparison in PATH system dir search
* Fixes after code review
---------
Co-authored-by: Victor NIVET <vnivet@invoke.fr>