wpa-supplicant service API change leads to breakage

  • Done
  • quality assurance status badge
Details
4 participants
  • Ludovic Courtès
  • Marius Bakke
  • Mark H Weaver
  • Bruno Victal
Owner
unassigned
Submitted by
Mark H Weaver
Severity
normal
M
M
Mark H Weaver wrote on 17 Oct 2018 21:42
Attempt to build my GuixSD system now fails
(address . bug-guix@gnu.org)
87d0s8nyvi.fsf@netris.org
When I try to build my x86_64 GuixSD system, based on my system
configuration which I've not modified since May, it now fails:

Toggle snippet (38 lines)
mhw@jojen ~$ guix system build /etc/config.scm
Backtrace:
In srfi/srfi-1.scm:
592:17 19 (map1 (#<<service> type: #<service-type profile 2b09…> …))
In gnu/services.scm:
778:26 18 (loop #<<service> type: #<service-type profile 2b09d20>…>)
In srfi/srfi-1.scm:
592:17 17 (map1 (#<<service> type: #<service-type shepherd-roo…> …))
In gnu/services.scm:
778:26 16 (loop #<<service> type: #<service-type shepherd-root 2b…>)
In srfi/srfi-1.scm:
592:29 15 (map1 (#<<service> type: #<service-type file-systems…> …))
592:29 14 (map1 (#<<service> type: #<service-type root-file-sy…> …))
592:29 13 (map1 (#<<service> type: #<service-type user-process…> …))
592:29 12 (map1 (#<<service> type: #<service-type host-name 2b…> …))
592:17 11 (map1 (#<<service> type: #<service-type account 2b09…> …))
In gnu/services.scm:
778:26 10 (loop #<<service> type: #<service-type account 2b09aa0>…>)
In srfi/srfi-1.scm:
592:29 9 (map1 (#<<service> type: #<service-type guix 240fc30…> …))
592:17 8 (map1 (#<<service> type: #<service-type dbus 240f910…> …))
In gnu/services.scm:
779:26 7 (loop #<<service> type: #<service-type dbus 240f910> va…>)
In srfi/srfi-1.scm:
592:29 6 (map1 (#<<service> type: #<service-type elogind 240f…> …))
592:29 5 (map1 (#<<service> type: #<service-type polkit 240f8…> …))
592:29 4 (map1 (#<<service> type: #<service-type colord 240f1…> …))
592:29 3 (map1 (#<<service> type: #<service-type upower 240f2…> …))
592:29 2 (map1 (#<<service> type: #<service-type udisks 240f1…> …))
592:17 1 (map1 (#<<service> type: #<service-type wpa-supplica…> …))
In gnu/services/networking.scm:
1076:9 0 (config->package _)

gnu/services/networking.scm:1076:9: In procedure config->package:
Throw to key `match-error' with args `("match" "no matching pattern" #<package wpa-supplicant@2.6 gnu/packages/admin.scm:1147 3246780>)'.
mhw@jojen ~$

Here's my system configuration:

Toggle snippet (189 lines)
;; This is an operating system configuration template
;; for a "desktop" setup with GNOME and Xfce where the
;; root partition is encrypted with LUKS.

(use-modules (gnu) (gnu system nss) (srfi srfi-1) (guix packages))
(use-service-modules base desktop networking xorg dbus)
(use-package-modules certs gnome cryptsetup linux admin guile firmware xdisorg libusb suckless)

(define keymap
(plain-file
"keymap"
"keymaps 0-255
keycode 42 = Shift
keycode 54 = Shift
keycode 29 = Control
keycode 58 = Control
keycode 56 = Alt
keycode 100 = Alt
alt shift keycode 1 = Meta_Escape
alt shift keycode 2 = Meta_exclam
alt shift keycode 3 = Meta_at
alt shift keycode 4 = Meta_numbersign
alt shift keycode 5 = Meta_dollar
alt shift keycode 6 = Meta_percent
alt shift keycode 7 = Meta_asciicircum
shift control keycode 7 = Control_asciicircum
control alt keycode 7 = Meta_Control_asciicircum
shift control alt keycode 7 = Meta_Control_asciicircum
alt shift keycode 8 = Meta_ampersand
alt shift keycode 9 = Meta_asterisk
alt shift keycode 10 = Meta_parenleft
alt shift keycode 11 = Meta_parenright
alt shift keycode 12 = Meta_underscore
shift control keycode 12 = Control_underscore
control alt keycode 12 = Meta_Control_underscore
shift control alt keycode 12 = Meta_Control_underscore
alt shift keycode 13 = Meta_plus
alt shift keycode 14 = Meta_Delete
alt shift keycode 15 = Meta_Tab
alt shift keycode 16 = Meta_Q
alt shift keycode 17 = Meta_W
alt shift keycode 18 = Meta_E
alt shift keycode 19 = Meta_R
alt shift keycode 20 = Meta_T
alt shift keycode 21 = Meta_Y
alt shift keycode 22 = Meta_U
alt shift keycode 23 = Meta_I
alt shift keycode 24 = Meta_O
alt shift keycode 25 = Meta_P
alt shift keycode 26 = Meta_braceleft
control alt keycode 26 = Meta_Escape
alt shift keycode 27 = Meta_braceright
control alt keycode 27 = Meta_Control_bracketright
alt shift keycode 28 = Meta_Control_m
alt shift keycode 29 = Meta_Control
alt shift keycode 30 = Meta_A
alt shift keycode 31 = Meta_S
alt shift keycode 32 = Meta_D
alt shift keycode 33 = Meta_F
alt shift keycode 34 = Meta_G
alt shift keycode 35 = Meta_H
alt shift keycode 36 = Meta_J
alt shift keycode 37 = Meta_K
alt shift keycode 38 = Meta_L
alt shift keycode 39 = Meta_colon
alt shift keycode 40 = Meta_quotedbl
alt shift keycode 41 = Meta_asciitilde
alt shift keycode 43 = Meta_bar
control alt keycode 43 = Meta_Control_backslash
alt shift keycode 44 = Meta_Z
alt shift keycode 45 = Meta_X
alt shift keycode 46 = Meta_C
alt shift keycode 47 = Meta_V
alt shift keycode 48 = Meta_B
alt shift keycode 49 = Meta_N
alt shift keycode 50 = Meta_M
alt shift keycode 51 = Meta_less
alt shift keycode 52 = Meta_greater
alt shift keycode 53 = Meta_question
alt shift keycode 57 = Meta_space
"))

(operating-system
(host-name "jojen")
(timezone "US/Eastern")
(locale "en_US.utf8")

(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda")))

(kernel linux-libre)

;;(firmware (list ath9k-htc-firmware))
(firmware '())

;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(mapped-devices
(list (mapped-device
(source (uuid "a56c53e7-b345-4e24-a17b-6cf158dbc7d3"))
(target "jojen-root")
(type luks-device-mapping))))

(file-systems (cons* (file-system
;; FIXME: reference by the file system label?
(device "/dev/mapper/jojen-root")
(mount-point "/")
(type "btrfs")
(dependencies mapped-devices))
%base-file-systems))

(users (cons* (user-account
(name "mhw")
(uid 1000)
(group "mhw")
(supplementary-groups '("wheel" "users" "netdev"
"audio" "video" "dialout"))
(home-directory "/home/mhw"))
%base-user-accounts))

(groups (cons* (user-group
(name "mhw")
(id 1000))
%base-groups))

(setuid-programs
(list (file-append shadow "/bin/passwd")
(file-append inetutils "/bin/ping")))

;; This is where we specify system-wide packages.
(packages (cons* nss-certs ;for HTTPS access
gvfs ;for user mounts
cryptsetup
btrfs-progs
wpa-supplicant
network-manager
network-manager-applet
(delete sudo %base-packages)))

(services (cons* (console-keymap-service keymap)
;;(xfce-desktop-service)
(gnome-desktop-service)
(service network-manager-service-type
(network-manager-configuration))
(service wpa-supplicant-service-type wpa-supplicant)

;; Desktop services follow
(slim-service)
(screen-locker-service slock)
;;(screen-locker-service xlockmore "xlock")
(simple-service 'mtp udev-service-type (list libmtp))
;;(avahi-service) ; I don't trust this
;;(wicd-service) ; using NetworkManager instead
(udisks-service)
(upower-service)
(colord-service)
;;(geoclue-service) ; I don't want this
(polkit-service)
(elogind-service)
(dbus-service)
;;(ntp-service) ; I don't trust this

(modify-services (remove (lambda (svc)
(eq? (service-kind svc)
wicd-service-type))
%base-services)
;; This is for debugging
#;
(nscd-service-type config =>
(nscd-configuration
(inherit config)
(debug-level 3)
(log-file "/var/log/nscd.log")))
;; I don't trust the build farm
(guix-service-type config =>
(guix-configuration
(inherit config)
(use-substitutes? #f)
(authorized-keys '())
(substitute-urls '())
(extra-options '("--gc-keep-derivations=yes"
"--gc-keep-outputs=yes")))))))

;; Allow resolution of '.local' host names with mDNS.
;;(name-service-switch %mdns-host-lookup-nss) ; disabled for now
)

Mark
M
M
Mark H Weaver wrote on 17 Oct 2018 21:51
(address . 33078@debbugs.gnu.org)
878t2wnygg.fsf@netris.org
Mark H Weaver <mhw@netris.org> writes:
Toggle quote (3 lines)
> When I try to build my x86_64 GuixSD system, based on my system
> configuration which I've not modified since May, it now fails:

Reverting commit acce0a474c1493ab18912bc46285248e4ccb0314 (services:
wpa-supplicant: Extend to support configuration parameters) seems to fix
the issue for me. I guess my system configuration needs to be updated
to adapt to it, but it's not obvious what I need to do.

Mark
M
M
Marius Bakke wrote on 17 Oct 2018 22:50
87woqgfgb8.fsf@fastmail.com
Mark H Weaver <mhw@netris.org> writes:

Toggle quote (3 lines)
> When I try to build my x86_64 GuixSD system, based on my system
> configuration which I've not modified since May, it now fails:

[...]

Toggle quote (6 lines)
> In gnu/services/networking.scm:
> 1076:9 0 (config->package _)
>
> gnu/services/networking.scm:1076:9: In procedure config->package:
> Throw to key `match-error' with args `("match" "no matching pattern" #<package wpa-supplicant@2.6 gnu/packages/admin.scm:1147 3246780>)'.

Whoops, sorry for this breakage!

Toggle quote (2 lines)
> Here's my system configuration:

[...]

Toggle quote (7 lines)
> (services (cons* (console-keymap-service keymap)
> ;;(xfce-desktop-service)
> (gnome-desktop-service)
> (service network-manager-service-type
> (network-manager-configuration))
> (service wpa-supplicant-service-type wpa-supplicant)

To adapt to the new interface, this should be changed to:

(service wpa-supplicant-service-type)

...though it would be good to have backwards compatibility here. WDYT
of this approach?
1 file changed, 15 insertions(+), 12 deletions(-)
gnu/services/networking.scm | 27 +++++++++++++++------------

modified gnu/services/networking.scm
@@ -1072,19 +1072,22 @@ networking."))))
(stop #~(make-kill-destructor)))))))
(define wpa-supplicant-service-type
- (let ((config->package
- (match-lambda
- (($ <wpa-supplicant-configuration> wpa-supplicant)
- (list wpa-supplicant)))))
- (service-type (name 'wpa-supplicant)
- (extensions
- (list (service-extension shepherd-root-service-type
- wpa-supplicant-shepherd-service)
- (service-extension dbus-root-service-type config->package)
- (service-extension profile-service-type config->package)))
- (description "Run the WPA Supplicant daemon, a service that
+ (lambda* (#:optional wpa-supplicant-package) ;deprecated
+ (let ((package
+ (if wpa-supplicant-package
+ wpa-supplicant-package
+ (match-lambda
+ (($ <wpa-supplicant-configuration> wpa-supplicant)
+ (list wpa-supplicant))))))
+ (service-type (name 'wpa-supplicant)
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ wpa-supplicant-shepherd-service)
+ (service-extension dbus-root-service-type package)
+ (service-extension profile-service-type package)))
+ (description "Run the WPA Supplicant daemon, a service that
implements authentication, key negotiation and more for wireless networks.")
- (default-value (wpa-supplicant-configuration)))))
+ (default-value (wpa-supplicant-configuration))))))
;;;

[back]
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlvHoKwACgkQoqBt8qM6
VPoLdAf+M+sdstBasq+5qtWLjbYrNZM5TrG5dPfS5L+CUazt3+8GlqQqwg4qbbLP
vqyNd/J4onf4TJhJ8v0Q88HRTenLsCLWAa6BuVe8tqmYqcvKoQp3ciXPSYAtcEp4
mzvAAAgaKss6Jj9sLeiIOE1gtL+D9N3WYDV86QmGBK6TKgaMLzyR0Kh0WBjs6JUt
WUHsebGAtRkpbzwBrgCC4B1w/Ex261cTRIJ5fS3+vaZpT2ZjpTzfJuvQlEs/IiCN
5GtNSP9UySDDDiNu+V+PCkZLZxVD3N0V2GIX+vR7dLdlLacnziKuVlexqOHBvw+c
Hpkk9LsFuL6D0F2qIKMwfq8Nccazsw==
=LOKW
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 17 Oct 2018 23:49
87tvlkfdl1.fsf@fastmail.com
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (16 lines)
> Mark H Weaver <mhw@netris.org> writes:
>
>> (services (cons* (console-keymap-service keymap)
>> ;;(xfce-desktop-service)
>> (gnome-desktop-service)
>> (service network-manager-service-type
>> (network-manager-configuration))
>> (service wpa-supplicant-service-type wpa-supplicant)
>
> To adapt to the new interface, this should be changed to:
>
> (service wpa-supplicant-service-type)
>
> ...though it would be good to have backwards compatibility here. WDYT
> of this approach?

[...]
Toggle quote (20 lines)
> (define wpa-supplicant-service-type
> - (let ((config->package
> - (match-lambda
> - (($ <wpa-supplicant-configuration> wpa-supplicant)
> - (list wpa-supplicant)))))
> - (service-type (name 'wpa-supplicant)
> - (extensions
> - (list (service-extension shepherd-root-service-type
> - wpa-supplicant-shepherd-service)
> - (service-extension dbus-root-service-type config->package)
> - (service-extension profile-service-type config->package)))
> - (description "Run the WPA Supplicant daemon, a service that
> + (lambda* (#:optional wpa-supplicant-package) ;deprecated
> + (let ((package
> + (if wpa-supplicant-package
> + wpa-supplicant-package
> + (match-lambda
> + (($ <wpa-supplicant-configuration> wpa-supplicant)
> + (list wpa-supplicant))))))

Derp, this obviously won't work.

I've tried various incarnations to match a package object in the
match-lambda with little success. Suggestions?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlvHrnoACgkQoqBt8qM6
VPqd9AgArHP4lTzeXcokXcR83FTPiFxlcQdZaEfa6pORmLYpqmJ/AcbGb1q1iyn1
/lVL7+BmMx3McRzC5vrmHDf10d4HP+GOI0CF8ugtrwlLrrR1S5pKb29QdRHNO2Nh
1RWiNy4Cpf5ALuiG9J5OwHhGSxyMx6ksEIwxIPUDiHTlSJU5KowLWjVIKqy8Vtyq
hsWctBtZe/4WrDwabzAYf8mAk7X/UviN3/Ch9k5uw642CJMkhVpMJAu4Vn3aRNLU
vHHe8Qv7ohCNm9kYkOciZUDfXy52Nuzj6wgqBvw1o1ydMTvixp2KZfdOP7FKwr2s
5YF7D3uN8rREV31lAfd7Tnw4sKqv7Q==
=TBMx
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 19 Oct 2018 16:00
(name . Marius Bakke)(address . mbakke@fastmail.com)
87y3auf33w.fsf@gnu.org
Hello,

Marius Bakke <mbakke@fastmail.com> skribis:

Toggle quote (45 lines)
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Mark H Weaver <mhw@netris.org> writes:
>>
>>> (services (cons* (console-keymap-service keymap)
>>> ;;(xfce-desktop-service)
>>> (gnome-desktop-service)
>>> (service network-manager-service-type
>>> (network-manager-configuration))
>>> (service wpa-supplicant-service-type wpa-supplicant)
>>
>> To adapt to the new interface, this should be changed to:
>>
>> (service wpa-supplicant-service-type)
>>
>> ...though it would be good to have backwards compatibility here. WDYT
>> of this approach?
>
> [...]
>
>> (define wpa-supplicant-service-type
>> - (let ((config->package
>> - (match-lambda
>> - (($ <wpa-supplicant-configuration> wpa-supplicant)
>> - (list wpa-supplicant)))))
>> - (service-type (name 'wpa-supplicant)
>> - (extensions
>> - (list (service-extension shepherd-root-service-type
>> - wpa-supplicant-shepherd-service)
>> - (service-extension dbus-root-service-type config->package)
>> - (service-extension profile-service-type config->package)))
>> - (description "Run the WPA Supplicant daemon, a service that
>> + (lambda* (#:optional wpa-supplicant-package) ;deprecated
>> + (let ((package
>> + (if wpa-supplicant-package
>> + wpa-supplicant-package
>> + (match-lambda
>> + (($ <wpa-supplicant-configuration> wpa-supplicant)
>> + (list wpa-supplicant))))))
>
> Derp, this obviously won't work.
>
> I've tried various incarnations to match a package object in the
> match-lambda with little success. Suggestions?

‘wpa-supplicant-service-type’ must remain a <service-type> record, so
the above cannot work.

Maybe this?
Toggle diff (15 lines)
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 61a0e975c..391c6ec59 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1077,7 +1077,9 @@ networking."))))
(let ((config->package
(match-lambda
(($ <wpa-supplicant-configuration> wpa-supplicant)
- (list wpa-supplicant)))))
+ (list wpa-supplicant))
+ ((? package? package)
+ (list package)))))
(service-type (name 'wpa-supplicant)
(extensions
(list (service-extension shepherd-root-service-type
HTH,
Ludo’.
L
L
Ludovic Courtès wrote on 7 Nov 2018 22:41
(name . Marius Bakke)(address . mbakke@fastmail.com)
87h8gssgz2.fsf@gnu.org
Hey Marius,

Ping! :-)

Ludo’.

ludo@gnu.org (Ludovic Courtès) skribis:

Toggle quote (73 lines)
> Hello,
>
> Marius Bakke <mbakke@fastmail.com> skribis:
>
>> Marius Bakke <mbakke@fastmail.com> writes:
>>
>>> Mark H Weaver <mhw@netris.org> writes:
>>>
>>>> (services (cons* (console-keymap-service keymap)
>>>> ;;(xfce-desktop-service)
>>>> (gnome-desktop-service)
>>>> (service network-manager-service-type
>>>> (network-manager-configuration))
>>>> (service wpa-supplicant-service-type wpa-supplicant)
>>>
>>> To adapt to the new interface, this should be changed to:
>>>
>>> (service wpa-supplicant-service-type)
>>>
>>> ...though it would be good to have backwards compatibility here. WDYT
>>> of this approach?
>>
>> [...]
>>
>>> (define wpa-supplicant-service-type
>>> - (let ((config->package
>>> - (match-lambda
>>> - (($ <wpa-supplicant-configuration> wpa-supplicant)
>>> - (list wpa-supplicant)))))
>>> - (service-type (name 'wpa-supplicant)
>>> - (extensions
>>> - (list (service-extension shepherd-root-service-type
>>> - wpa-supplicant-shepherd-service)
>>> - (service-extension dbus-root-service-type config->package)
>>> - (service-extension profile-service-type config->package)))
>>> - (description "Run the WPA Supplicant daemon, a service that
>>> + (lambda* (#:optional wpa-supplicant-package) ;deprecated
>>> + (let ((package
>>> + (if wpa-supplicant-package
>>> + wpa-supplicant-package
>>> + (match-lambda
>>> + (($ <wpa-supplicant-configuration> wpa-supplicant)
>>> + (list wpa-supplicant))))))
>>
>> Derp, this obviously won't work.
>>
>> I've tried various incarnations to match a package object in the
>> match-lambda with little success. Suggestions?
>
> ‘wpa-supplicant-service-type’ must remain a <service-type> record, so
> the above cannot work.
>
> Maybe this?
>
> diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
> index 61a0e975c..391c6ec59 100644
> --- a/gnu/services/networking.scm
> +++ b/gnu/services/networking.scm
> @@ -1077,7 +1077,9 @@ networking."))))
> (let ((config->package
> (match-lambda
> (($ <wpa-supplicant-configuration> wpa-supplicant)
> - (list wpa-supplicant)))))
> + (list wpa-supplicant))
> + ((? package? package)
> + (list package)))))
> (service-type (name 'wpa-supplicant)
> (extensions
> (list (service-extension shepherd-root-service-type
>
>
> HTH,
> Ludo’.
L
L
Ludovic Courtès wrote on 7 Nov 2018 22:42
control message for bug #33078
(address . control@debbugs.gnu.org)
87ftwcsgy0.fsf@gnu.org
retitle 33078 wpa-supplicant service API change leads to breakage
B
B
Bruno Victal wrote on 31 Mar 2023 01:00
control-msg
(name . control)(address . control@debbugs.gnu.org)
74912071-f536-c8bc-4711-db295b4da0e6@makinata.eu
# done with 5c131aff691fa1cb0fafe71b5f2795902ae056a7
close 55819

# control fail?
close 45449

# no longer relevant
close 33078

# tags
tags 62551 patch
tags 62503 patch
tags 62461 patch
tags 62443 patch
tags 62428 patch
tags 61226 patch
tags 59893 patch
tags 59852 patch
tags 49451 patch
tags 49207 patch
tags 44258 patch


quit
?