[PATCH] gnu: Add waypipe.

  • Done
  • quality assurance status badge
Details
4 participants
  • Robby Zambito
  • Nicolas Goaziou
  • Maxime Devos
  • Paul A. Patience
Owner
unassigned
Submitted by
Robby Zambito
Severity
normal
R
R
Robby Zambito wrote on 17 Aug 2021 03:53
(address . guix-patches@gnu.org)(name . Robby Zambito)(address . contact@robbyzambito.me)
20210817015308.353224-1-contact@robbyzambito.me
* gnu/packages/xdisorg.scm (waypipe): New variable.
---
gnu/packages/xdisorg.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 71c2ea4cbc..d79f580b47 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -50,6 +50,7 @@
;;; Copyright © 2021 Niklas Eklund <niklas.eklund@posteo.net>
;;; Copyright © 2021 Nikita Domnitskii <nikita@domnitskii.me>
;;; Copyright © 2021 ikasero <ahmed@ikasero.com>
+;;; Copyright © 2021 Robby Zambito <contact@robbyzambito.me>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -866,6 +867,33 @@ predefined region or a particular window. Also, it makes it possible to
include cursor in the resulting image.")
(license license:gpl3+)))
+(define-public waypipe
+ (package
+ (name "waypipe")
+ (version "0.8.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/mstoeckl/waypipe")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qa47ljfvb1vv3h647xwn1j5j8gfmcmdfaz4j8ygnkvj36y87vnz"))))
+ (build-system meson-build-system)
+ ;; One test fails where the program does not exit cleanly given a bad
+ ;; setup. Not ideal but probably safe to ignore. Check that no other tests
+ ;; fail before bumping the version. If all tests pass, remove this.
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'check))))
+ (home-page "https://gitlab.freedesktop.org/mstoeckl/waypipe")
+ (synopsis "Proxy for Wayland protocol applications")
+ (description "Waypipe is a proxy for Wayland clients, with the aim of
+supporting behavior like ssh -X.")
+ (license license:expat)))
+
(define-public unclutter
(package
(name "unclutter")
--
2.32.0
R
R
Robby Zambito wrote on 18 Aug 2021 22:27
[PATCH v2] gnu: waypipe: Enable tests.
(address . 50084@debbugs.gnu.org)(name . Robby Zambito)(address . contact@robbyzambito.me)
20210818202710.55244-1-contact@robbyzambito.me
* gnu/packages/xdisorg.scm (waypipe): Don't skip tests. Add dependencies
required to run the tests.
---
This is my first contribution to guix, I was not aware of how to do what
was needed to properly pass the tests for this package. After consulting
#guix on IRC, I have believe I have made the necessary changes.

gnu/packages/xdisorg.scm | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)

Toggle diff (35 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index d79f580b47..ba520d35ae 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -881,13 +881,24 @@ include cursor in the resulting image.")
(sha256
(base32 "1qa47ljfvb1vv3h647xwn1j5j8gfmcmdfaz4j8ygnkvj36y87vnz"))))
(build-system meson-build-system)
- ;; One test fails where the program does not exit cleanly given a bad
- ;; setup. Not ideal but probably safe to ignore. Check that no other tests
- ;; fail before bumping the version. If all tests pass, remove this.
(arguments
`(#:phases
(modify-phases %standard-phases
- (delete 'check))))
+ (add-after 'unpack 'fix-sleep-path
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (coreutils (assoc-ref inputs "coreutils")))
+ (substitute* "./test/startup_failure.py"
+ (("sleep")
+ (string-append coreutils "/bin/sleep")))
+ #t))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("scdoc" ,scdoc)))
+ (inputs
+ ;; For tests
+ `(("python" ,python)
+ ("coreutils" ,coreutils)))
(home-page "https://gitlab.freedesktop.org/mstoeckl/waypipe")
(synopsis "Proxy for Wayland protocol applications")
(description "Waypipe is a proxy for Wayland clients, with the aim of
--
2.32.0
P
P
Paul A. Patience wrote on 19 Aug 2021 00:56
Re: [PATCH] gnu: Add waypipe.
(name . 50084@debbugs.gnu.org)(address . 50084@debbugs.gnu.org)
ZScZmV8iTXYfnvQdRReLqyKZMjkTOjhY-tiR9uASSNsHgr9V8CYLZ0zQRzMBYz9Ite9mvhNFXC5q3pDVgZqMTcpnnVGOqRx-I9b1mj5EPK4=@apatience.com
Hi,

Toggle quote (4 lines)
> + (add-after 'unpack 'fix-sleep-path
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out"))

out is not used anywhere, so you can remove it, along with the outputs
argument of the lambda.

Toggle quote (13 lines)
> + (coreutils (assoc-ref inputs "coreutils")))
> + (substitute* "./test/startup_failure.py"
> + (("sleep")
> + (string-append coreutils "/bin/sleep")))
> + #t))))))
> + (native-inputs
> + `(("pkg-config" ,pkg-config)
> + ("scdoc" ,scdoc)))
> + (inputs
> + ;; For tests
> + `(("python" ,python)
> + ("coreutils" ,coreutils)))

I haven't tried building this or anything, but if python and coreutils
are really only needed for tests, then they need not be in inputs (and
the fact that the initial version of this patch didn't have them at all
supports this thesis).
In other words, I'd put everything in native-inputs.

Also (and this is really minor), arguments normally follows the inputs
sections.

Best regards,
Paul
R
R
Robby Zambito wrote on 19 Aug 2021 04:02
[PATCH v3] gnu: waypipe: Clean up phases and dependencies.
(address . 50084@debbugs.gnu.org)
20210819020234.642522-1-contact@robbyzambito.me
* gnu/packages/xdisorg.scm (waypipe)[arguments]: Remove unused
argument from fix-sleep-path phase.
[native-inputs]: Add python, coreutils.
[inputs]: Remove python, coreutils.
---
Paul,

Thank you for the tips. I've removed the unused outputs argument, as
well as the out variable.

I'm a bit confused as to why test dependencies are supposed to be
native-inputs. Aren't the tests run on the target architecture, not the
build machine architecture? And aren't native-inputs built for the build
machine architecture?

I cross compiled the package for armhf-linux and aarch64-linux and it
built and tested fine with the changes you suggested, but I also did the
same with how I had it previously.

Sincerely,
Robby

gnu/packages/xdisorg.scm | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index ba520d35ae..f5b041a590 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -885,19 +885,15 @@ include cursor in the resulting image.")
`(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-sleep-path
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (coreutils (assoc-ref inputs "coreutils")))
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((coreutils (assoc-ref inputs "coreutils")))
(substitute* "./test/startup_failure.py"
- (("sleep")
- (string-append coreutils "/bin/sleep")))
- #t))))))
+ (("sleep") (string-append coreutils "/bin/sleep")))))))))
(native-inputs
`(("pkg-config" ,pkg-config)
- ("scdoc" ,scdoc)))
- (inputs
- ;; For tests
- `(("python" ,python)
+ ("scdoc" ,scdoc)
+ ;; For tests
+ ("python" ,python)
("coreutils" ,coreutils)))
(home-page "https://gitlab.freedesktop.org/mstoeckl/waypipe")
(synopsis "Proxy for Wayland protocol applications")
--
2.32.0
P
P
Paul A. Patience wrote on 19 Aug 2021 06:04
(name . Robby Zambito)(address . contact@robbyzambito.me)(address . 50084@debbugs.gnu.org)
0_3aaZdQOyW0x0cY_qfhu-GiM_BUiQzfo2SH3bQ6rSo0r5t2tl980g9DPYC2S9QFEcRnB_U9CiQp1qoZHkQ_kqxSS1OIBTHNJTmE4S1oCaA=@apatience.com
On Wednesday, August 18th, 2021 at 22:02, Robby Zambito <contact@robbyzambito.me> wrote:
Toggle quote (5 lines)
> I'm a bit confused as to why test dependencies are supposed to be
> native-inputs. Aren't the tests run on the target architecture, not the
> build machine architecture? And aren't native-inputs built for the build
> machine architecture?

You might be right.
I haven't yet done any cross compiling with Guix yet, so I don't know much about it.
I'll have to let someone with more knowledge comment on this.

Best regards,
Paul
M
M
Maxime Devos wrote on 19 Aug 2021 17:24
Re: [bug#50084] [PATCH v3] gnu: waypipe: Clean up phases and dependencies.
(address . paul@apatience.com)
08627decd152bee69410912cf5ac139af47dcee7.camel@telenet.be
Robby Zambito schreef op wo 18-08-2021 om 22:02 [-0400]:
Toggle quote (15 lines)
> * gnu/packages/xdisorg.scm (waypipe)[arguments]: Remove unused
> argument from fix-sleep-path phase.
> [native-inputs]: Add python, coreutils.
> [inputs]: Remove python, coreutils.
> ---
> Paul,
>
> Thank you for the tips. I've removed the unused outputs argument, as
> well as the out variable.
>
> I'm a bit confused as to why test dependencies are supposed to be
> native-inputs. Aren't the tests run on the target architecture, not the
> build machine architecture? And aren't native-inputs built for the build
> machine architecture?

By default, tests are never run when cross-compiling, so putting test
dependencies in 'native-inputs' works in practice. Theoretically,
putting test dependencies in 'inputs' might be cleaner, especially
if at some point Guix supports testing cross-compiled packages
(maybe the build directory could be copied to a "worktree" output or
something, and guix could provide a command to test the cross-compiled
binaries on the machine that was cross-compiled for or something).

Nevertheless, test dependencies tend to be put in 'native-input' anyways.
This has a practical reason (*): not all build systems support
cross-compilation. E.g., the build system 'meson', used by 'glib', doesn't
support cross-compilation on 'master' (it does on 'core-updates-frozen' though),
so packages that (indirectly) have 'glib' as 'input' cannot be an 'input'.

(*) not necessarily the reason people originally had in mind.

Toggle quote (3 lines)
> I cross compiled the package for armhf-linux and aarch64-linux and it
> built and tested fine with the changes you suggested, but I also did the

Are you sure it tested? Unless qemu transparent emulation is enabled
(see ‘Transparent Emulation with QEMU’ in the manual) that cannot happen.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYR53mRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lNnAQCYztjHjj8wOCvV6np2hGGlEfEu
K6rQIIyrcHCtgpmBHwD/X1PYQ9SYjkpvYT8hIrcd2snutjulXB00RTh6/DfhpQs=
=hDb2
-----END PGP SIGNATURE-----


R
R
Robby Zambito wrote on 19 Aug 2021 21:58
(address . paul@apatience.com)
20210819195833.f66ibk22754dmo74@robby-Ryzen-RX-PC.localdomain
Hi Maxime,

Thank you for the insight.

Toggle quote (6 lines)
> > I cross compiled the package for armhf-linux and aarch64-linux and it
> > built and tested fine with the changes you suggested, but I also did the
>
> Are you sure it tested? Unless qemu transparent emulation is enabled
> (see ‘Transparent Emulation with QEMU’ in the manual) that cannot happen.

I just ran it again to be sure, and yes. I did set up QEMU for building
on other architectures. I suppose this means QEMU is being used for the
'native-inputs', which is a little confusing but I guess it makes sense
:D

With the current state of these patches it follows the practice of
putting the test dependencies in the native-inputs. If there is anything
else that is needed before this can be merged I will be happy to make it
happen!

Sincerely,
Robby
M
M
Maxime Devos wrote on 19 Aug 2021 23:13
(address . 50084@debbugs.gnu.org)(address . paul@apatience.com)
af81b1f0c615cfe22ce28377ffc3f2a3e92364c4.camel@telenet.be
Robby Zambito schreef op do 19-08-2021 om 15:58 [-0400]:
Toggle quote (15 lines)
> Hi Maxime,
>
> Thank you for the insight.
>
> > > I cross compiled the package for armhf-linux and aarch64-linux and it
> > > built and tested fine with the changes you suggested, but I also did the
> >
> > Are you sure it tested? Unless qemu transparent emulation is enabled
> > (see ‘Transparent Emulation with QEMU’ in the manual) that cannot happen.
>
> I just ran it again to be sure, and yes. I did set up QEMU for building
> on other architectures. I suppose this means QEMU is being used for the
> 'native-inputs', which is a little confusing but I guess it makes sense
> :D

It is impossible to cross-compile waypipe on master, because
meson-build-system does not support cross-compilation (on master).

# replace 'glib' with 'waypipe'
$ LC_ALL=C guix build glib --target=arm-linux-gnueabihf
guix build: error: gnu/packages/glib.scm:425:2: glib@2.62.6: build system `meson' does not support cross builds

What branch are you on?

Also, what arguments did you pass to "guix build"?
You need --target=arm-linux-gnueabihf for cross-compilation,
not --system=armhf-linux. The latter is for offloading to an armhf
machine or a QEMU emulated build.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iIwEABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYR7JfBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pZBAQDERNImKZYS4Orc/fdqvr3lDjX2
rtdSz5I53i5i407O8gD40GyAzakaDvvrlh0DrjzXBsYn7xNvUWx+b7kA6lnaCg==
=kzfr
-----END PGP SIGNATURE-----


R
R
Robby Zambito wrote on 20 Aug 2021 00:11
(address . paul@apatience.com)
20210819221108.yblyf5n72km2yaof@robby-Ryzen-RX-PC.localdomain
Hi Maxime,

Toggle quote (8 lines)
> It is impossible to cross-compile waypipe on master, because
> meson-build-system does not support cross-compilation (on master).
>
> # replace 'glib' with 'waypipe'
> $ LC_ALL=C guix build glib --target=arm-linux-gnueabihf
> guix build: error: gnu/packages/glib.scm:425:2: glib <at> 2.62.6: build
> system `meson' does not support cross builds

You are correct, I am not actually able to cross compile. I was
confusing the virtualized build with cross-compiling.

Toggle quote (2 lines)
> What branch are you on?

master

Toggle quote (5 lines)
> Also, what arguments did you pass to "guix build"?
> You need --target=arm-linux-gnueabihf for cross-compilation,
> not --system=armhf-linux. The latter is for offloading to an armhf
> machine or a QEMU emulated build.

--target does not work, --system does.

Sincerely,
Robby
R
R
Robby Zambito wrote on 30 Aug 2021 03:54
[PATCH] gnu: Add waypipe.
(address . 50084@debbugs.gnu.org)(name . Robby Zambito)(address . contact@robbyzambito.me)
20210830015400.244302-1-contact@robbyzambito.me
* gnu/packages/freedesktop.scm (waypipe): New variable.
---
gnu/packages/freedesktop.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (53 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 693a79c738..f2e00ebba9 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -24,6 +24,7 @@
;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com>
+;;; Copyright © 2021 Robby Zambito <contact@robbyzambito.me>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2434,3 +2435,38 @@ seeks to add support for the screenshot, screencast, and possibly
remote-desktop @code{xdg-desktop-portal} interfaces for wlroots based
compositors.")
(license license:expat)))
+
+(define-public waypipe
+ (package
+ (name "waypipe")
+ (version "0.8.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/mstoeckl/waypipe")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1qa47ljfvb1vv3h647xwn1j5j8gfmcmdfaz4j8ygnkvj36y87vnz"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-sleep-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((coreutils (assoc-ref inputs "coreutils")))
+ (substitute* "./test/startup_failure.py"
+ (("sleep") (string-append coreutils "/bin/sleep")))))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("scdoc" ,scdoc)
+ ;; For tests
+ ("python" ,python)
+ ("coreutils" ,coreutils)))
+ (home-page "https://gitlab.freedesktop.org/mstoeckl/waypipe")
+ (synopsis "Proxy for Wayland protocol applications")
+ (description
+ "Waypipe is a proxy for Wayland clients, with the aim of
+supporting behavior like ssh -X.")
+ (license license:expat)))
--
2.33.0
R
R
Robby Zambito wrote on 30 Aug 2021 03:58
(address . 50084@debbugs.gnu.org)
20210830015846.4hcymqvsu44zhy3m@robby-Ryzen-RX-PC.localdomain
I apologize for being messy with this patch. I realized after poking
around more that this package would probably fit better under the
freedesktop module. My most recent patch should be able to be applied
without any of the previous ones I sent. I hope this is good now!

Thanks,
Robby
N
N
Nicolas Goaziou wrote on 6 Sep 2021 11:15
Re: [bug#50084] [PATCH] gnu: Add waypipe.
(name . Robby Zambito)(address . contact@robbyzambito.me)(address . 50084-done@debbugs.gnu.org)
87lf4aawuy.fsf@nicolasgoaziou.fr
Hello,

Robby Zambito <contact@robbyzambito.me> writes:

Toggle quote (2 lines)
> * gnu/packages/freedesktop.scm (waypipe): New variable.

Applied. Thank you.

Regards,
--
Nicolas Goaziou
Closed
M
M
Maxime Devos wrote on 7 Sep 2021 23:13
74368391c4c5ddee6ddde4a908f15c52f1a543e7.camel@telenet.be
Hi,

Toggle quote (7 lines)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'fix-sleep-path
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let ((coreutils (assoc-ref inputs "coreutils")))

coreutils is in native-inputs, not inputs, so this needs to be:
(assoc-ref (or native-inputs inputs) "coreutils"). (native-inputs
and inputs are appended together when compiling natively, that's
why this didn't cause a build error).

Toggle quote (3 lines)
> + (substitute* "./test/startup_failure.py"
> + (("sleep") (string-append coreutils "/bin/sleep")))))))))

You can write (("sleep") (which "sleep")) here.

Toggle quote (7 lines)
> + (native-inputs
> + `(("pkg-config" ,pkg-config)
> + ("scdoc" ,scdoc)
> + ;; For tests
> + ("python" ,python)
> + ("coreutils" ,coreutils)))

FWIW, coreutils is an implicit native-input of meson-build-system,
so this input isn't necessary.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYTfV4BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pZ6AP9corRtKhHVFii+nneixr9nnx1I
yVVE1KNXBZBWXUjP9AD9GIort59Eo2/U2ZARKfvrGfaGxxXQxI0CSbmfy0zVrgM=
=H6X5
-----END PGP SIGNATURE-----


?