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 wx-config --libs output #18580

Closed

Conversation

JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Jun 22, 2021

Fix command ./wx-config --libs output, add -l to the system library.
From:

-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

to:

-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 -lwx_gtk3u_core-3.1 -llibpng.a> -llibpng16d.a> -llibtiff.a> -llibtiffd.a> -lliblzma.a> -lliblzmad.a> -llibjpeg.a -lm -lwx_baseu-3.1 -llibexpat.a> -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -llibSM.so -llibICE.so -llibX11.so -llibXext.so -llibXtst.so -llibz.a -lwxregexu-3.1 -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -llibc.so -l-pthread -ldl-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 -lwx_gtk3u_core-3.1 -llibpng.a> -llibpng16d.a> -llibtiff.a> -llibtiffd.a> -lliblzma.a> -lliblzmad.a> -llibjpeg.a -lm -lwx_baseu-3.1 -llibexpat.a> -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -llibSM.so -llibICE.so -llibX11.so -llibXext.so -llibXtst.so -llibz.a -lwxregexu-3.1 -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -llibc.so -pthread -ldl

Fixes #18298.

Depends on #17111.

Waiting for the upstream approval in wxWidgets/wxWidgets#2402.

@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. depends:upstream-changes Waiting on a change to the upstream project labels Jun 22, 2021
@JackBoosY JackBoosY marked this pull request as draft June 22, 2021 06:41
@talregev
Copy link
Contributor

talregev commented Jun 22, 2021

@JackBoosY There is improvement!!!
also we need to ignore all .so file.
For .a file, we should remove the lib prefix and .a suffix and add -l flags

Also how wxwidgets do it without your fix? How their wx-config work when compile from source?
I think vcpkg add a system lib for this variable that it shouldn't

/usr/bin/ld: cannot find -llibpng.a
/usr/bin/ld: cannot find -llibexpat.a
/usr/bin/ld: cannot find -llibSM.so
/usr/bin/ld: cannot find -llibICE.so
/usr/bin/ld: cannot find -llibX11.so
/usr/bin/ld: cannot find -llibXext.so
/usr/bin/ld: cannot find -llibXtst.so
/usr/bin/ld: cannot find -llibz.a
/usr/bin/ld: cannot find -llibc.so

@JackBoosY
Copy link
Contributor Author

@talregev Please check again:

-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 -lwx_gtk3u_core-3.1 -llibpng.a> -llibpng16d.a> -llibtiff.a> -llibtiffd.a> -lliblzma.a> -lliblzmad.a> -llibjpeg.a -lm -lwx_baseu-3.1 -llibexpat.a> -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -llibSM.so -llibICE.so -llibX11.so -llibXext.so -llibXtst.so -llibz.a -lwxregexu-3.1 -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -llibc.so -pthread -ldl

@talregev
Copy link
Contributor

@talregev Please check again:

-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 -lwx_gtk3u_core-3.1 -llibpng.a> -llibpng16d.a> -llibtiff.a> -llibtiffd.a> -lliblzma.a> -lliblzmad.a> -llibjpeg.a -lm -lwx_baseu-3.1 -llibexpat.a> -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -llibSM.so -llibICE.so -llibX11.so -llibXext.so -llibXtst.so -llibz.a -lwxregexu-3.1 -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -llibc.so -pthread -ldl

@JackBoosY
This is the new output? If yes there is still same errors.

@talregev
Copy link
Contributor

You can learn how the flags should be as how we compile wxwidgets
I am upload the logs here too:
wxwidgets.zip

Also past here how we use ld flags when compile wxwidgets.
[794/795] : && /usr/bin/c++ -fPIC -g -rdynamic -pthread utils/CMakeFiles/wxrc.dir/__/__/__/utils/wxrc/wxrc.cpp.o -o lib/wxrc lib/libwx_baseu_xml-3.1.a lib/libwx_baseu-3.1.a /home/tal/boinc/3rdParty/linux/vcpkg/installed/x64-linux/debug/lib/libz.a lib/libwxregexu-3.1.a -lc -pthread -ldl -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXtst.so /home/tal/boinc/3rdParty/linux/vcpkg/installed/x64-linux/debug/lib/libexpat.a && :

