unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45284] [PATCH] gnu: protonvpn-cli: Update to 2.2.6.
@ 2020-12-17  4:53 Ryan Prior via Guix-patches via
  2020-12-17  4:57 ` [bug#45284] Propagated packages Ryan Prior via Guix-patches via
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ryan Prior via Guix-patches via @ 2020-12-17  4:53 UTC (permalink / raw)
  To: 45284

* gnu/packages/vpn.scm (protonvpn-cli): Update to 2.2.6.
  - Propagates all packages needed to connect.
---
 gnu/packages/vpn.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 0c504ca6cc..4c9cb16209 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -351,7 +351,7 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
 (define-public protonvpn-cli
   (package
     (name "protonvpn-cli")
-    (version "2.2.4")
+    (version "2.2.6")
     (source
      (origin
        ;; PyPI has a ".whl" file but not a proper source release.
@@ -363,7 +363,7 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "08yca0a0prrnrc7ir7ajd56yxvxpcs4m1k8f5kf273f5whgr7wzw"))))
+         "0y7v9ikrmy5dbjlpbpacp08gy838i8z54m8m4ps7ldk1j6kyia3n"))))
     (build-system python-build-system)
     (arguments '(#:tests? #f)) ; no tests in repo
     (native-inputs
@@ -373,8 +373,13 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
        ("python-pythondialog" ,python-pythondialog)
        ("python-requests" ,python-requests)))
     (propagated-inputs
-     `(("openvpn" ,openvpn)
-       ("dialog" ,dialog)))
+     `(("dialog" ,dialog)
+       ("iproute2" ,iproute)
+       ("iptables" ,iptables)
+       ("ncurses" ,ncurses)
+       ("openvpn" ,openvpn)
+       ("procps" ,procps)
+       ("which" ,which)))
     (synopsis "Command-line client for ProtonVPN")
     (description
      "This is the official command-line interface for ProtonVPN, a secure
-- 
2.29.2






^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#45284] Propagated packages
  2020-12-17  4:53 [bug#45284] [PATCH] gnu: protonvpn-cli: Update to 2.2.6 Ryan Prior via Guix-patches via
@ 2020-12-17  4:57 ` Ryan Prior via Guix-patches via
  2020-12-17  9:55   ` Efraim Flashner
  2020-12-23  3:38 ` [bug#45284] [PATCH] gnu: protonvpn-cli: Stop propagating inputs Ryan Prior via Guix-patches via
  2020-12-23  3:42 ` [bug#45284] Double wrapper for protonvpn Ryan Prior via Guix-patches via
  2 siblings, 1 reply; 7+ messages in thread
From: Ryan Prior via Guix-patches via @ 2020-12-17  4:57 UTC (permalink / raw)
  To: 45284@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

This protonvpn-cli package propagates a bunch of things, even moreso than before. I've verified that it needs them to connect, but I think we can avoid propagating them if I carefully go in and patch the system shell invocations to use explicit paths.

I don't know when I'll have time to do that, so I'd recommend merging this patch to make the latest protonvpn-cli available. In any case I'll try and get a patched package with minimal if any propagation out ASAP.

Cheers,
Ryan

[-- Attachment #2: Type: text/html, Size: 565 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#45284] Propagated packages
  2020-12-17  4:57 ` [bug#45284] Propagated packages Ryan Prior via Guix-patches via
@ 2020-12-17  9:55   ` Efraim Flashner
  0 siblings, 0 replies; 7+ messages in thread
From: Efraim Flashner @ 2020-12-17  9:55 UTC (permalink / raw)
  To: Ryan Prior; +Cc: 45284@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

On Thu, Dec 17, 2020 at 04:57:24AM +0000, Ryan Prior via Guix-patches via wrote:
> This protonvpn-cli package propagates a bunch of things, even moreso than before. I've verified that it needs them to connect, but I think we can avoid propagating them if I carefully go in and patch the system shell invocations to use explicit paths.
> 
> I don't know when I'll have time to do that, so I'd recommend merging this patch to make the latest protonvpn-cli available. In any case I'll try and get a patched package with minimal if any propagation out ASAP.
> 

Does the current protonvpn-cli not work? That is a lot of propagated
inputs. Is it possible to wrap the binary instead?

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#45284] [PATCH] gnu: protonvpn-cli: Stop propagating inputs.
  2020-12-17  4:53 [bug#45284] [PATCH] gnu: protonvpn-cli: Update to 2.2.6 Ryan Prior via Guix-patches via
  2020-12-17  4:57 ` [bug#45284] Propagated packages Ryan Prior via Guix-patches via
@ 2020-12-23  3:38 ` Ryan Prior via Guix-patches via
  2020-12-24 21:20   ` Leo Famulari
  2020-12-23  3:42 ` [bug#45284] Double wrapper for protonvpn Ryan Prior via Guix-patches via
  2 siblings, 1 reply; 7+ messages in thread
From: Ryan Prior via Guix-patches via @ 2020-12-23  3:38 UTC (permalink / raw)
  To: 45284

* gnu/packages/vpn.scm (protonvpn-cli): Stop propagating inputs.
  - Adds all necessary inputs.
  - Wraps entrypoint to avoid propagation.
---
 gnu/packages/vpn.scm | 37 +++++++++++++++++++++++++++++++------
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index c1f0b65e84..72ca9ee31b 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -364,16 +364,41 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
        (sha256
         (base32 "0y7v9ikrmy5dbjlpbpacp08gy838i8z54m8m4ps7ldk1j6kyia3n"))))
     (build-system python-build-system)
-    (arguments '(#:tests? #f)) ; no tests in repo
+    (arguments
+     '(#:tests? #f ; no tests in repo
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'wrap 'wrap-wrapper
+           ;; Wrap entrypoint with paths to its hard dependencies.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((entrypoint (string-append (assoc-ref outputs "out") "/bin/.protonvpn-real")))
+               (wrap-program entrypoint
+                            `("PATH" ":" prefix
+                              ,(map (lambda (name)
+                                      (let ((input (assoc-ref inputs name)))
+                                        (string-append input "/bin:"
+                                                       input "/sbin")))
+                                    (list "dialog"
+                                          "iproute2"
+                                          "iptables"
+                                          "ncurses"
+                                          "openvpn"
+                                          "procps"
+                                          "which")))))
+             #t)))))
     (native-inputs
      `(("python-docopt" ,python-docopt)))
     (inputs
-     `(("python-jinja2" ,python-jinja2)
+     `(("dialog" ,dialog)
+       ("iproute2" ,iproute)
+       ("iptables" ,iptables)
+       ("ncurses" ,ncurses)
+       ("openvpn" ,openvpn)
+       ("procps" ,procps)
+       ("python-jinja2" ,python-jinja2)
        ("python-pythondialog" ,python-pythondialog)
-       ("python-requests" ,python-requests)))
-    (propagated-inputs
-     `(("openvpn" ,openvpn)
-       ("dialog" ,dialog)))
+       ("python-requests" ,python-requests)
+       ("which" ,which)))
     (synopsis "Command-line client for ProtonVPN")
     (description
      "This is the official command-line interface for ProtonVPN, a secure
-- 
2.29.2






^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#45284] Double wrapper for protonvpn
  2020-12-17  4:53 [bug#45284] [PATCH] gnu: protonvpn-cli: Update to 2.2.6 Ryan Prior via Guix-patches via
  2020-12-17  4:57 ` [bug#45284] Propagated packages Ryan Prior via Guix-patches via
  2020-12-23  3:38 ` [bug#45284] [PATCH] gnu: protonvpn-cli: Stop propagating inputs Ryan Prior via Guix-patches via
@ 2020-12-23  3:42 ` Ryan Prior via Guix-patches via
  2020-12-24 21:21   ` bug#45284: " Leo Famulari
  2 siblings, 1 reply; 7+ messages in thread
From: Ryan Prior via Guix-patches via @ 2020-12-23  3:42 UTC (permalink / raw)
  To: 45284@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

Hi there! This patch updates the protonvpn-cli package to use a wrapper, so now it doesn't propagate anything.

I ran into a hitch when wrapping the program the same way it's typically done didn't work. I was getting a "bad interpreter" error from the kernel when I ran the program. Digging into it, I discovered it's because the program was double-wrapped, and the second wrapping garbled the work done by the first wrapping.

Investigating further, I determined the messiness stems from python-build-system automatically wrapping my output for me to set the PYTHONPATH. From my searching in gnu/packages/python-* sources, there isn't much explicit wrapping in python land.
So y'all know me, I decided to try the dumbest possible thing first: I wrapped the wrapper.

It works fine. But you end up with a situation like:
- invoke protonvpn
- which sets PYTHONPATH and invokes .protonvpn-real
- which sets PATH and calls ..protonvpn-real-real

Additionally, in the build output we have a "wrap" phase and then a "wrap-wrapper" phase.

So what do you think? Is my dumb solution that works thus not dumb, and we should ship it? Or is there a better way of composing wrappers so that I'm not creating this billiards game situation with the entrypoint?

Cheers,
Ryan

[-- Attachment #2: Type: text/html, Size: 1520 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#45284] [PATCH] gnu: protonvpn-cli: Stop propagating inputs.
  2020-12-23  3:38 ` [bug#45284] [PATCH] gnu: protonvpn-cli: Stop propagating inputs Ryan Prior via Guix-patches via
@ 2020-12-24 21:20   ` Leo Famulari
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2020-12-24 21:20 UTC (permalink / raw)
  To: 45284

On Wed, Dec 23, 2020 at 03:38:08AM +0000, Ryan Prior via Guix-patches via wrote:
> * gnu/packages/vpn.scm (protonvpn-cli): Stop propagating inputs.
>   - Adds all necessary inputs.
>   - Wraps entrypoint to avoid propagation.

Thanks! I wrote the commit message and pushed as bcfa8b4a285c4948b61bc7297ade28a7c0e59e2c




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#45284: Double wrapper for protonvpn
  2020-12-23  3:42 ` [bug#45284] Double wrapper for protonvpn Ryan Prior via Guix-patches via
@ 2020-12-24 21:21   ` Leo Famulari
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2020-12-24 21:21 UTC (permalink / raw)
  To: Ryan Prior via Guix-patches via; +Cc: 45284@debbugs.gnu.org

On Wed, Dec 23, 2020 at 03:42:48AM +0000, Ryan Prior via Guix-patches via wrote:
> So what do you think? Is my dumb solution that works thus not dumb, and we should ship it? Or is there a better way of composing wrappers so that I'm not creating this billiards game situation with the entrypoint?

There are plenty of Guix packages that create multiple wrappers. I'm
sure there is room for improvement but this is fine if it works for you.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-24 21:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-17  4:53 [bug#45284] [PATCH] gnu: protonvpn-cli: Update to 2.2.6 Ryan Prior via Guix-patches via
2020-12-17  4:57 ` [bug#45284] Propagated packages Ryan Prior via Guix-patches via
2020-12-17  9:55   ` Efraim Flashner
2020-12-23  3:38 ` [bug#45284] [PATCH] gnu: protonvpn-cli: Stop propagating inputs Ryan Prior via Guix-patches via
2020-12-24 21:20   ` Leo Famulari
2020-12-23  3:42 ` [bug#45284] Double wrapper for protonvpn Ryan Prior via Guix-patches via
2020-12-24 21:21   ` bug#45284: " Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).