libblockdev inputs are not used correctly

  • Open
  • quality assurance status badge
Details
4 participants
  • Danny Milosavljevic
  • Efraim Flashner
  • Sarah Morgensen
  • Ludovic Courtès
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal
D
D
Danny Milosavljevic wrote on 28 Dec 2018 14:32
(address . bug-guix@gnu.org)
20181228143255.78bf15b1@scratchpost.org
Currently, libblockdev has inputs which aren't used.

These SHOULD be used, but the source files are not patched
so the executables in the inputs are not found or used.

Example:

* libblockdev depends on dosfstools because src/plugins/fs/vfat.c would use
"mkfs.vfat" etc, but src/plugins/fs/vfat.c is not patched to actually refer
to the inputs.

This problem is valid for everything in src/plugins/fs .

Do we proceed to patch it to use the inputs or do we move dosfstools etc
to propagated-inputs ?

I'd suggest the former.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlwmJgcACgkQ5xo1VCww
uqVhXQf+JpXrlHrXYvC7QWZjIFsgHiB7yg2McY78gp17cfL1Hp1zaKHaATXK9S1J
Ib5hKfEEL+7khtJ1VahU889Eys6qqUOnTN3m5NPEx0nvr1+1jN/3hIfWqwqHVU+T
Q4+0qcM0PaNnt3985SpvQjrmUNxzM7G6DT0z4fHKHGyzi3d2/bLkCOEYZQsDz7l/
KHTKmsFNLfje0yhyqj9xKUkLgw59n+cSTP3Rmxb1Ae4qn2mDCiEUVymfze6idWdj
xRZ967pjBZWXqFBht3Km2mRcQsaiIkQQq4JeCZ63qpTiABVgJBbFHo7iLta6oJ/L
VckWFXUJeYiNpYE93jj8uXeZHpA/wA==
=Pgp2
-----END PGP SIGNATURE-----


E
E
Efraim Flashner wrote on 29 Dec 2018 19:50
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 33896@debbugs.gnu.org)
20181229185036.GV2581@macbook41
On Fri, Dec 28, 2018 at 02:32:55PM +0100, Danny Milosavljevic wrote:
Toggle quote (18 lines)
> Currently, libblockdev has inputs which aren't used.
>
> These SHOULD be used, but the source files are not patched
> so the executables in the inputs are not found or used.
>
> Example:
>
> * libblockdev depends on dosfstools because src/plugins/fs/vfat.c would use
> "mkfs.vfat" etc, but src/plugins/fs/vfat.c is not patched to actually refer
> to the inputs.
>
> This problem is valid for everything in src/plugins/fs .
>
> Do we proceed to patch it to use the inputs or do we move dosfstools etc
> to propagated-inputs ?
>
> I'd suggest the former.

Similar to the enlightenment package getting more 'substitute*'s to
improve functionality, I agree that patching libblockdev to actually
find all the inputs/executables is preferable.


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlwnwfkACgkQQarn3Mo9
g1GPdQ//dvh7pDkTle9SoyPTCH9iUEQ0E+uPbVQxqsuLySyWdK4PEj1WWYVd98Fq
DhlK+egUUAkAsGGSPBgXdKZoJkY7t1dO4+X1YPgh1fEuKjhXCGdfb1DiUXk1GNJg
egNTxhRa0BUMgeIg4rqeCSvqc2C2lsaf++sQedmskF8+VJvDc3bDu/T0n9E0P3vQ
9/qi9NWXLVLxaOMSV5oScArJeMTgOsQKQSUK457cJucy5N2YEtuwsoZbo6X9XdM9
Pmd8pkI09HOvfQiaBRr0vmsyM9WwIdajVt3r+ElReKoOWUnHVuIBRbu0l45OUAwv
nmcnoOh4su8TTRGcZWEtB+36RC+v5IqigBWGdoEQkly2DfulARBexSGuTlRqv+t+
qrILuw2uL/RO6WtPJEoQZeZ70f65EEd/wNqyHFe6pQfEwsdXCB5Lr6f54UZ6i/LP
QzXSf7DJqnVWavJxiTNXC0aXynCagrJIV7iOoZ4eOC8m4XjPLD4d6f1DN+HcMl0D
wj9VIdZYoLT2zZDPwWUYeOYjOpdi4QqFMr1avBtGPOis+LgfW8+1kz2O5GQyPBou
yoRjOK8jM27YPKXM5bUr/TB8GQ0aBuf0sHEXFp1lOo/FeGibekwV7WJVnlJ6uAkd
Znup9KM+P0nwjJENwGFSglrmljdO85tExdhwC/lRLQvBBpzmKw8=
=p5yZ
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 5 Jan 2019 18:55
(name . Efraim Flashner)(address . efraim@flashner.co.il)
877efj2dlj.fsf@gnu.org
Hello,

Efraim Flashner <efraim@flashner.co.il> skribis:

