Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg-scripts] Update msys2, add x64 PKGCONFIG #35331

Merged
merged 14 commits into from
Nov 29, 2023

Conversation

dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Nov 26, 2023

Includes #34274, #35299 (plus one fix), plus a reimplementation of #24160.

NB: Adding x64 pkgconf implies that x86 pkgconf is no longer tested in vcpkg CI.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 26, 2023

CC @MehdiChinoune

@MehdiChinoune
Copy link
Contributor

MehdiChinoune commented Nov 26, 2023

It's using x86_64-pkgconf on arm64 (was using i686), Is there something wrong?
Edit: Unless It is cross-building from x64 machine.
Edit: OK, I see the same on x86-windows

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 26, 2023

It's using x86_64-pkgconf on arm64 (was using i686), Is there something wrong? Edit: Unless It is cross-building from x64 machine. Edit: OK, I see the same on x86-windows

It must run on the host. The target is set by variables. #24160 had it wrong.

@MehdiChinoune
Copy link
Contributor

It must run on the host. The target is set by variables. #24160 had it wrong.

I thought that arm64-windows and x86-windows are native.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 26, 2023

It must run on the host. The target is set by variables. #24160 had it wrong.

I thought that arm64-windows and x86-windows are native.

Native means host==target. Not sure if this is relevant here.

For the build tools, we can benefit from compatibility and emulation, such as running x64 on x86 or even running x86 on arm64 windows. But whatever is executed, it is dependent on the host, not on the target (which might be arm-android or wasm32-emscripten or some other CPU).

Given the windows CPU support, it would probably be enough to have x86 for pkgconf. But I don't mind being prepared for removal of x86 tools.

@MehdiChinoune
Copy link
Contributor

Native means host==target. Not sure if this is relevant here.

native means arm64-windows runs on aarch64 CPU which means selecting aarch64-pkgconf.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 26, 2023

I thought that arm64-windows and x86-windows are native.

vcpkg CI builds arm64-windows and x86-windows on x64-windows...

native means arm64-windows runs on aarch64 CPU which means selecting aarch64-pkgconf.

Sure, on an arm64 host, arm64 pkgconf is native. But this is a much more specific statement than "arm64-windows is native".

But there is nothing wrong with this PR, isn't it?

@MehdiChinoune
Copy link
Contributor

But there is nothing wrong with this PR, isn't it?

Yes, I was just explaining my wrong expectations.

@FrankXie05 FrankXie05 added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Nov 27, 2023
@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 27, 2023

I suggest to merge #34776 at the same time, without another integration run. Why?
To not loose time and to reduce world rebuilds for users.
The effects on artifacts are independent: That PR affects only VCPKG_HOST_IS_OSX, and this PR affects only VCPKG_HOST_IS_WINDOWS.
But both PRs affect ABI hashes on all triplets, independently.

@FrankXie05 FrankXie05 added the info:reviewed Pull Request changes follow basic guidelines label Nov 27, 2023
@vicroms vicroms merged commit 1181756 into microsoft:master Nov 29, 2023
15 checks passed
@dg0yt dg0yt deleted the msys-update-all branch November 29, 2023 07:16
@BillyONeal
Copy link
Member

Pretty sure this caused a big perf problem. Compare November 28:

2023-11-28T15:01:57.1447145Z -- Using msys root at D:/downloads/tools/msys2/d7266db249278763
2023-11-28T15:01:57.1681629Z -- Generating configure for x64-windows
2023-11-28T15:02:46.7561009Z -- Finished generating configure for x64-windows
2023-11-28T15:02:46.7982539Z -- Using cached mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst.
2023-11-28T15:02:46.8713409Z -- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
2023-11-28T15:02:46.8747941Z -- Using msys root at D:/downloads/tools/msys2/6f3fa1a12ef85a6f
2023-11-28T15:02:46.8786596Z -- Configuring x64-windows-dbg
2023-11-28T15:05:47.4338206Z -- Configuring x64-windows-rel
2023-11-28T15:08:47.3949265Z -- Building x64-windows-dbg
2023-11-28T15:11:10.6156395Z -- Installing x64-windows-dbg
2023-11-28T15:11:12.4061538Z -- Building x64-windows-rel
2023-11-28T15:13:40.7680136Z -- Installing x64-windows-rel
2023-11-28T15:13:42.5677576Z -- Performing post-build validation
2023-11-28T15:13:43.5280313Z Stored binaries in 1 destinations in 391 ms.
2023-11-28T15:13:43.5291811Z Elapsed time to handle libunistring:x64-windows: 12 min

