elementary / monitor

Manage processes and monitor system resources.
GNU General Public License v3.0
324 stars 42 forks source link

Fails to build: undefined reference to symbol 'XextAddDisplay' #292

Closed bobby285271 closed 2 years ago

bobby285271 commented 2 years ago

Hi, I are trying to bump this package in Nixpkgs (https://github.com/NixOS/nixpkgs/issues/154578), but so far the build failed with the following:

[205/205] Linking target src/com.github.stsdc.monitor
FAILED: src/com.github.stsdc.monitor 
gcc  -o src/com.github.stsdc.monitor src/com.github.stsdc.monitor.p/meson-generated_.._.._data_gresource_icons.c.o src/com.github.stsdc.monitor.p/meson-generated_.._.._data_gresource_css.c.o src/com.github.stsdc.monitor.p/meson-generated_Monitor.c.o src/com.github.stsdc.monitor.p/meson-generated_MainWindow.c.o src/com.github.stsdc.monitor.p/meson-generated_Utils.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessInfoView_ProcessInfoView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessTreeView_CPUProcessTreeView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_PreferencesView_PreferencesView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_PreferencesView_PreferencesIndicatorPage.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_PreferencesView_PreferencesGeneralPage.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemCPUView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemCPUInfoPopover.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemMemoryView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemNetworkView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemStorageView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_SystemView_SystemGPUView.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessInfoView_Preventor.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessInfoView_ProcessInfoHeader.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessInfoView_ProcessInfoCPURAM.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessInfoView_ProcessInfoIOStats.c.o src/com.github.stsdc.monitor.p/meson-generated_Views_ProcessView_ProcessInfoView_OpenFilesListBox.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Headerbar_Headerbar.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Headerbar_Search.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Statusbar_Statusbar.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Labels_LabelVertical.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Labels_LabelRoundy.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Labels_LabelH4.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_Chart_Chart.c.o src/com.github.stsdc.monitor.p/meson-generated_Widgets_WidgetResource_WidgetResource.c.o src/com.github.stsdc.monitor.p/meson-generated_Models_TreeViewModel.c.o src/com.github.stsdc.monitor.p/meson-generated_Managers_ProcessManager.c.o src/com.github.stsdc.monitor.p/meson-generated_Managers_Process.c.o src/com.github.stsdc.monitor.p/meson-generated_Managers_ProcessStructs.c.o src/com.github.stsdc.monitor.p/meson-generated_Managers_ProcessUtils.c.o src/com.github.stsdc.monitor.p/meson-generated_Services_Shortcuts.c.o src/com.github.stsdc.monitor.p/meson-generated_Services_DBusServer.c.o src/com.github.stsdc.monitor.p/meson-generated_Services_Appearance.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Resources.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_ResourcesSerialized.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_CPU.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_CPUCache.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Core.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Memory.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Swap.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Network.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Storage_Storage.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Storage_StorageParser.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Storage_Disk.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Storage_Volume.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_GPU_IGPU.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_GPU_GPUAmd.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_GPU_GPUNvidia.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPathsParser.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_IHwmonPathsParserInterface.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPathsParserCPU.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPathsParserGPU.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPathsParserIwlwifi.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPathsParserNVMe.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonTemperature.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonVoltage.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonFrequency.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonFan.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPWM.c.o src/com.github.stsdc.monitor.p/meson-generated_Resources_Hwmon_HwmonPower.c.o src/com.github.stsdc.monitor.p/meson-generated_Conf.c.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../subprojects/live-chart/src' -Wl,-rpath-link,/build/monitor/build/subprojects/live-chart/src -Wl,--start-group subprojects/live-chart/src/liblivechart.so /nix/store/4jdb4283f81nqs35rmzcp8ssa6ki4604-granite-6.2.0/lib/libgranite.so /nix/store/vab6rsp4ac3kw6qsnd8wbskgk8pg4jfj-libgee-0.20.4/lib/libgee-0.8.so /nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib/libgtk-3.so /nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib/libgdk-3.so /nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib/libpangocairo-1.0.so /nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib/libpango-1.0.so /nix/store/g08sxarx191yh2dh0yk2j8icja54aksf-harfbuzz-3.1.2/lib/libharfbuzz.so /nix/store/s2jjq7rk5yrzlv9lyralzvpixg4p6jh3-atk-2.36.0/lib/libatk-1.0.so /nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib/libcairo-gobject.so /nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib/libcairo.so /nix/store/al95l8psvmq5di3vdwa75n8w2m0sj2sy-gdk-pixbuf-2.42.6/lib/libgdk_pixbuf-2.0.so /nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib/libgio-2.0.so /nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib/libgobject-2.0.so /nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib/libglib-2.0.so -L/nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib -L/nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib -L/nix/store/s2jjq7rk5yrzlv9lyralzvpixg4p6jh3-atk-2.36.0/lib -L/nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib -L/nix/store/al95l8psvmq5di3vdwa75n8w2m0sj2sy-gdk-pixbuf-2.42.6/lib -L/nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib -L/nix/store/g08sxarx191yh2dh0yk2j8icja54aksf-harfbuzz-3.1.2/lib -L/nix/store/4jdb4283f81nqs35rmzcp8ssa6ki4604-granite-6.2.0/lib -L/nix/store/vab6rsp4ac3kw6qsnd8wbskgk8pg4jfj-libgee-0.20.4/lib -lz -L/nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib -L/nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib -L/nix/store/s2jjq7rk5yrzlv9lyralzvpixg4p6jh3-atk-2.36.0/lib -L/nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib -L/nix/store/al95l8psvmq5di3vdwa75n8w2m0sj2sy-gdk-pixbuf-2.42.6/lib -L/nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib -L/nix/store/g08sxarx191yh2dh0yk2j8icja54aksf-harfbuzz-3.1.2/lib -lz /nix/store/may3vrrnvym5w7iw368i8zvv3b8lifza-libgtop-2.40.0/lib/libgtop-2.0.so /nix/store/lmbnvbxr6fx0vr7l57c2gc8dy5j9qz3a-libwnck-40.0/lib/libwnck-3.so -L/nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib -L/nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib -L/nix/store/s2jjq7rk5yrzlv9lyralzvpixg4p6jh3-atk-2.36.0/lib -L/nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib -L/nix/store/al95l8psvmq5di3vdwa75n8w2m0sj2sy-gdk-pixbuf-2.42.6/lib -L/nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib -L/nix/store/g08sxarx191yh2dh0yk2j8icja54aksf-harfbuzz-3.1.2/lib -L/nix/store/lmbnvbxr6fx0vr7l57c2gc8dy5j9qz3a-libwnck-40.0/lib -lz /nix/store/z6gp1gis4wlrya90j3x0gikrdj08gsqn-libhandy-1.5.0/lib/libhandy-1.so -L/nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib -L/nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib -L/nix/store/s2jjq7rk5yrzlv9lyralzvpixg4p6jh3-atk-2.36.0/lib -L/nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib -L/nix/store/al95l8psvmq5di3vdwa75n8w2m0sj2sy-gdk-pixbuf-2.42.6/lib -L/nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib -L/nix/store/g08sxarx191yh2dh0yk2j8icja54aksf-harfbuzz-3.1.2/lib -L/nix/store/z6gp1gis4wlrya90j3x0gikrdj08gsqn-libhandy-1.5.0/lib -lz -L/nix/store/lirhad3vmiwbs6jwffdpz2cgyskwgivs-glib-2.70.2/lib -L/nix/store/bl0cwvwgch92cfsnli4dsah2gxgdickp-gtk+3-3.24.30/lib -L/nix/store/296xl6s9wnv8kzy5xwy9p17aa3nf06fc-cairo-1.16.0/lib -L/nix/store/al95l8psvmq5di3vdwa75n8w2m0sj2sy-gdk-pixbuf-2.42.6/lib -L/nix/store/dzsj2n0nmq8nv6w0hvy5vb61kim3rzmd-pango-1.50.0/lib -L/nix/store/g08sxarx191yh2dh0yk2j8icja54aksf-harfbuzz-3.1.2/lib -lz /nix/store/xa302ni9xnlpjvb650af6pwx8k5h8ndm-libX11-1.7.2/lib/libX11.so /nix/store/f90fhsbcvph2xr1valyxiiairxc0q3dq-udisks-2.9.4/lib/libudisks2.so -lm -lXNVCtrl -lX11 -Wl,--end-group
/nix/store/cdm6zywd51mbabxhklsixwcskv4n70s3-binutils-2.35.2/bin/ld: /nix/store/465334j1fhcdsg8nasi84h6rd0vgh257-libXNVCtrl-495.46/lib/libXNVCtrl.a(NVCtrl.o): undefined reference to symbol 'XextAddDisplay'
/nix/store/cdm6zywd51mbabxhklsixwcskv4n70s3-binutils-2.35.2/bin/ld: /nix/store/hy2v1158f52iqrr60l3y1vd28b3b6zpp-libXext-1.3.4/lib/libXext.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

We already added libXNVCtrl, libX11 and libXext as dependency when building this.

Maybe adding a single line meson.get_compiler('c').find_library('Xext'), in meson.build can solve the issue (works for me), but I am not sure if that is the correct way, I will be appreciated if anyone can help me with this.

stsdc commented 2 years ago

Looks like this is a dependency of libXNVCtrl. I'm not familiar with NixOS package system, but maybe it needs to be added in libXNVCtrl package? Because on Fedora and elementary it compiles OK without additional deps.

bobby285271 commented 2 years ago

That is weird... I think libXext is actually already a dependency of libXNVCtrl in Nixpkgs.

davidak commented 2 years ago

I'm also able to reproduce the issue.

Adding NIX_LDFLAGS = "-lXext"; fixed it.

bobby285271 commented 2 years ago

Maybe this is downstream issue if Fedora builds fine... I will reopen this if I have new findings.

bobby285271 commented 5 months ago

(sorry for digging up this old issue) With https://github.com/NixOS/nixpkgs/commit/b57aa88291910689aeaa83ff40dd02c50ab8199b we no longer have this issue. Without surprise Fedora and Debian patches libxnvctrl in downstream the same way as well :-)

I think https://github.com/NVIDIA/nvidia-settings/pull/105 will upstream the work.

stsdc commented 5 months ago

Glad to hear :blush: