unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fcgiwrap doesn't see gzip
@ 2017-12-01 11:49 Oleg Pykhalov
  0 siblings, 0 replies; 6+ messages in thread
From: Oleg Pykhalov @ 2017-12-01 11:49 UTC (permalink / raw)
  To: guix-devel

Hello Guix, cgit service through fcgiwrap doesn't see gzip.

/run/current-system/profile/bin/gzip exists.

fcgiwrap strace: http://paste.debian.net/998501

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

* fcgiwrap doesn't see gzip
@ 2017-12-01 12:48 Oleg Pykhalov
  2017-12-04  9:04 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Oleg Pykhalov @ 2017-12-01 12:48 UTC (permalink / raw)
  To: guix-devel

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

strace log from my previous message, apologies.

I guess, the issue is because fcgiwrap process environment PATH only
contains /gnu/store/…-shadow-4.5/sbin which doesn't include gzip.

--8<---------------cut here---------------start------------->8---
$ sudo strace -s 128 -p 457
strace: Process 457 attached
accept(0, {sa_family=AF_INET, sin_port=htons(57088), sin_addr=inet_addr("127.0.0.1")}, [112->16]) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
read(3, "\1\1\0\1\0\10\0\0\0\1\0\0\0\0\0\0\1\4\0\1\1!\7\0\17FSCRIPT_FILENAME/gnu/store/27ki0l76vn23698caynfknbcnqf5jag0-cgit-1.1/lib/cgit/cgit.cgi\t&PATH_INFO/guix/"..., 8192) = 336
pipe([4, 5])                            = 0
pipe([6, 7])                            = 0
pipe([8, 9])                            = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ff3f0dc4e10) = 12762
close(4)                                = 0
close(7)                                = 0
close(9)                                = 0
close(5)                                = 0
select(9, [6 8], NULL, NULL, NULL)      = 1 (in [8])
read(8, "[cgit] Unable to lock slot /var/cache/cgit/8a300000.lock: Permission denied (13)\n", 4096) = 81
write(2, "[cgit] Unable to lock slot /var/cache/cgit/8a300000.lock: Permission denied (13)\n", 81) = 81
select(9, [6 8], NULL, NULL, NULL)      = 1 (in [6])
read(6, "Content-Type: application/x-gzip; charset=UTF-8\nContent-Disposition: inline; filename=\"guix-0.13.0.tar.gz\"\n", 4096) = 107
select(9, [6 8], NULL, NULL, NULL)      = 1 (in [6])
read(6, "Last-Modified: Fri, 01 Dec 2017 11:42:10 GMT\nExpires: Fri, 01 Dec 2017 11:47:10 GMT\nETag: \"99d1ec5989eae66719fb968f41560f2879707"..., 4096) = 134
select(9, [6 8], NULL, NULL, NULL)      = 1 (in [8])
read(8, "fatal: Unable to exec subprocess gzip: No such file or directory\n", 4096) = 65
write(2, "fatal: Unable to exec subprocess gzip: No such file or directory\n", 65) = 65
select(9, [6 8], NULL, NULL, NULL)      = 2 (in [6 8])
read(6, "", 4096)                       = 0
close(6)                                = 0
read(8, "", 4096)                       = 0
close(8)                                = 0
write(3, "\1\6\0\1\0\367\1\0Content-Type: application/x-gzip; charset=UTF-8\r\nContent-Disposition: inline; filename=\"guix-0.13.0.tar.gz\"\r\nLast-Modifi"..., 280) = 280
shutdown(3, SHUT_WR)                    = 0
poll([{fd=3, events=POLLIN}], 1, 2000)  = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
read(3, "", 1024)                       = 0
close(3)                                = 0
accept(0,   C-c C-cstrace: Process 457 detached
 <detached ...>
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
/proc/457$ sudo cat environ
HOME=/
TERM=linux
BOOT_IMAGE=/gnu/store/nrhx7jf33zqxmbw832bpxyrnc0k3lrnq-linux-libre-4.14.2/bzImage --root=magnolia-root --system=/gnu/store/mqwc1vmlnx076aka7gn8bi89hmj6v3pq-system --load=/gnu/store/mqwc1vmlnx076aka7gn8bi89hmj6v3pq-system/boot
PATH=/gnu/store/a8arlhcrf70113zw7b3qrwqbqfq2hgj6-shadow-4.5/sbin
--8<---------------cut here---------------end--------------->8---

Thanks,
Oleg.

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

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

* Re: fcgiwrap doesn't see gzip
  2017-12-01 12:48 Oleg Pykhalov
@ 2017-12-04  9:04 ` Ludovic Courtès
  2017-12-12 15:41   ` Oleg Pykhalov
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-12-04  9:04 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: guix-devel

Hi Oleg,

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> strace log from my previous message, apologies.
>
> I guess, the issue is because fcgiwrap process environment PATH only
> contains /gnu/store/…-shadow-4.5/sbin which doesn't include gzip.

There are two possible fixes:

  1. Set PATH in the execution environment of ‘fcgiwrap’, just like the
     ‘mcron-shepherd-services’ procedure does;

  2. Add a build phase for ‘fcgiwrap’ that ensures that it refers to
     ‘gzip’ by its absolute file name.

I have a preference for #2 because it’s more robust.

Could you look into it?

Thanks,
Ludo’.

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

* Re: fcgiwrap doesn't see gzip
  2017-12-04  9:04 ` Ludovic Courtès
@ 2017-12-12 15:41   ` Oleg Pykhalov
  2017-12-12 16:09     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Oleg Pykhalov @ 2017-12-12 15:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 703 bytes --]

Hello Ludovic,

Thank you for directing me.

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

>> I guess, the issue is because fcgiwrap process environment PATH only
>> contains /gnu/store/…-shadow-4.5/sbin which doesn't include gzip.
>
> There are two possible fixes:
>
>   1. Set PATH in the execution environment of ‘fcgiwrap’, just like the
>      ‘mcron-shepherd-services’ procedure does;
>
>   2. Add a build phase for ‘fcgiwrap’ that ensures that it refers to
>      ‘gzip’ by its absolute file name.
>
> I have a preference for #2 because it’s more robust.
>
> Could you look into it?

Yes, but I solve this via cgit package.  I believe it's good enough. :-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: [PATCH] gnu: cgit: Patch absolute file names. --]
[-- Type: text/x-patch, Size: 2192 bytes --]

From 9c9ad2a3716b7ad97e80028e0424f3af6c3759a6 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Tue, 12 Dec 2017 18:29:23 +0300
Subject: [PATCH] gnu: cgit: Patch absolute file names.

* gnu/packages/version-control.scm (cgit): Patch absolute file names.
---
 gnu/packages/version-control.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 6820b28ba..654c63671 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -539,6 +539,21 @@ collaboration using typical untrusted file hosts or services.")
              (zero? (system*
                      "tar" "--strip-components=1" "-C" "git" "-xf"
                      (assoc-ref inputs "git:src")))))
+         (add-after 'unpack 'patch-absolute-file-names
+           (lambda* (#:key inputs #:allow-other-keys)
+             (define (quoted-path input path)
+               (string-append "\"" input path "\""))
+             (substitute* "ui-snapshot.c"
+               (("\"gzip\"")
+                (quoted-path (assoc-ref %build-inputs "gzip")
+                             "/bin/gzip"))
+               (("\"bzip2\"")
+                (quoted-path (assoc-ref %build-inputs "bzip2")
+                             "/bin/bzip2"))
+               (("\"xz\"")
+                (quoted-path (assoc-ref %build-inputs "xz")
+                             "/bin/xz")))
+             #t))
          (delete 'configure) ; no configure script
          (add-after 'build 'build-man
            (lambda* (#:key make-flags #:allow-other-keys)
@@ -559,7 +574,10 @@ collaboration using typical untrusted file hosts or services.")
                     #t)))))))
     (native-inputs
      ;; For building manpage.
-     `(("asciidoc" ,asciidoc)))
+     `(("asciidoc" ,asciidoc)
+       ("gzip" ,gzip)
+       ("bzip2" ,bzip2)
+       ("xz" ,xz)))
     (inputs
      `(;; Cgit directly accesses some internal Git interfaces that changed in
        ;; Git 2.12.  Try removing this special input and using the source of the
-- 
2.15.1


[-- Attachment #1.3: Type: text/plain, Size: 7 bytes --]


Oleg.

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

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

* Re: fcgiwrap doesn't see gzip
  2017-12-12 15:41   ` Oleg Pykhalov
@ 2017-12-12 16:09     ` Ludovic Courtès
  2017-12-13  2:20       ` Oleg Pykhalov
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2017-12-12 16:09 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: guix-devel

Hello,

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>>> I guess, the issue is because fcgiwrap process environment PATH only
>>> contains /gnu/store/…-shadow-4.5/sbin which doesn't include gzip.
>>
>> There are two possible fixes:
>>
>>   1. Set PATH in the execution environment of ‘fcgiwrap’, just like the
>>      ‘mcron-shepherd-services’ procedure does;
>>
>>   2. Add a build phase for ‘fcgiwrap’ that ensures that it refers to
>>      ‘gzip’ by its absolute file name.
>>
>> I have a preference for #2 because it’s more robust.
>>
>> Could you look into it?
>
> Yes, but I solve this via cgit package.  I believe it's good enough. :-)

Good!

> From 9c9ad2a3716b7ad97e80028e0424f3af6c3759a6 Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <go.wigust@gmail.com>
> Date: Tue, 12 Dec 2017 18:29:23 +0300
> Subject: [PATCH] gnu: cgit: Patch absolute file names.
>
> * gnu/packages/version-control.scm (cgit): Patch absolute file names.

[...]

> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (define (quoted-path input path)
> +               (string-append "\"" input path "\""))
> +             (substitute* "ui-snapshot.c"
> +               (("\"gzip\"")
> +                (quoted-path (assoc-ref %build-inputs "gzip")
> +                             "/bin/gzip"))
> +               (("\"bzip2\"")
> +                (quoted-path (assoc-ref %build-inputs "bzip2")
> +                             "/bin/bzip2"))
> +               (("\"xz\"")
> +                (quoted-path (assoc-ref %build-inputs "xz")
> +                             "/bin/xz")))

Use ‘inputs’ instead of ‘%build-inputs’ (it’s equivalent but IMO
clearer.)

Also I’d suggest “quoted-file-name” or just “quoted” instead of
“quoted-path”.  :-)

OK with changes along these lines, thank you!

Ludo’.

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

* Re: fcgiwrap doesn't see gzip
  2017-12-12 16:09     ` Ludovic Courtès
@ 2017-12-13  2:20       ` Oleg Pykhalov
  0 siblings, 0 replies; 6+ messages in thread
From: Oleg Pykhalov @ 2017-12-13  2:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

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

Hello Ludovic,

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

[...]

>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (define (quoted-path input path)
>> +               (string-append "\"" input path "\""))
>> +             (substitute* "ui-snapshot.c"
>> +               (("\"gzip\"")
>> +                (quoted-path (assoc-ref %build-inputs "gzip")
>> +                             "/bin/gzip"))
>> +               (("\"bzip2\"")
>> +                (quoted-path (assoc-ref %build-inputs "bzip2")
>> +                             "/bin/bzip2"))
>> +               (("\"xz\"")
>> +                (quoted-path (assoc-ref %build-inputs "xz")
>> +                             "/bin/xz")))
>
> Use ‘inputs’ instead of ‘%build-inputs’ (it’s equivalent but IMO
> clearer.)
>
> Also I’d suggest “quoted-file-name” or just “quoted” instead of
> “quoted-path”.  :-)

OK, thanks.

> OK with changes along these lines, thank you!

Pushed as 91b21ba9f712bce033b717422c3d2022ffe8a70a

Oleg.

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

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

end of thread, other threads:[~2017-12-13  2:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-01 11:49 fcgiwrap doesn't see gzip Oleg Pykhalov
  -- strict thread matches above, loose matches on Subject: below --
2017-12-01 12:48 Oleg Pykhalov
2017-12-04  9:04 ` Ludovic Courtès
2017-12-12 15:41   ` Oleg Pykhalov
2017-12-12 16:09     ` Ludovic Courtès
2017-12-13  2:20       ` Oleg Pykhalov

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