to last Friday:

2023-12-02T20:01:15.2556347Z -- Generating configure for x64-windows
2023-12-02T20:04:34.3786862Z -- Finished generating configure for x64-windows
2023-12-02T20:04:34.4064395Z -- Using cached mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst.
2023-12-02T20:04:34.4482888Z -- Using cached msys2-msys2-runtime-3.4.9-3-x86_64.pkg.tar.zst.
2023-12-02T20:04:34.4507297Z -- Using msys root at D:/downloads/tools/msys2/023cdb3ca06f77f2
2023-12-02T20:04:34.4539170Z -- Configuring x64-windows-dbg
2023-12-02T20:17:59.2635479Z -- Configuring x64-windows-rel
2023-12-02T20:31:25.8371919Z -- Building x64-windows-dbg
2023-12-02T20:42:32.9430398Z -- Installing x64-windows-dbg
2023-12-02T20:42:40.6324455Z -- Building x64-windows-rel
2023-12-02T20:53:51.4272810Z -- Installing x64-windows-rel
2023-12-02T20:53:59.1337404Z -- Performing post-build validation
2023-12-02T20:53:59.9378608Z Stored binaries in 1 destinations in 359 ms.
2023-12-02T20:53:59.9388855Z Elapsed time to handle libunistring:x64-windows: 53 min

Do you know of obvious perftrocities here?

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 7, 2023

Do you know of obvious perftrocities here?

I'n not aware of particular problems.

libunistring: This port uses a lot of shell scripting, sub-shells, pipelines. And there is a patch to parallelize some independent steps, with signifcant effect in CI. Either forks became more expensive, or parallelism is reduced.

Extendig my #34274 notes, major changes were:

gfortran -> 13.2
msys2-runtime 3.4.6 -> 3.4.9-3 (upstreamed fixes for flaky "Bad address" errors when invoking Windows program from MSYS2)
pkgconf -> 2.1 (upstreamed fixes for search order and link lib order)
python -> 3.11

There was no update to make, so parallelism shouln't have changed.
gfortran, pkgconf and python are not on the hot path for libunistring or gettext.
But msys2-runtime is critical for performance.

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 7, 2023

@BillyONeal This PR seems unrelated to the performance regression:
The first CI run after this PR was normal.
The problem started in the second CI run.

--- 2023-11-30
+++ 2023-12-02
@@ -1,4 +1,4 @@
-Installing 959/2218 libunistring:x64-windows...
+Installing 960/2220 libunistring:x64-windows...
 Building libunistring:x64-windows...
 -- Downloading https://ftp.gnu.org/gnu/libunistring/libunistring-1.1.tar.xz;https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libunistring/libunistring-1.1.tar.xz -> libunistring-1.1.tar.xz...
 -- Extracting source D:/downloads/libunistring-1.1.tar.xz
@@ -56,5 +56,5 @@
 -- Building x64-windows-rel
 -- Installing x64-windows-rel
 -- Performing post-build validation
-Stored binaries in 1 destinations in 353 ms.
-Elapsed time to handle libunistring:x64-windows: 9.1 min
+Stored binaries in 1 destinations in 359 ms.
+Elapsed time to handle libunistring:x64-windows: 53 min

bb58898...16ee2ec

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 8, 2023

What I find irritating is that many CI runs (incl. PR CI) don't take some msys2 packages from asset cache.
Isn't this all handled by stable SHA512?