Toggle quote (23 lines)
> On Fri, Dec 28, 2018 at 02:32:55PM +0100, Danny Milosavljevic wrote:
>> Currently, libblockdev has inputs which aren't used.
>>
>> These SHOULD be used, but the source files are not patched
>> so the executables in the inputs are not found or used.
>>
>> Example:
>>
>> * libblockdev depends on dosfstools because src/plugins/fs/vfat.c would use
>> "mkfs.vfat" etc, but src/plugins/fs/vfat.c is not patched to actually refer
>> to the inputs.
>>
>> This problem is valid for everything in src/plugins/fs .
>>
>> Do we proceed to patch it to use the inputs or do we move dosfstools etc
>> to propagated-inputs ?
>>
>> I'd suggest the former.
>
> Similar to the enlightenment package getting more 'substitute*'s to
> improve functionality, I agree that patching libblockdev to actually
> find all the inputs/executables is preferable.

I agree; using ‘substitute*’ is more appropriate than propagation here.

Thanks,
Ludo’.
S
S
Sarah Morgensen wrote on 25 Sep 2021 23:28
[PATCH 1/2] gnu: libblockdev: Embed executable paths.
(address . 33896@debbugs.gnu.org)
8a50a917c91792e8d5b9f69a31485a3909559ef5.1632604842.git.iskarian@mgsn.dev

* gnu/packages/disk.scm (libblockdev)[arguments]<#:phases>: Add
'patch-plugin-paths' phase.
---
gnu/packages/disk.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 7d6f3811dd..f3a7eb7617 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -21,6 +21,7 @@
;;; Copyright © 2021 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -940,7 +941,13 @@ to create devices with respective mappings for the ATARAID sets discovered.")
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(substitute* "src/lib/blockdev.c"
- (("/etc/libblockdev/conf.d/" path) (string-append out path)))))))))
+ (("/etc/libblockdev/conf.d/" path) (string-append out path))))))
+ (add-after 'unpack 'patch-plugin-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* (find-files "src/plugins" "\\.c$")
+ (("(gchar \\*arg.+\\{\")([^\"]+)" all start program)
+ ;; XXX: Use 'search-input-file' when available.
+ (string-append start (or (which program) program)))))))))
(native-inputs
`(("gobject-introspection" ,gobject-introspection)
("pkg-config" ,pkg-config)

base-commit: 69f37702dfcda776a190d5c40fad8518469ce3c4
--
2.33.0
S
S
Sarah Morgensen wrote on 25 Sep 2021 23:46
[PATCH 2/2] gnu: libblockdev: Fix inputs.
(address . 33896@debbugs.gnu.org)
ab306424d6b39f3a23445b0ee1c44d5060010ea8.1632604842.git.iskarian@mgsn.dev
Add missing inputs; make util-linux a regular input since libblockdev
retains references to it.

* gnu/packages/disk.scm (libblockdev):
[inputs]: Add bcache-tools, e2fsprogs, gptfdisk, multipath-tools, ntfs-3g,
util-linux, and xfsprogs.
[native-inputs]: Remove util-linux.
---
gnu/packages/disk.scm | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index f3a7eb7617..a233db9433 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -951,26 +951,30 @@ to create devices with respective mappings for the ATARAID sets discovered.")
(native-inputs
`(("gobject-introspection" ,gobject-introspection)
("pkg-config" ,pkg-config)
- ("python" ,python-wrapper)
- ("util-linux" ,util-linux)))
+ ("python" ,python-wrapper)))
(inputs
- `(("btrfs-progs" ,btrfs-progs)
+ `(("bcache-tools" ,bcache-tools)
+ ("btrfs-progs" ,btrfs-progs)
("cryptsetup" ,cryptsetup)
("dosfstools" ,dosfstools)
("dmraid" ,dmraid)
+ ("e2fsprogs" ,e2fsprogs)
("eudev" ,eudev)
("glib" ,glib)
+ ("gptfdisk" ,gptfdisk)
("kmod" ,kmod)
("libbytesize" ,libbytesize)
("libyaml" ,libyaml)
("lvm2" ,lvm2)
("mdadm" ,mdadm)
+ ("multipath-tools" ,multipath-tools)
("ndctl" ,ndctl)
("nss" ,nss)
+ ("ntfs-3g" ,ntfs-3g)
("parted" ,parted)
+ ("util-linux" ,util-linux)
("volume-key" ,volume-key)
- ;; ("xfsprogs" ,xfsprogs) ; TODO: Package?
- ))
+ ("xfsprogs" ,xfsprogs)))
(home-page "https://github.com/storaged-project/libblockdev")
(synopsis "Library for manipulating block devices")
(description
--
2.33.0
S
S
Sarah Morgensen wrote on 26 Sep 2021 06:09
control message for bug #33896
(address . control@debbugs.gnu.org)
E1mULTs-00037c-J7@debbugs.gnu.org
tags 33896 + patch
quit
?