@talregev
Copy link
Contributor

@JackBoosY Same errors after your change

/usr/bin/ld: cannot find -llibpng.a
/usr/bin/ld: cannot find -llibexpat.a
/usr/bin/ld: cannot find -llibSM.so
/usr/bin/ld: cannot find -llibICE.so
/usr/bin/ld: cannot find -llibX11.so
/usr/bin/ld: cannot find -llibXext.so
/usr/bin/ld: cannot find -llibXtst.so
/usr/bin/ld: cannot find -llibz.a
/usr/bin/ld: cannot find -llibc.so

+ # Do nothing
+ else()
+ string(REGEX MATCH "^lib(.*).a$" CURR_STATIC_NAME ${dep_name})
+ string(REGEX MATCH "^lib(.*).so$" CURR_DYNAMIC_NAME ${dep_name})
Copy link
Contributor

Choose a reason for hiding this comment

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

  • This stores the whole match (i.e. libz.a) in CURR_<...>_NAME. You will need to use CMAKE_MATCH_1 to get the "namespec" (i.e. z).
  • This seems to ignore osx (.dylib).

ports/wxwidgets/fix-wxconfig-libs-output.patch Outdated Show resolved Hide resolved
@talregev
Copy link
Contributor

@JackBoosY
Can you fix command ./wx-config --libs
From:

-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

to:

-L/home/usr/work/17111/vcpkg/installed/x64-linux/lib/ -L/usr/lib/x86_64-linux-gnu/ -pthread 
libwx_gtk3u_xrc-3.1.a libwx_gtk3u_qa-3.1.a libwx_baseu_net-3.1.a libwx_gtk3u_html-3.1.a libwx_gtk3u_core-3.1.a libwx_baseu_xml-3.1.a 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

@talregev
Copy link
Contributor

talregev commented Jun 23, 2021

@JackBoosY
Why you need to change and approve upstream?
Can you make a patch without involving them?
Can we talk on discord?
I am at vcpkg channel

@dg0yt
Copy link
Contributor

dg0yt commented Jun 23, 2021

I cannot deal with this today, but might come back to this soon.

  • I have a patch to resolve my Linux build issue.
  • wx-config --libs still has multiple issues:
    • absolute paths pointing to packages
    • trailing > such as -llibwebp.a>
    • incorrect namespecs such as -llibc.so
  • There needs to be another wc-config in tools/wxwidgets/debug/bin

@JackBoosY JackBoosY closed this Jun 23, 2021
@JackBoosY JackBoosY reopened this Jun 23, 2021
@JackBoosY
Copy link
Contributor Author

JackBoosY commented Jun 23, 2021

@JackBoosY
Why you need to change and approve upstream?
Can you make a patch without involving them?
Can we talk on discord?
I am at vcpkg channel

Since it's a upstream bug, so we should wait for the upstream approval the changes.
Can you go to the vcpkg channel on slack?

@talregev
Copy link
Contributor

Can you go to the vcpkg channel on slack?

Can you send me the link?

@JackBoosY
Copy link
Contributor Author

Can you go to the vcpkg channel on slack?

Can you send me the link?

See #9184

@JackBoosY
Copy link
Contributor Author

JackBoosY commented Jun 23, 2021

Current 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 /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXtst.so -lwx_gtk3u_core-3.1 /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXtst.so /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libjpeg.a /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libpng.a /home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libpng16d.a /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libtiff.a /home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libtiffd.a /home/usr/work/17111/vcpkg/installed/x64-linux/lib/liblzma.a /home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/liblzmad.a /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libjpeg.a /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a -lm /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXtst.so -lwx_baseu-3.1 /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libexpat.a /home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libexpat.a -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXtst.so /home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a -lwxregexu-3.1 -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 /usr/lib/x86_64-linux-gnu/libc.so -pthread -ldl

The abs path should be handled by portfile.cmake.

@JackBoosY
Copy link
Contributor Author

JackBoosY commented Jun 23, 2021