-- Downloading https://mirror.msys2.org/msys/x86_64/autoconf-wrapper-20221207-1-any.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/autoconf-wrapper-20221207-1-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/autoconf-wrapper-20221207-1-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/autoconf-wrapper-20221207-1-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/autoconf-wrapper-20221207-1-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/autoconf-wrapper-20221207-1-any.pkg.tar.zst -> msys2-autoconf-wrapper-20221207-1-any.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/automake-wrapper-20221207-1-any.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/automake-wrapper-20221207-1-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/automake-wrapper-20221207-1-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/automake-wrapper-20221207-1-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/automake-wrapper-20221207-1-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/automake-wrapper-20221207-1-any.pkg.tar.zst -> msys2-automake-wrapper-20221207-1-any.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/binutils-2.41-3-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/binutils-2.41-3-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/binutils-2.41-3-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/binutils-2.41-3-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/binutils-2.41-3-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/binutils-2.41-3-x86_64.pkg.tar.zst -> msys2-binutils-2.41-3-x86_64.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/libtool-2.4.7-3-x86_64.pkg.tar.zst -> msys2-libtool-2.4.7-3-x86_64.pkg.tar.zst...
-- Using cached msys2-make-4.4.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-pkgconf-2.1.0-1-x86_64.pkg.tar.zst.
-- Downloading https://mirror.msys2.org/msys/x86_64/which-2.21-4-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/which-2.21-4-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/which-2.21-4-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/which-2.21-4-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/which-2.21-4-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/which-2.21-4-x86_64.pkg.tar.zst -> msys2-which-2.21-4-x86_64.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/autoconf-archive-2023.02.20-1-any.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/autoconf-archive-2023.02.20-1-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/autoconf-archive-2023.02.20-1-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/autoconf-archive-2023.02.20-1-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/autoconf-archive-2023.02.20-1-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/autoconf-archive-2023.02.20-1-any.pkg.tar.zst -> msys2-autoconf-archive-2023.02.20-1-any.pkg.tar.zst...
-- Using cached msys2-bash-5.2.021-1-x86_64.pkg.tar.zst.
-- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst.
-- Using cached msys2-file-5.45-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gawk-5.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst.
-- Using cached msys2-gzip-1.13-1-x86_64.pkg.tar.zst.
-- Using cached msys2-diffutils-3.10-1-x86_64.pkg.tar.zst.
-- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.9-3-x86_64.pkg.tar.zst.
-- Downloading https://mirror.msys2.org/msys/x86_64/autoconf2.71-2.71-3-any.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/autoconf2.71-2.71-3-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/autoconf2.71-2.71-3-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/autoconf2.71-2.71-3-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/autoconf2.71-2.71-3-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/autoconf2.71-2.71-3-any.pkg.tar.zst -> msys2-autoconf2.71-2.71-3-any.pkg.tar.zst...
-- Using cached msys2-automake1.16-1.16.5-1-any.pkg.tar.zst.
-- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libintl-0.22.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-zlib-1.3-1-x86_64.pkg.tar.zst.
-- Downloading https://mirror.msys2.org/msys/x86_64/tar-1.35-2-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/tar-1.35-2-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/tar-1.35-2-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/tar-1.35-2-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/tar-1.35-2-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/tar-1.35-2-x86_64.pkg.tar.zst -> msys2-tar-1.35-2-x86_64.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/findutils-4.9.0-3-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/findutils-4.9.0-3-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/findutils-4.9.0-3-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/findutils-4.9.0-3-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/findutils-4.9.0-3-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/findutils-4.9.0-3-x86_64.pkg.tar.zst -> msys2-findutils-4.9.0-3-x86_64.pkg.tar.zst...
-- Using cached msys2-gmp-6.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gcc-libs-13.2.0-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst.
-- Using cached msys2-liblzma-5.4.5-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libzstd-1.5.5-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libreadline-8.2.007-1-x86_64.pkg.tar.zst.
-- Using cached msys2-mpfr-4.2.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libpcre-8.45-4-x86_64.pkg.tar.zst.
-- Downloading https://mirror.msys2.org/msys/x86_64/m4-1.4.19-2-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/m4-1.4.19-2-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/m4-1.4.19-2-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/m4-1.4.19-2-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/m4-1.4.19-2-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/m4-1.4.19-2-x86_64.pkg.tar.zst -> msys2-m4-1.4.19-2-x86_64.pkg.tar.zst...
-- Using cached msys2-perl-5.36.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-ncurses-6.4-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libxcrypt-4.4.36-1-x86_64.pkg.tar.zst.

@BillyONeal
Copy link
Member

What I find irritating is that many CI runs (incl. PR CI) don't take some msys2 packages from asset cache.

Asset cache hits don't print special output. When you see "using cached" that means "it was already downloaded and we didn't even attempt to use the asset cache".

@BillyONeal
Copy link
Member

I'n not aware of particular problems.

OK, don't loose sleep over it :)

@Neumann-A
Copy link
Contributor

Maybe vcpkg should print better metrics. E.g. extract download time and time required for post build checks. This way the real portfile execution time can be better evaluated.

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 9, 2023

Maybe vcpkg should print better metrics. E.g. extract download time and time required for post build checks. This way the real portfile execution time can be better evaluated.

At least the raw CI logs have timestamps (as shown by @BillyONeal). The slowdown is already visible in the configure step (3 min -> 13 min per config) which is not parallel. libunistring is really heavy in invoking subshells and tools, at all stages.

@BillyONeal
Copy link
Member

libunistring is really heavy in invoking subshells and tools, at all stages.

To be clear, we're seeing this behavior all over the place, not just libunistring. (It was just an extreme example) And the subshells and stuff are why I thought this PR might be related. But like I said, don't lose sleep over it; my poking this PR was a shot in the dark

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 11, 2023

To be clear, we're seeing this behavior all over the place, not just libunistring. ... , don't lose sleep over it

I know that well. And I sleep very well, given that there is a clear indication that there was one regular build with the PR merged. Given all the current msys winpthread issues, you probably also sleep better with msys updated early ;-)

@Neumann-A
Copy link
Contributor

time to build the whole msys stack within vcpkg? would also get rid of the updating issues with msys ;)

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 17, 2023

Some builds are still at normal speed.

https://dev.azure.com/vcpkg/public/_build/results?buildId=97668&view=results:
Elapsed time to handle libunistring:x64-windows: 8.9 min

https://dev.azure.com/vcpkg/public/_build/results?buildId=97657&view=results:
Elapsed time to handle libunistring:x64-uwp: 8.1 min

@MehdiChinoune
Copy link
Contributor

time to build the whole msys stack within vcpkg? would also get rid of the updating issues with msys ;)

Using pacman is better.

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 17, 2023

time to build the whole msys stack within vcpkg? would also get rid of the updating issues with msys ;)

Using pacman is better.

This discussion is entirely unrelated to the slowdown.

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 17, 2023

Comparing x64-windows for the mentioned fast x64-windows CI run with the last full CI run (slow, canceled after 2d), and filtering just "Elapsed times", there is a strong indication that all packages take more time, even those that don't use msys2 or vcpkg_fixup_pkgconfig(). Two examples:

-Elapsed time to handle poco:x64-windows: 1.3 min
+Elapsed time to handle poco:x64-windows: 2.3 min
...
-Elapsed time to handle flint:x64-windows: 1.5 min
+Elapsed time to handle flint:x64-windows: 3.8 min

@Neumann-A
Copy link
Contributor

Using pacman is better

No its not. That was worse then the current situation.

Maybe there is some (disk) performance issue with some runners.

@BillyONeal
Copy link
Member

there is a strong indication that all packages take more time

Yeah, but only the heavy msys users went up by like 6 times.

Some builds are still at normal speed.

https://dev.azure.com/vcpkg/public/_build/results?buildId=97668&view=results: Elapsed time to handle libunistring:x64-windows: 8.9 min

https://dev.azure.com/vcpkg/public/_build/results?buildId=97657&view=results: Elapsed time to handle libunistring:x64-uwp: 8.1 min

Hmmmm.... strange. I'm just going to cross my fingers and hope patch tuesday deploy helps...

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 19, 2023

Yeah, but only the heavy msys users went up by like 6 times.

And these are the users with many forks/commands/subshells.
If it were a desktop machine, I would suspect the anti-virus spending more time on each new process.

@BillyONeal
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants