Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 816210 - net-misc/networkmanager-1.32.10-r1: Wrong src_configure() meson argument for resolvconf support
Summary: net-misc/networkmanager-1.32.10-r1: Wrong src_configure() meson argument for ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH
Depends on: 830212
Blocks:
  Show dependency tree
 
Reported: 2021-10-04 08:35 UTC by Andrey Volkov
Modified: 2021-12-29 07:59 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
networkmanager-1.32.12.ebuild.patch (networkmanager-1.32.12.ebuild.patch,926 bytes, patch)
2021-10-22 04:28 UTC, July Tikhonov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Volkov 2021-10-04 08:35:22 UTC
resolvconf support failed for net-misc/networkmanager-1.32.10-r1

Wrong src_configure() meson argument for resolvconf support

Reproducible: Always
Comment 1 Andrey Volkov 2021-10-04 08:37:35 UTC
--- a/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild
+++ b/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild
@@ -217,7 +217,6 @@ multilib_src_configure() {
                -Difcfg_rh=false
                -Difupdown=false
 
-               $(meson_native_use_feature resolvconf)
                -Dnetconfig=disable
                -Dconfig_dns_rc_manager_default=symlink
 
@@ -277,6 +276,10 @@ multilib_src_configure() {
                emesonargs+=( -Dcrypto=gnutls )
        fi
 
+       if use resolvconf; then
+               emesonargs+=( -Dresolvconf=/sbin/resolvconf )
+       fi
+
        # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986
        if use ppp; then
                local PPPD_VER=`best_version net-dialup/ppp`
Comment 2 July Tikhonov 2021-10-10 11:54:15 UTC
I have applied the patch, but it didn't work for me. I could see the added configuration parameters in the build log, but NetworkManager after restart didn't appear to be using resolvconf (unlike previous version, networkmanager-1.32.4-r1).

Upon further investigation, I have found that besides being compiled with resolvconf support, NetworkManager also has to be instructed to use it. Specifically, 'rc-manager' option should be set to either 'auto' or 'resolvconf'.

I have found two alternative working solutions:

1) Add configuration file /etc/NetworkManager/conf.d/resolvconf.conf with contents

[main]
rc-manager=resolvconf

2) In the ebuild, in the argument 'config_dns_rc_manager_default=symlink' replace 'symlink' with 'auto' or 'resolvconf'; or, rather, remove this argument completely, because 'auto' appears to be the default default. So, unless there was a specific reason for overriding this default (previous versions of ebuild didn't touch it), I suggest changing Andrey's patch as follows:

--- a/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild
+++ b/net-misc/networkmanager/networkmanager-1.32.10-r1.ebuild
@@ -217,9 +217,7 @@
                -Difcfg_rh=false
                -Difupdown=false
 
-               $(meson_native_use_feature resolvconf)
                -Dnetconfig=disable
-               -Dconfig_dns_rc_manager_default=symlink
 
                $(meson_feature dhclient)
                -Ddhcpcanon=disable
@@ -277,6 +275,10 @@
                emesonargs+=( -Dcrypto=gnutls )
        fi
 
+       if use resolvconf; then
+               emesonargs+=( -Dresolvconf=/sbin/resolvconf )
+       fi
+
        # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986
        if use ppp; then
                local PPPD_VER=`best_version net-dialup/ppp`
Comment 3 July Tikhonov 2021-10-10 12:32:42 UTC
Also, I have noticed that the ebuild uses 'disable' for some configuration arguments and 'disabled' for others (via meson_feature function). Is it correct?

According to this code from NetworkManager-1.32.10/meson.build, for 'netconfig' option it should be neither 'disable' nor 'disabled', but just 'no':

…
foreach prog_name : ['resolvconf', 'netconfig']
  prog_path = get_option(prog_name)
  prog_enable = (prog_path != 'no')

  if prog_enable
    if prog_path == ''
      prog = find_program(prog_name,
…

With '-Dnetconfig=disable' the string 'disable' is interpreted as a path for the netconfig program. It should be '-Dnetconfig=no' instead.

I suspect that similar problem should appear with 'dhclient', 'dhcpcd', and 'dhcpcanon' family. Passing '-Ddhcpcanon=disable' or '-Ddhclient=disabled' (via meson_feature function) does not appear to be a correct way to disable features, at least not with this meson script. It should be '-Ddhcpcanon=no' and '-Ddhclient=no'. And if these features are to be enabled, the path to the corresponding program should be supplied as the value, not 'enabled'.
Comment 4 Joakim Tjernlund 2021-10-11 09:20:44 UTC
I am hoping this bug also explains why openconnect VPN misbehaves in 1.32.x
Currently only 1.30.x works properly for me.

Using elogind/resolvconf.
Comment 5 July Tikhonov 2021-10-11 14:21:25 UTC
This particular bug is present only in networkmanager-1.32.10-r1 ebuild, since it uses different build system, meson, as opposed to traditional configure script used in networkmanager-1.32.8-r1 ebuild and before. So, if networkmanager-1.32.8-r1 and networkmanager-1.32.4-r1 don't work for you, it is probably a different bug.
Comment 6 Joakim Tjernlund 2021-10-20 08:57:01 UTC
1.32.12 went into the tree with the same bug. Maybe update subject to 1.32.12 ?
Comment 7 Andrey Volkov 2021-10-20 13:06:30 UTC
The same bug with networkmanager-1.32.12.ebuild

Steps to reproduce for net-misc/networkmanager-1.32.12[resolvconf]


cat > /etc/NetworkManager/NetworkManager.conf <<EOF
[main]
dns=default
rc-manager=resolvconf
systemd-resolved=false
EOF

strace -e access -p $(< /run/NetworkManager/NetworkManager.pid) 2>&1 |grep 'resolvconf\|enabled'

nmcli con down MyEthernet1
nmcli con up MyEthernet1

Actual results:
access("enabled", X_OK) = -1 ENOENT (No such file or directory)
access("enabled", X_OK) = -1 ENOENT (No such file or directory)

Expected results:
access("/sbin/resolvconf", X_OK) = 0
access("/sbin/resolvconf", X_OK) = 0
Comment 8 David Kredba 2021-10-21 06:08:20 UTC
After I upgraded to the net-misc/networkmanager-1.32.12 I lost access to Internet, found no nameserver line present in the /etc/resolv.conf file.

Using a suggested change in the Comment 2 fixed it, used the
-Dconfig_dns_rc_manager_default=auto variant.

I am expecting much more people complaining about this.
Comment 9 July Tikhonov 2021-10-22 04:28:10 UTC
Created attachment 746082 [details, diff]
networkmanager-1.32.12.ebuild.patch

I have rewritten the patch to conform to what networkmanager's meson.build script expects of 'resolvconf' and similar options (path to the executable if the feature is enabled, 'no' if it is disabled). I had to hardcode executable paths of resolvconf, dhclient and dhcpcd in the ebuild, though.

Also, I have little idea of how this works with multilib, that is, which options should be 'native'-only and which shouldn't. In that regard, I have preserved the previous behavior.

And I didn't actually test the ebuild with USE="dhclient" or USE="dhcpcd" (except for configure stage, which looks ok).
Comment 10 Max Steel 2021-10-28 00:43:11 UTC
This bug has bothered me since 1.32.10, too. A simple symlink from /run/Networkmanager/resolv.conf /run/resolconf/interfaces/Networkmanager did fix it for me everytime. But it bothered me.

The proposed fix works for me.
Comment 11 Larry the Git Cow gentoo-dev 2021-10-28 03:22:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bba90739cd6a491fb938ed38e1462975d720f583

commit bba90739cd6a491fb938ed38e1462975d720f583
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-28 03:21:35 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-28 03:21:35 +0000

    net-misc/networkmanager: fix resolvconf logic in Meson port (unkeyworded)
    
    Thakns-to: July Tikhonov <july.tikh@gmail.com>
    Bug: https://bugs.gentoo.org/816210
    Signed-off-by: Sam James <sam@gentoo.org>

 .../networkmanager-1.32.12-r1.ebuild               | 401 +++++++++++++++++++++
 1 file changed, 401 insertions(+)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-28 03:30:12 UTC
Please test the unkeyworded 1.32.12-r1 ebuild.

It's not 100% clear to me if there's actually a few issues here (wrt dhcp*) but in any case, give this a whirl, and we can see if we need to refine the ebuild afterwards if we know this actually works.
Comment 13 Joakim Tjernlund 2021-10-28 06:56:57 UTC
Just did a ebuild configre pass to look at the output, looks good.
Noted one small item though: nmrundir: /var/run/NetworkManager
I think that should be nmrundir: /run/NetworkManager

One question too, those various paths, should they have an EPREFIX added
too them as in ${EPREFIX}/sbin/resolvconf ?
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-28 07:01:02 UTC
(In reply to Joakim Tjernlund from comment #13)
> Just did a ebuild configre pass to look at the output, looks good.
> Noted one small item though: nmrundir: /var/run/NetworkManager
> I think that should be nmrundir: /run/NetworkManager
> 

Yeah, I think so too.

> One question too, those various paths, should they have an EPREFIX added
> too them as in ${EPREFIX}/sbin/resolvconf ?

Yeah, I think they should, although I didn't want to meddle with it _yet_, this is a good point to consider before we keyword it again.
Comment 15 Andrey Volkov 2021-10-29 18:34:08 UTC
networkmanager-1.32.12-r1 works for me (resolvconf and dhcpcd enabled)
Comment 16 Marc Schiffbauer gentoo-dev 2021-11-08 10:30:06 UTC
(In reply to Andrey Volkov from comment #15)
> networkmanager-1.32.12-r1 works for me (resolvconf and dhcpcd enabled)

For me, it also made resolvconf support work again
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-12 04:51:38 UTC
Thanks both. I suppose we can keyword this shortly.
Comment 18 Larry the Git Cow gentoo-dev 2021-12-07 00:32:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e2d153f98141010ccc42acdbc6ef5d451aeb31a

commit 7e2d153f98141010ccc42acdbc6ef5d451aeb31a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-07 00:32:23 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-07 00:32:23 +0000

    net-misc/networkmanager: keyword 1.32.12-r1
    
    Closes: https://bugs.gentoo.org/816210
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/networkmanager/networkmanager-1.32.12-r1.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)