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

[glib] fix x64-mingw-dynamic build #28207

Merged
merged 1 commit into from
Mar 28, 2023
Merged

[glib] fix x64-mingw-dynamic build #28207

merged 1 commit into from
Mar 28, 2023

Conversation

kvnp
Copy link
Contributor

@kvnp kvnp commented Dec 6, 2022

Building glib on x64-mingw-dynamic fails with the following error:

-- Package x64-mingw-dynamic-dbg
-- Package x64-mingw-dynamic-rel
CMake Error at ports/glib/portfile.cmake:63 (file):
  file RENAME failed to rename

    C:/Users/kevinpfeifer/Projekte/vcpkg/packages/glib_x64-mingw-dynamic/bin/glib-gettextize

  to

    C:/Users/kevinpfeifer/Projekte/vcpkg/packages/glib_x64-mingw-dynamic/tools/glib/glib-gettextize

  because: Das System kann die angegebene Datei nicht finden.



Call Stack (most recent call first):
  scripts/ports.cmake:147 (include)


error: building glib:x64-mingw-dynamic failed with: BUILD_FAILED
error: 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+glib
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[glib]+Build+error
Include '[glib] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
    vcpkg-scripts version: d7c68eea3 2022-12-05 (15 hours ago)

gcc -v

Using built-in specs.
COLLECT_GCC=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/r/winlibs64-11.3.0ucrt/2604.gcc/inst_gcc-12.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp --disable-rpath --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --enable-libstdcxx-time --disable-libstdcxx-pch --with-mpc=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-mpfr=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-gmp=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --with-isl=/e/Prog/winlibs64-11.3.0ucrt/custombuilt --enable-libstdcxx-backtrace --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/r/winlibs64-11.3.0ucrt/2604.gcc/gcc-12.2.0/build_mingw/mingw-w64 CFLAGS='-I/e/Prog/winlibs64-11.3.0ucrt/custombuilt/include/libdl-win32 -D__USE_MINGW_ACCESS' CXXFLAGS=-D__USE_MINGW_ACCESS LDFLAGS='-Wl,--disable-nxcompat -Wl,--disable-high-entropy-va -Wl,--disable-dynamicbase'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders)

The portfile currently assumes that the executable glib-gettextize is built when using mingw which is not the case. Removing it from the loop for all windows builds fixes it.

Describe the pull request

  • What does your PR fix?

    Fixes #...

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    <all / linux, windows, ...>, <Yes/No>

  • Does your PR follow the maintainer guide?

    Your answer

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    <Yes / I am still working on this PR>

If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

@kvnp kvnp changed the title Fix glib on x64-mingw-dynamic [glib] fix x64-mingw-dynamic build Dec 6, 2022
@JonLiu1993 JonLiu1993 added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Dec 7, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

error: checked-in files for glib have changed but the version was not updated
version: 2.74.1
old SHA: 62e6236281de8dd6bd983d4d51721374e5559c7c
new SHA: f6af7ed0f1f18ed22bd9a982039e33a5d918f009
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***

@JonLiu1993
Copy link
Member

@kvnp, thanks for your PR, please add "port-version": 1, into the vcpkg.json file.

ports/glib/portfile.cmake Outdated Show resolved Hide resolved
@kvnp
Copy link
Contributor Author

kvnp commented Dec 7, 2022

@microsoft-github-policy-service agree

@kvnp kvnp requested a review from dg0yt December 7, 2022 15:27
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout d7c68eea3888e285e4e51b028c13efa1c5229029 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index d9029e1..5e5272d 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2657,8 +2657,8 @@
       "port-version": 0
     },
     "glib": {
-      "baseline": "2.74.1",
-      "port-version": 0
+      "baseline": "2.74.2",
+      "port-version": 1
     },
     "glibmm": {
       "baseline": "2.74.0",
@@ -7228,7 +7228,7 @@
       "baseline": "0.9.3",
       "port-version": 0
     },
-    "sse2neon" : {
+    "sse2neon": {
       "baseline": "1.5.1",
       "port-version": 0
     },
diff --git a/versions/g-/glib.json b/versions/g-/glib.json
index 5b1601f..36f51a7 100644
--- a/versions/g-/glib.json
+++ b/versions/g-/glib.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "525b96454cdefe2f4f9bf5f8fcfffb5140ddc70c",
+      "version": "2.74.2",
+      "port-version": 1
+    },
     {
       "git-tree": "62e6236281de8dd6bd983d4d51721374e5559c7c",
       "version": "2.74.1",

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we don't need anything from msys for building this port and could just patch the condition in tools/meson.build (if have_sh -> if true).
OTOH the msys packages are already needed to build dependency gettext, so it is acceptable for me to avoid the patch.

ports/glib/portfile.cmake Show resolved Hide resolved
@kvnp kvnp force-pushed the patch-1 branch 2 times, most recently from cb27497 to 135a5b8 Compare December 8, 2022 11:08
@kvnp kvnp requested a review from dg0yt December 8, 2022 13:34
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 30a20e8f15ff26eec665205dea52f4ffc6f0814b -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 8ca99b6..7d948c0 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2658,7 +2658,7 @@
     },
     "glib": {
       "baseline": "2.74.1",
-      "port-version": 0
+      "port-version": 1
     },
     "glibmm": {
       "baseline": "2.74.0",
diff --git a/versions/g-/glib.json b/versions/g-/glib.json
index 5b1601f..6a49a2e 100644
--- a/versions/g-/glib.json
+++ b/versions/g-/glib.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "88e0fcaecf90be537bfb5fba27a7c66dedc26101",
+      "version": "2.74.1",
+      "port-version": 1
+    },
     {
       "git-tree": "62e6236281de8dd6bd983d4d51721374e5559c7c",
       "version": "2.74.1",

@JonLiu1993
Copy link
Member

Please run command "./vcpkg x-add-version glib --overwrite-version" and commit again.

@dg0yt
Copy link
Contributor

dg0yt commented Dec 9, 2022

So now I have the solution I was looking for:

diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake
index 4c7d6d406..ba4f4c288 100644
--- a/ports/glib/portfile.cmake
+++ b/ports/glib/portfile.cmake
@@ -34,8 +34,17 @@ if(VCPKG_TARGET_IS_WINDOWS)
     list(APPEND OPTIONS -Diconv=external)
 endif()

+vcpkg_list(SET ADDITIONAL_BINARIES)
+if(VCPKG_HOST_IS_WINDOWS)
+    # Presence of bash and sh enables installation of auxiliary components.
+    vcpkg_list(APPEND ADDITIONAL_BINARIES "bash = ['${CMAKE_COMMAND}', '-E', 'false']")
+    vcpkg_list(APPEND ADDITIONAL_BINARIES "sh = ['${CMAKE_COMMAND}', '-E', 'false']")
+endif()
+
 vcpkg_configure_meson(
     SOURCE_PATH "${SOURCE_PATH}"
+    ADDITIONAL_BINARIES
+        ${ADDITIONAL_BINARIES}
     OPTIONS
         ${OPTIONS}
         -Dgtk_doc=false

@kvnp
Copy link
Contributor Author

kvnp commented Dec 15, 2022

So now I have the solution I was looking for:

That's an interesting feature of CMake I didn't know existed!

@JonLiu1993
Copy link
Member

@kvnp, please fix the conflict files.

@dg0yt
Copy link
Contributor

dg0yt commented Dec 15, 2022

@kvnp There was a glib update so you have to merge master, or rebase on top of it.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

error: checked-in files for glib have changed but the version was not updated
version: 2.75.0#1
old SHA: 1091ca68702ae57c419fe13fd87ec3a5c8ee0a2a
new SHA: 1797b3e9ec1e29b18f0ba26306e5220e3c7a05bf
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***

github-actions[bot]
github-actions bot previously approved these changes Dec 20, 2022
@JonLiu1993
Copy link
Member

This is error log, please take a look:

FAILED: gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o 
/Library/Developer/CommandLineTools/usr/bin/cc -Igio/kqueue/libkqueue.a.p -Igio/kqueue -I../src/glib-2-802473e24b.clean/gio/kqueue -I. -I../src/glib-2-802473e24b.clean -Iglib -I../src/glib-2-802473e24b.clean/glib -Igmodule -I../src/glib-2-802473e24b.clean/gmodule -Igio -Igobject -I/Users/vagrant/Data/installed/x64-osx/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O0 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wunused -Wno-unused-parameter -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int -fPIC -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -O3 -DNDEBUG '-DG_LOG_DOMAIN="GLib-GIO"' '-DGIO_LAUNCH_DESKTOP="/Users/vagrant/Data/packages/glib_x64-osx/libexec/gio-launch-desktop"' '-DGIO_MODULE_DIR="/Users/vagrant/Data/packages/glib_x64-osx/lib/gio/modules"' '-DLOCALSTATEDIR="/Users/vagrant/Data/packages/glib_x64-osx/var"' -DGIO_COMPILATION -MD -MQ gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o -MF gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o.d -o gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o -c ../src/glib-2-802473e24b.clean/gio/kqueue/gkqueuefilemonitor.c
In file included from ../src/glib-2-802473e24b.clean/gio/kqueue/gkqueuefilemonitor.c:37:
In file included from ../src/glib-2-802473e24b.clean/gio/gfilemonitor.h:30:
In file included from ../src/glib-2-802473e24b.clean/gio/giotypes.h:30:
../src/glib-2-802473e24b.clean/gio/gioenums.h:31:10: fatal error: 'gio/gio-visibility.h' file not found
#include <gio/gio-visibility.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@JonLiu1993
Copy link
Member

Pinging @kvnp for response. Is work still being done for this PR?

@kvnp
Copy link
Contributor Author

kvnp commented Mar 1, 2023

This is error log, please take a look:

FAILED: gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o 
/Library/Developer/CommandLineTools/usr/bin/cc -Igio/kqueue/libkqueue.a.p -Igio/kqueue -I../src/glib-2-802473e24b.clean/gio/kqueue -I. -I../src/glib-2-802473e24b.clean -Iglib -I../src/glib-2-802473e24b.clean/glib -Igmodule -I../src/glib-2-802473e24b.clean/gmodule -Igio -Igobject -I/Users/vagrant/Data/installed/x64-osx/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O0 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wunused -Wno-unused-parameter -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int -fPIC -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -O3 -DNDEBUG '-DG_LOG_DOMAIN="GLib-GIO"' '-DGIO_LAUNCH_DESKTOP="/Users/vagrant/Data/packages/glib_x64-osx/libexec/gio-launch-desktop"' '-DGIO_MODULE_DIR="/Users/vagrant/Data/packages/glib_x64-osx/lib/gio/modules"' '-DLOCALSTATEDIR="/Users/vagrant/Data/packages/glib_x64-osx/var"' -DGIO_COMPILATION -MD -MQ gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o -MF gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o.d -o gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o -c ../src/glib-2-802473e24b.clean/gio/kqueue/gkqueuefilemonitor.c
In file included from ../src/glib-2-802473e24b.clean/gio/kqueue/gkqueuefilemonitor.c:37:
In file included from ../src/glib-2-802473e24b.clean/gio/gfilemonitor.h:30:
In file included from ../src/glib-2-802473e24b.clean/gio/giotypes.h:30:
../src/glib-2-802473e24b.clean/gio/gioenums.h:31:10: fatal error: 'gio/gio-visibility.h' file not found
#include <gio/gio-visibility.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

This error shouldn't have occurred since this PR has no effect on Unix based environments. I would suggest to rerun the pipeline. Unfortunately, I don't have an OSX machine for further troubleshooting.

@JonLiu1993
Copy link
Member

This is error log, please take a look:

FAILED: gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o 
/Library/Developer/CommandLineTools/usr/bin/cc -Igio/kqueue/libkqueue.a.p -Igio/kqueue -I../src/glib-2-802473e24b.clean/gio/kqueue -I. -I../src/glib-2-802473e24b.clean -Iglib -I../src/glib-2-802473e24b.clean/glib -Igmodule -I../src/glib-2-802473e24b.clean/gmodule -Igio -Igobject -I/Users/vagrant/Data/installed/x64-osx/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O0 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wunused -Wno-unused-parameter -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int -fPIC -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -O3 -DNDEBUG '-DG_LOG_DOMAIN="GLib-GIO"' '-DGIO_LAUNCH_DESKTOP="/Users/vagrant/Data/packages/glib_x64-osx/libexec/gio-launch-desktop"' '-DGIO_MODULE_DIR="/Users/vagrant/Data/packages/glib_x64-osx/lib/gio/modules"' '-DLOCALSTATEDIR="/Users/vagrant/Data/packages/glib_x64-osx/var"' -DGIO_COMPILATION -MD -MQ gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o -MF gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o.d -o gio/kqueue/libkqueue.a.p/gkqueuefilemonitor.c.o -c ../src/glib-2-802473e24b.clean/gio/kqueue/gkqueuefilemonitor.c
In file included from ../src/glib-2-802473e24b.clean/gio/kqueue/gkqueuefilemonitor.c:37:
In file included from ../src/glib-2-802473e24b.clean/gio/gfilemonitor.h:30:
In file included from ../src/glib-2-802473e24b.clean/gio/giotypes.h:30:
../src/glib-2-802473e24b.clean/gio/gioenums.h:31:10: fatal error: 'gio/gio-visibility.h' file not found
#include <gio/gio-visibility.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

This error shouldn't have occurred since this PR has no effect on Unix based environments. I would suggest to rerun the pipeline. Unfortunately, I don't have an OSX machine for further troubleshooting.

You can send your modification plan. I will test it locally and provide you with feedback results. I have OSX machines.

@JonLiu1993
Copy link
Member

Pinging @kvnp for response. Is work still being done for this PR?

@kvnp
Copy link
Contributor Author

kvnp commented Mar 13, 2023

You can send your modification plan. I will test it locally and provide you with feedback results. I have OSX machines.

Does glib still build on OSX without the change in this PR?

@kvnp
Copy link
Contributor Author

kvnp commented Mar 13, 2023

Pushed some experimental commits just to rule out that setting additional binaries is the cause for the build failure on OSX. I hope it works this time.

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x64-windows error:

.\src\glib-2-8ca74e7d19.clean\meson.build:1:0: ERROR: Unknown options: "iconv"

versions/g-/glib.json Outdated Show resolved Hide resolved
@kvnp kvnp force-pushed the patch-1 branch 3 times, most recently from b7aefb8 to 9146de7 Compare March 27, 2023 22:59
@JonLiu1993
Copy link
Member

@kvnp, Please run command ./vcpkg x-add-version glib --overwrite-version and commit again.

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Mar 28, 2023
@vicroms vicroms merged commit d13e3a0 into microsoft:master Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants