GNU bug report logs - #47540
[PATCH] gnu: Add prips.

Previous Next

Package: guix-patches;

Reported by: david larsson <david.larsson <at> selfhosted.xyz>

Date: Thu, 1 Apr 2021 13:13:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47540 in the body.
You can then email your comments to 47540 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47540; Package guix-patches. (Thu, 01 Apr 2021 13:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to david larsson <david.larsson <at> selfhosted.xyz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 01 Apr 2021 13:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add prips.
Date: Thu, 01 Apr 2021 15:11:56 +0200
[Message part 1 (text/plain, inline)]
From 22cc953d3e663bb842d5a0b970577a3d54f6fef1 Mon Sep 17 00:00:00 2001
From: methuselah-0 <david.larsson <at> selfhosted.xyz>
Date: Thu, 1 Apr 2021 15:10:45 +0200
Subject: [PATCH] gnu: Add prips.

* gnu/packages/admin.scm (prips): New variable.
---
 gnu/packages/admin.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index df7973395d..f6cb62a568 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -39,6 +39,7 @@
 ;;; Copyright © 2021 Stefan Reichör <stefan <at> xsteve.at>
 ;;; Copyright © 2021 qblade <qblade <at> protonmail.com>
 ;;; Copyright © 2021 Hyunseok Kim <lasnesne <at> lagunposprasihopre.org>
+;;; Copyright © 2021 David Larsson <david.larsson <at> selfhosted.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1019,6 +1020,39 @@ recursive runs on the generated subnets.  (also 
IPv6)
 @end itemize\n")
     (license license:bsd-3)))

+(define-public prips
+  (package
+    (name "prips")
+    (version "1.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://devel.ringlet.net/files/sys/"
+                           name "/" name "-" version ".tar.xz"))
+       (sha256
+        (base32 
"1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:make-flags (list "CC=gcc")
+       #:phases (modify-phases
+                    %standard-phases
+                  (delete 'configure)
+                  (delete 'check)
+                  (replace 'install
+                    (lambda _
+                      (let*
+                          ((bin-dir  (string-append %output "/bin"))
+                           (bin-file (string-append bin-dir "/prips")))
+                        (mkdir-p bin-dir)
+                        (copy-file "prips" bin-file)
+                        (chmod bin-file #o700)))))))
+    (synopsis "Tool that prints the IP addresses in a given range")
+    (description "Prips can be used to print all of the IP addresses in
+ a given range.  This allows the enhancement of tools only work
+ on one host at a time (e.g. whois).")
+    (home-page "https://devel.ringlet.net/sysutils/prips/")
+    (license license:gpl2)))
+
 (define-public alive
   (package
     (name "alive")
-- 
2.30.2

[0001-gnu-Add-prips.patch (text/x-diff, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47540; Package guix-patches. (Thu, 01 Apr 2021 19:45:01 GMT) Full text and rfc822 format available.

Message #8 received at 47540 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: david larsson <david.larsson <at> selfhosted.xyz>, 47540 <at> debbugs.gnu.org
Subject: Re: [bug#47540] [PATCH] gnu: Add prips.
Date: Thu, 01 Apr 2021 21:44:46 +0200
[Message part 1 (text/plain, inline)]
Hi,

Some comments on the patch.

On Thu, 2021-04-01 at 15:11 +0200, david larsson wrote:
> [...]
> +(define-public prips
> +  (package
> +    (name "prips")
> +    (version "1.1.1")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://devel.ringlet.net/files/sys/"
> +                           name "/" name "-" version ".tar.xz"))
> +       (sha256
> +        (base32 
> "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:make-flags (list "CC=gcc")

As "CC=gcc" is a constant, I would write '("CC=gcc") here,
though admittedly this is largely a matter of taste.

Another problem: when cross-compiling, "gcc" will be a
compiler for the build system, not the host system (assuming
I got the terminology right).  Instead, write

     `(#:make-flags (list (string-append "CC" ,(cc-for-target)))
       ...)

(The quasiquote ` is important.)
(TODO to self: fix other packages that incorrectly set "CC=gcc" ...)

> +       #:phases (modify-phases
> +                    %standard-phases

%standard-phases shouldn't be on a separate line here.

> +                  (delete 'configure)
> +                  (delete 'check)

Prips has some tests, so don't delete this phase.

> +                  (replace 'install
> +                    (lambda _
> +                      (let*
> +                          ((bin-dir  (string-append %output "/bin"))
> +                           (bin-file (string-append bin-dir "/prips")))

The ((bin-dir ...)) should be on the same line as 'let*'.

> +                        (mkdir-p bin-dir)
> +                        (copy-file "prips" bin-file)
> +                        (chmod bin-file #o700)))))))

Why are you making bin/prips writable?  Shouldn't this be
(chmod bin-file #o600) instead?

> +    (synopsis "Tool that prints the IP addresses in a given range")
> +    (description "Prips can be used to print all of the IP addresses in
> + a given range.  This allows the enhancement of tools only work

‘Enhancement’ is rather vague and leaning towards marketing-speak.
I do not have an alternative suggestion however.

> + on one host at a time (e.g. whois).")
> +    (home-page "https://devel.ringlet.net/sysutils/prips/")
> +    (license license:gpl2)))

I looked at the source code and it seems prips is actually gpl2+.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47540; Package guix-patches. (Mon, 05 Apr 2021 13:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 47540 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 47540 <at> debbugs.gnu.org
Subject: Re: [bug#47540] [PATCH] gnu: Add prips.
Date: Mon, 05 Apr 2021 15:09:23 +0200
On 2021-04-01 21:44, Maxime Devos wrote:

>> +    (arguments
>> +     '(#:make-flags (list "CC=gcc")
> 
> As "CC=gcc" is a constant, I would write '("CC=gcc") here,
> though admittedly this is largely a matter of taste.
> Another problem: when cross-compiling, "gcc" will be a
> compiler for the build system, not the host system (assuming
> I got the terminology right).  Instead, write
> 
>      `(#:make-flags (list (string-append "CC" ,(cc-for-target)))
>        ...)
> 
> (The quasiquote ` is important.)

Fixed.

>> +       #:phases (modify-phases
>> +                    %standard-phases
> 
> %standard-phases shouldn't be on a separate line here.

Fixed.

> 
>> +                  (delete 'configure)
>> +                  (delete 'check)
> 
> Prips has some tests, so don't delete this phase.

I tried to fix but this fails.

> 
>> +                  (replace 'install
>> +                    (lambda _
>> +                      (let*
>> +                          ((bin-dir  (string-append %output "/bin"))
>> +                           (bin-file (string-append bin-dir 
>> "/prips")))
> 
> The ((bin-dir ...)) should be on the same line as 'let*'.
> 
>> +                        (mkdir-p bin-dir)
>> +                        (copy-file "prips" bin-file)
>> +                        (chmod bin-file #o700)))))))
> 
> Why are you making bin/prips writable?  Shouldn't this be
> (chmod bin-file #o600) instead?

I don't know for sure why that happened, but it's fixed to #o600 now.

>> +    (synopsis "Tool that prints the IP addresses in a given range")
>> +    (description "Prips can be used to print all of the IP addresses 
>> in
>> + a given range.  This allows the enhancement of tools only work
> 
> ‘Enhancement’ is rather vague and leaning towards marketing-speak.
> I do not have an alternative suggestion however.

This was an exact quote from website or something.

>> +    (license license:gpl2)))
> 
> I looked at the source code and it seems prips is actually gpl2+.

Fixed.

> Greetings,
> Maxime.

Thanks for your review!

This is what it looks like now, and failing the check phase:

(define-public prips
  (package
    (name "prips")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://devel.ringlet.net/files/sys/"
                           name "/" name "-" version ".tar.xz"))
       (sha256
        (base32 
"1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn"))))
    (build-system gnu-build-system)
    (arguments
     `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))
       #:phases (modify-phases %standard-phases
                  (delete 'configure)
                                        ;(delete 'check)
                  (replace 'install
                    (lambda _
                      (let*
                          ((bin-dir  (string-append %output "/bin"))
                           (bin-file (string-append bin-dir "/prips")))
                        (mkdir-p bin-dir)
                        (copy-file "prips" bin-file)
                        (chmod bin-file #o600)))))))
    (synopsis "Tool that prints the IP addresses in a given range")
    (description "Prips can be used to print all of the IP addresses in
 a given range.  This allows the enhancement of tools only work
 on one host at a time (e.g. whois).")
    (home-page "https://devel.ringlet.net/sysutils/prips/")
    (license license:gpl2+)))

The logs:
---------------

starting phase `check'
make: *** No rule to make target 'check'.  Stop.

Test suite failed, dumping logs.
command "make" "check" "-j" "2" "CC=gcc" failed with status 2



Best regards,
David

---------------




Information forwarded to guix-patches <at> gnu.org:
bug#47540; Package guix-patches. (Mon, 05 Apr 2021 17:40:01 GMT) Full text and rfc822 format available.

Message #14 received at 47540 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: Guix-patches <guix-patches-bounces+david.larsson=selfhosted.xyz <at> gnu.org>,
 47540 <at> debbugs.gnu.org
Subject: Re: [bug#47540] [PATCH] gnu: Add prips.
Date: Mon, 05 Apr 2021 19:38:44 +0200
[Message part 1 (text/plain, inline)]
Here's a new patch which has the fixes you mentioned, except I still 
haven't readded the configure and test phases as I don't know how to 
make them work.

Best regards,
David
[0001-gnu-Add-prips.patch (text/x-diff, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47540; Package guix-patches. (Tue, 06 Apr 2021 14:05:01 GMT) Full text and rfc822 format available.

Message #17 received at 47540 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: david larsson <david.larsson <at> selfhosted.xyz>
Cc: Guix-patches <guix-patches-bounces+david.larsson=selfhosted.xyz <at> gnu.org>,
 47540 <at> debbugs.gnu.org
Subject: Re: [bug#47540] [PATCH] gnu: Add prips.
Date: Tue, 06 Apr 2021 16:04:27 +0200
[Message part 1 (text/plain, inline)]
[...]
> +(define-public prips
> +  (package
> +    (name "prips")
> +    (version "1.1.1")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://devel.ringlet.net/files/sys/"
> +                           name "/" name "-" version ".tar.xz"))
> +       (sha256
> +        (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn"))))
> +    (build-system gnu-build-system)

Add ‘(native-inputs `(("perl-test-harness" ,perl-test-harness)))’ such that
the makefile can find the 'prove' binary.

> +    (arguments
> +     `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))

Add ‘#:test-target "test"’ here, as the makefile has a 'test' target
instead of a 'check' target.

> +       #:phases (modify-phases %standard-phases
> +                  (delete 'configure)
> +                  (delete 'check)

and remove the (delete 'check).

The package now builds successfully for me.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47540; Package guix-patches. (Thu, 08 Apr 2021 19:30:01 GMT) Full text and rfc822 format available.

Message #20 received at 47540 <at> debbugs.gnu.org (full text, mbox):

From: david larsson <david.larsson <at> selfhosted.xyz>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: Guix-patches <guix-patches-bounces+david.larsson=selfhosted.xyz <at> gnu.org>,
 47540 <at> debbugs.gnu.org
Subject: Re: [bug#47540] [PATCH] gnu: Add prips.
Date: Thu, 08 Apr 2021 21:28:59 +0200
[Message part 1 (text/plain, inline)]
On 2021-04-06 16:04, Maxime Devos wrote:

> Add ‘(native-inputs `(("perl-test-harness" ,perl-test-harness)))’ such 
> that
> the makefile can find the 'prove' binary.

Fixed.

> 
> Add ‘#:test-target "test"’ here, as the makefile has a 'test' target
> instead of a 'check' target.
> 
>> +       #:phases (modify-phases %standard-phases
>> +                  (delete 'configure)
>> +                  (delete 'check)
> 
> and remove the (delete 'check).

Fixed.

> The package now builds successfully for me.

For me as well.

> Greetings,
> Maxime.

Thanks for your review and help with improving this package!

Best regards,
David
[0001-gnu-Add-prips.patch (text/x-diff, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 12 Apr 2021 10:48:02 GMT) Full text and rfc822 format available.

Notification sent to david larsson <david.larsson <at> selfhosted.xyz>:
bug acknowledged by developer. (Mon, 12 Apr 2021 10:48:02 GMT) Full text and rfc822 format available.

Message #25 received at 47540-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: david larsson <david.larsson <at> selfhosted.xyz>
Cc: 47540-done <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#47540: [PATCH] gnu: Add prips.
Date: Mon, 12 Apr 2021 12:47:41 +0200
[Message part 1 (text/plain, inline)]
Hi,

david larsson <david.larsson <at> selfhosted.xyz> skribis:

> From 85cf7b9d22801d9b3bac8956b358fce4c32dcb4c Mon Sep 17 00:00:00 2001
> From: methuselah-0 <david.larsson <at> selfhosted.xyz>
> Date: Thu, 8 Apr 2021 21:26:23 +0200
> Subject: [PATCH] gnu: Add prips.
>
> gnu/packages/admin.scm (prips): New variable.

[...]

> +                  (replace 'install
> +                    (lambda _
> +                      (let*
> +                          ((bin-dir  (string-append %output "/bin"))
> +                           (bin-file (string-append bin-dir "/prips")))
> +                        (mkdir-p bin-dir)
> +                        (copy-file "prips" bin-file)
> +                        (chmod bin-file #o600)))))))

That installed a non-executable file.  I fixed this with the patch
below, which also make the style more consistent.

Thanks David, and thanks Maxime for the review!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index f3e8774b75..512ac320e6 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1070,13 +1070,10 @@ recursive runs on the generated subnets.  (also IPv6)
        #:phases (modify-phases %standard-phases
                   (delete 'configure)
                   (replace 'install
-                    (lambda _
-                      (let*
-                          ((bin-dir  (string-append %output "/bin"))
-                           (bin-file (string-append bin-dir "/prips")))
-                        (mkdir-p bin-dir)
-                        (copy-file "prips" bin-file)
-                        (chmod bin-file #o600)))))))
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (install-file "prips"
+                                      (string-append out "/bin"))))))))
     (native-inputs `(("perl-test-harness" ,perl-test-harness)))
     (synopsis "Tool that prints the IP addresses in a given range")
     (description "Prips can be used to print all of the IP addresses in

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 May 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.