Closed tkemmer closed 3 years ago
I've hit this same issue. I think this is a meson build rule issue, because it looks like the only thing that has changed in the relevant files is that it's using meson now. Version 4.6.2 builds fine with networkmanager on and modemmanager off.
One thing I noticed was the dependencies of panel_network library. It unconditionally requires modemmanager: https://github.com/linuxmint/cinnamon-control-center/blob/13477da648f4f0771ebe4b397f9f825c0868014c/panels/network/meson.build#L28-L44
It should probably be something like this:
network_deps = [
glib,
gtk,
libnm,
libnma,
polkit_gobj,
]
if get_option('modemmanager')
network_deps += modemmanager
endif
panel_network = shared_library('network',
panel_network_sources,
include_directories: rootInclude,
link_whole: [
libconnection_editor,
],
link_with: [
libcinnamon_control_center,
],
dependencies: network_deps,
install: true,
install_dir: panels_dir
)
It still fails for me with that change though, so I must be something else going on.
@Salamandar wondering if you have any idea?
The unconditional modemmanager
dependency shouldn't be a problem because meson will ignore dependencies that are not found
.
net-device-mobile.h
is being included, which contains both NET_TYPE_DEVICE_MOBILE
and net_device_mobile_get_type
, so the define is being resolved but the GType symbol is not.
#define NET_TYPE_DEVICE_MOBILE (net_device_mobile_get_type ())
GType net_device_mobile_get_type (void);
It seems like this symbol is getting stripped out during compilation/linking or glib isn't declaring the type correctly. But this is testing the limits of my minimal C and nonexistent glib knowledge.
Oooops, the message i wrote 2 weeks ago didn't send.
Yeah, so as said @SparkyBluefang, the modemmanager
dependency isn't an issue as it's a not-found
dependency.
Also, this looks like a code issue because cc-network-panel.c
should not include net-device-mobile.h
if BUILD_MODEM
is undefined.
I'm going to push a Merge Request soon, it only adds two #ifdef BUILD_MODEM
in cc-network-panel.c
and resolves the issue. It needs more testing though.
@tkemmer Could you give a minute to test my fork ? If you're too lazy to add a remote and fetch (I would be) the diff is only 4 lines :)
@Salamandar Thanks! I can confirm that the build error is gone now but I still need to do some runtime testing, though
Issue Compilation fails for the specific combination of meson options
networkmanager=true
andmodemmanager=false
:Steps to reproduce
meson <src_folder> -Dnetworkmanager=true -Dmodemmanager=false && ninja
Expected behaviour Build success.
Other information The function in question (
net_device_mobile_get_type
) is provided bynet-devices-mobile.c
, which is only included when modemmanager is found. https://github.com/linuxmint/cinnamon-control-center/blob/13477da648f4f0771ebe4b397f9f825c0868014c/panels/network/meson.build#L23-L25However, the function is used unconditionally in https://github.com/linuxmint/cinnamon-control-center/blob/13477da648f4f0771ebe4b397f9f825c0868014c/panels/network/cc-network-panel.c#L655 leading to the error above.