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

[wxwidgets] Fix linux build #23765

Merged
merged 12 commits into from
Mar 31, 2022
Merged

Conversation

JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Mar 25, 2022

  1. Fix configure issue in Linux:
CMake Error at build/cmake/modules/cotire.cmake:2374 (file):
  Error evaluating generator expression:

    $<COMPILE_LANG_AND_ID:CUDA,NVIDIA>

  $<COMPILE_LANG_AND_ID:lang,id> may only be used with binary targets to
  specify include directories, compile definitions, and compile options.  It
  may not be used with the add_custom_command, add_custom_target, or
  file(GENERATE) commands.
Call Stack (most recent call first):
  build/cmake/modules/cotire.cmake:2996 (cotire_generate_target_script)
  build/cmake/modules/cotire.cmake:3387 (cotire_process_target_language)
  build/cmake/modules/cotire.cmake:3571 (cotire_target)
  build/cmake/functions.cmake:391 (cotire)
  build/cmake/functions.cmake:407 (wx_target_enable_precomp)
  build/cmake/lib/net/CMakeLists.txt:39 (wx_finalize_lib)

Related upstream commit: wxWidgets/wxWidgets@2f6dd5e

  1. Fix --libs output:
-L/home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib -pthread /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_gtk3u_xrc-3.1.a /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_gtk3u_qa-3.1.a /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_baseu_net-3.1.a /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_gtk3u_html-3.1.a /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_gtk3u_core-3.1.a /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_baseu_xml-3.1.a /home/usr/work/17111/vcpkg/packages/wxwidgets_x64-linux/lib/wx/config/../../../lib/libwx_baseu-3.1.a gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 glib-2.0 libSM.so libICE.so libX11.so libXext.so libXtst.so -lwx_gtk3u_core-3.1 gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 glib-2.0 libSM.so libICE.so libX11.so libXext.so libXtst.so libjpeg.a libpng.a> libpng16d.a> libz.a m libtiff.a> libtiffd.a> liblzma.a> liblzmad.a> libjpeg.a libz.a m gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 glib-2.0 libSM.so libICE.so libX11.so libXext.so libXtst.so -lwx_baseu-3.1 libexpat.a> libexpat.a> gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 glib-2.0 libSM.so libICE.so libX11.so libXext.so libXtst.so libz.a -lwxregexu-3.1 secret-1 gio-2.0 gobject-2.0 glib-2.0 libc.so -pthread dl

Related upstream commit: wxWidgets/wxWidgets@c284c88

Fixes #23758.

Note: although wxwidgets:x64-linux still set to fail, but the user can install gtk3 with other package manager, so I still prefer to fix the upstream bugs in this PR.

@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Mar 25, 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!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout a76eb002a71b6cf7bad343f5e3376dfe6bb83c5c -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 830818f..248178f 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -7470,7 +7470,7 @@
     },
     "wxwidgets": {
       "baseline": "3.1.5",
-      "port-version": 7
+      "port-version": 8
     },
     "x-plane": {
       "baseline": "3.0.3",
diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json
index c8da366..82ad580 100644
--- a/versions/w-/wxwidgets.json
+++ b/versions/w-/wxwidgets.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "6fde6fcb9c95027cfc81d026135ea82edd1f1ba1",
+      "version-semver": "3.1.5",
+      "port-version": 8
+    },
     {
       "git-tree": "9184caa631070403a5fd8c177b56907a313ad197",
       "version-semver": "3.1.5",

@JackBoosY
Copy link
Contributor Author

@dg0yt I think I can now accept using other package managers with gtk3 .
After #22201 is merged, I will make gtk switch to this port.

Do you agree with this?

@JackBoosY
Copy link
Contributor Author

cc @talregev for test this PR.

@dg0yt
Copy link
Contributor

dg0yt commented Mar 25, 2022

@dg0yt I think I can now accept using other package managers with gtk3 . After #22201 is merged, I will make gtk switch to this port.

Do you agree with this?

I won't block it.

However, testing locally on Ubuntu 18.04 fails immediately, in locating the system's GTK3 development package.
What has changed since the last tests is that CMake 3.22 picks pkgconf from vcpkg-pkgconf.
If I replace installed/x64-linux/tools/pkgconf/pkgconf with a symlink to /usr/bin/pkg-config, configuration and build succeeds.
I assume that the configuration of the pc file search path is still not sufficiently including system directories.
Related: #23010, #23322. CC @Neumann-A
And also #23429.

PS: It needs to find /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.pc.

@talregev
Copy link
Contributor

It compile for me, thank you.

tal@tal-pav15:~/vcpkg$ ./vcpkg install wxwidgets
Computing installation plan...
The following packages will be built and installed:
    wxwidgets[core]:x64-linux -> 3.1.5#8
Detecting compiler hash for triplet x64-linux...
Restored 0 packages from /home/tal/.cache/vcpkg/archives in 8.136 ms. Use --debug to see more details.
Starting package 1/1: wxwidgets:x64-linux
Building package wxwidgets[core]:x64-linux...
-- Using cached wxWidgets-wxWidgets-9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1.tar.gz.
-- Extracting source /home/tal/vcpkg/downloads/wxWidgets-wxWidgets-9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1.tar.gz
-- Applying patch disable-platform-lib-dir.patch
-- Applying patch fix-build.patch
-- Applying patch fix-linux-configure.patch
-- Using source at /home/tal/vcpkg/buildtrees/wxwidgets/src/54f4f955a1-6abc06b06c.clean
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
-- Building x64-linux-rel
-- Installing: /home/tal/vcpkg/packages/wxwidgets_x64-linux/share/wxwidgets/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: /home/tal/.cache/vcpkg/archives/ec/ecf6f348c233372573e3a046cb9b2212f43a5294b03a16d2fb113fbf956935c0.zip
Installing package wxwidgets[core]:x64-linux...
Elapsed time for package wxwidgets:x64-linux: 1.581 h

Total elapsed time: 1.583 h

The package wxwidgets provides CMake integration:

    find_package(wxWidgets REQUIRED)
    target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS})
    target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})