Okay, I already create an upstream PR wxWidgets/wxWidgets#2402, let's wait for the official response.

@talregev
Copy link
Contributor

talregev commented Jun 23, 2021

@JackBoosY
I check in the test branch and it give me this error:

stdwx.h:49:10: fatal error: wx/wx.h: No such file or directory
   49 | #include <wx/wx.h>
      |          ^~~~~~~~~

I think it connect to this PR #17111

@talregev
Copy link
Contributor

talregev commented Jun 23, 2021

I check only this PR. There was a progress!
My ci give me new error:
/usr/bin/ld: /home/runner/work/boinc/boinc/3rdParty/linux/vcpkg/packages/wxwidgets_x64-linux/lib/libwx_gtk3u_core-3.1.a(utilsx11.cpp.o): undefined reference to symbol 'XGetWindowAttributes'

Stackoverflow solution:
https://stackoverflow.com/questions/44634459/fglut-libfglut-afreeglut-state-o-undefined-reference-to-symbol-xgetwindowatt

I think we should focus on this PR only, then this PR #17111, then the combination of both.

@talregev
Copy link
Contributor

talregev commented Jun 23, 2021

@JackBoosY I re-arrange your current output with multi line for the flags to spot the problem:

-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 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so 
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
-lwx_gtk3u_core-3.1 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so 
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libjpeg.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libpng.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libpng16d.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libtiff.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libtiffd.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/liblzma.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/liblzmad.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libjpeg.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a 
-lm 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
-lwx_baseu-3.1 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libexpat.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libexpat.a 
-lgtk-3 
-lgdk-3 
-lpangocairo-1.0 
-lpango-1.0 
-latk-1.0 
-lcairo-gobject 
-lcairo 
-lgdk_pixbuf-2.0 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so 
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a 
-lwxregexu-3.1 
-lsecret-1 
-lgio-2.0 
-lgobject-2.0 
-lglib-2.0 
/usr/lib/x86_64-linux-gnu/libc.so 
-pthread 
-ldl

I think it missing the -lX11 after libwx_gtk3u_core-3.1.a
Also because it a release tool, we shouldn't allow debug lib in the flags.

for example:

/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libpng16d.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libtiffd.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libexpat.a 

@JackBoosY
Copy link
Contributor Author

@JackBoosY I re-arrange your current output with multi line for the flags to spot the problem:

-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 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so 
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
-lwx_gtk3u_core-3.1 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so 
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libjpeg.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libpng.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libpng16d.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libtiff.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libtiffd.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/liblzma.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/liblzmad.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libjpeg.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a 
-lm 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
-lwx_baseu-3.1 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libexpat.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libexpat.a 
-lgtk-3 
-lgdk-3 
-lpangocairo-1.0 
-lpango-1.0 
-latk-1.0 
-lcairo-gobject 
-lcairo 
-lgdk_pixbuf-2.0 
/usr/lib/x86_64-linux-gnu/libSM.so 
/usr/lib/x86_64-linux-gnu/libICE.so 
/usr/lib/x86_64-linux-gnu/libX11.so 
/usr/lib/x86_64-linux-gnu/libXext.so 
/usr/lib/x86_64-linux-gnu/libXtst.so 
/home/usr/work/17111/vcpkg/installed/x64-linux/lib/libz.a 
-lwxregexu-3.1 
-lsecret-1 
-lgio-2.0 
-lgobject-2.0 
-lglib-2.0 
/usr/lib/x86_64-linux-gnu/libc.so 
-pthread 
-ldl

I think it missing the -lX11 after libwx_gtk3u_core-3.1.a
Also because it a release tool, we shouldn't allow debug lib in the flags.

for example:

/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libpng16d.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libtiffd.a 
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libexpat.a 

This part is fixing in #17111.

@JackBoosY
Copy link
Contributor Author

for example:
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libpng16d.a
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libtiffd.a
/home/usr/work/17111/vcpkg/installed/x64-linux/debug/lib/libexpat.a

This part is a bug of string(REGEX), will be fixed in this PR.

@talregev
Copy link
Contributor

You still didn't solve the libx bug:
combine both PRs #17111 #18580
Error in my ci:

/usr/bin/ld: /home/runner/work/boinc/boinc/3rdParty/linux/vcpkg/installed/x64-linux/tools/wxwidgets/../../lib/libwx_gtk3u_core-3.1.a(utilsx11.cpp.o): undefined reference to symbol 'XGetWindowAttributes'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libX11.so: error adding symbols: DSO missing from command line

@dg0yt
Copy link
Contributor

dg0yt commented Jun 26, 2021

  • I have a patch to resolve my Linux build issue.

Actually I just disable this Cotire/PCH thing now by adding -DwxBUILD_PRECOMP=OFF to OPTIONS.
(It looks like it was only activated after some test. This might explain why it doesn't happen on all linux machines.)

@talregev
Copy link
Contributor

@dg0yt Do you want to add this patch to this PR?
What problem that it solve?

@playgithub
Copy link
Contributor

playgithub commented Jun 30, 2021

For Multiple Configuration Generators, e.g. Visual Studio / xcode, CMAKE_BUILD_TYPE is ignored.
In book "Professional Cmake" by Crage Scott (chapter 13):

Rather than referring to CMAKE_BUILD_TYPE in the CMakeLists.txt file, projects should instead use other more robust alternative techniques, such as generator expressions based on $<CONFIG:…>.

BTW, this is for modern cmake, i.e. a higher version of cmake.
For wxWidgets, cmake_minimum_required(VERSION 2.8.12), the guide might be not true.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 1, 2021

@playgithub The patching is for building in vcpkg. AFAIK vcpkg doesn't use Multiple Configuration Generators at the moment.
Note that the output variables here are just substituted at configuration time, not consumed in a way which already evaluates generator expressions. Upstream's original treatment is broken, resulting in libtiff.a> libtiffd.a> output from wx-config when either -ltiff or -tiffd is needed. Maybe it could be patched in a different way, using file(GENERATE ...). Still it would need some treatment in the configuration step (such as transforming libtiffd.a to -ltiffd inside a generator expression) while the the final output would be created only at the generation step.

@playgithub
Copy link
Contributor

Why not patch it in vcpkg first instead of waiting for the official fix?

@JackBoosY
Copy link
Contributor Author

@playgithub That's becuase we need to wait for the upstream approval.

@talregev
Copy link
Contributor

talregev commented Jul 6, 2021

@JackBoosY People don't understand what is upstream.
And also don't understand why you wait for upstream approval.

Upstream mean wxwidgets in our case.
and @JackBoosY will explain why we wait for them.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 6, 2021

In general packaging, it is fairly clear what upstream is. It is not only used in vcpkg.
Talking to upstream helps to avoid issues with unexpeced side effects, apart from facilitating an upstream solution which eventually replaces the patch.

@JackBoosY
Copy link
Contributor Author

Since the upstream approval my changes, I can combine this PR to #17111.

@Be-ing
Copy link
Contributor

Be-ing commented Jul 16, 2021

Are you going to put this patch in vcpkg or just use the commit where your change was merged upstream as the source for the port?

@JackBoosY
Copy link
Contributor Author

@Be-ing I will merge this changes to #17111, and waiting for update to the next version then remove this patch.

@talregev
Copy link
Contributor

@JackBoosY Thanks!

@talregev
Copy link
Contributor

talregev commented Jul 25, 2021

@JackBoosY Any news? Can you merge this PR to the master?
This PR already approve by the upstream (wxwidgets). And it standalone with it own changes.
And you don't have time to finish #17111 as you already stated.
So these good changes should go to the master.

JackBoosY pushed a commit to JackBoosY/vcpkg that referenced this pull request Jul 27, 2021
@JackBoosY JackBoosY closed this Jul 27, 2021
@JackBoosY JackBoosY deleted the dev/jack/fix-wxconfig-libs branch July 27, 2021 07:54
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 depends:upstream-changes Waiting on a change to the upstream project info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wxwidgets][Linux] libs without full path in wx-config, cause linkage errors.
6 participants