@talregev
Copy link
Contributor

Can you update in the top that you waiting for #22201 as a task?
Like this:

@dg0yt
Copy link
Contributor

dg0yt commented Mar 25, 2022

JackBoosY#6 is a workaround for #23765 (comment).

As usual, mixing system and vcpkg libraries could be dangerous. The gtk+-3.0.pc file will pull in stuff from the system which is also in vcpkg, such as include dirs:
-- Found GTK3: /usr/include/gtk-3.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib/x86_64-linux-gnu/dbus-1.0/include;/usr/include/gtk-3.0;/usr/include/gio-unix-2.0/;/usr/include/cairo;/usr/include/pango-1.0;/usr/include/harfbuzz;/usr/include/pango-1.0;/usr/include/atk-1.0;/usr/include/cairo;/usr/include/pixman-1;/usr/include/freetype2;/usr/include/libpng16;/usr/include/freetype2;/usr/include/libpng16;/usr/include/gdk-pixbuf-2.0;/usr/include/libpng16;/usr/include/glib-2.0;/usr/lib/x86_64-linux-gnu/glib-2.0/include

scripts/ci.baseline.txt Outdated Show resolved Hide resolved
* Use system pkg-config for linux

* Update versions
@talregev
Copy link
Contributor

talregev commented Mar 29, 2022

@JackBoosY
Can you rebase with master?
I need this PR that was merge:
microsoft/vcpkg-tool#434

@JackBoosY
Copy link
Contributor Author

@talregev Yeah, I also need consider https://github.com/JackBoosY/vcpkg/pull/3/files. Will finish this PR today.

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 773516ecf6014d89cc69b11bb54605ad4be56694 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json
index 5208008..7dcd75e 100644
--- a/versions/w-/wxwidgets.json
+++ b/versions/w-/wxwidgets.json
@@ -1,7 +1,7 @@
 {
   "versions": [
     {
-      "git-tree": "116f75bb873cacd211f67d7c4b6399a31040aba5",
+      "git-tree": "33a87baa90f6ea142f649f688081a9406ca6a3d5",
       "version-semver": "3.1.5",
       "port-version": 8
     },

@JackBoosY
Copy link
Contributor Author

I decide to only fix the wxwidgets internal code in this PR.

@JackBoosY JackBoosY marked this pull request as ready for review March 29, 2022 07:37
@talregev
Copy link
Contributor

talregev commented Mar 30, 2022

@JackBoosY Thank you for merge the master inside.
I see you roll back some of the changes.
There is issues that need to be fix:

  • tools/wxwidgets/wx-config is link to packages instead to lib
  • tools/wxwidgets/wxrc is link to packages instead to lib
  • lib/wx/config/gtk3-unicode-static-3.1 --cppflags/--cflags/--cxxflags options, the output of the include folders are linked to packages instead of include folder.

Can you fix it?

image
image

@JackBoosY
Copy link
Contributor Author

@talregev I'd like to fix that in another PR.

@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Mar 31, 2022
@dan-shaw dan-shaw merged commit c296020 into microsoft:master Mar 31, 2022
@talregev
Copy link
Contributor

@JackBoosY

@talregev I'd like to fix that in another PR.

Can you link to the PR?

@JackBoosY JackBoosY deleted the dev/jack/23758 branch April 1, 2022 02:03
@talregev
Copy link
Contributor

talregev commented Apr 6, 2022

@talregev I'd like to fix that in another PR.

@JackBoosY
Can you make a PR with these fixes?

@talregev
Copy link
Contributor

talregev commented Apr 8, 2022

@JackBoosY Thank you for merge the master inside. I see you roll back some of the changes. There is issues that need to be fix:

  • tools/wxwidgets/wx-config is link to packages instead to lib
  • tools/wxwidgets/wxrc is link to packages instead to lib
  • lib/wx/config/gtk3-unicode-static-3.1 --cppflags/--cflags/--cxxflags options, the output of the include folders are linked to packages instead of include folder.

Can you fix it?

image image

@dg0yt Can you help to fix this problem? It vcpkg problem, not upstream problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed 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.

[wxwidgets] build failure on linux
5 participants