all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* error building new package (In procedure chdir: Not a directory)
@ 2021-06-17 15:22 Giovanni Biscuolo
  2021-06-17 20:52 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Biscuolo @ 2021-06-17 15:22 UTC (permalink / raw)
  To: guix-devel

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

Hello,

I'm trying to apply a patch to the ruby-taskjuggler package I'm
developing (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49042)

If I try to add the patch this way:

--8<---------------cut here---------------start------------->8---

(define-public ruby-taskjuggler
  (package
    (name "ruby-taskjuggler")
    (version "3.7.1")
    (source
     (origin
       (method url-fetch)
       (uri (rubygems-uri "taskjuggler" version))
       (sha256
        (base32
         "1jrsajzhzpnfa8hj6lbf7adn8hls56dz3yw1gvzgz9y4zkka3k9v"))
       (patches (search-patches "ruby-taskjuggler-fix-TjTime.patch"))))
    (build-system ruby-build-system)
    (native-inputs `(("tzdata" ,tzdata-for-tests)))
    (propagated-inputs
     `(("ruby-mail" ,ruby-mail)
       ("ruby-term-ansicolor" ,ruby-term-ansicolor)))
       ;;("ruby-activesupport" ,ruby-activesupport)))
    (arguments
     '(#:phases (modify-phases %standard-phases
                  (replace 'replace-git-ls-files
                    (lambda _
                      (substitute* "tasks/rdoc.rake"
                        (("`git ls-files -- lib`")
                         "`find lib/ -type f |sort`"))
                      #t))
                  (add-before 'check 'tzdir-setup
                    (lambda* (#:key inputs #:allow-other-keys)
                      (setenv "TZDIR"
                              (string-append (assoc-ref inputs "tzdata")
                                             "/share/zoneinfo"))
                      #t))
                  (add-before 'check 'delete-test-BatchProcessor
                    ;; test_BatchProcessor fails with exeption:
                    ;; run> terminated with exception (report_on_exception is true)
                    (lambda _
                      (delete-file "test/test_BatchProcessor.rb")
                      #t)))))
    (synopsis
     "Project management command line tool with a domain specific language")
    (description
     "TaskJuggler (tj3) is a project management tool for project planning and
tracking using a domain specific language; projects are plain text files
written using your favourite text editor.  It includes reporting in HTML, CSV
or iCalendar format and an email based status tracking system to send and
receive time sheets from collaborators.

It covers the complete spectrum of project management tasks from the first
idea to the completion of the project.  It assists you during project scoping,
resource assignment, cost and revenue planning, risk and communication
management, status tracking and reporting.")
    (home-page "https://taskjuggler.org")
    (license license:gpl2)))

--8<---------------cut here---------------end--------------->8---

I'm sure the patch is in
gnu/packages/patches/ruby-taskjuggler-fix-TjTime.patch

If I try to build the package I get this error:

--8<---------------cut here---------------start------------->8---

giovanni@roquette: ./pre-inst-env guix build ruby-taskjuggler
;;; note: source file /home/giovanni/{git}/giovanni.biscuolo.net/guix/gnu/packages/ruby.scm
;;;       newer than compiled /home/giovanni/{git}/giovanni.biscuolo.net/guix/gnu/packages/ruby.go
;;; note: source file /home/giovanni/{git}/giovanni.biscuolo.net/guix/gnu/packages/ruby.scm
;;;       newer than compiled /home/giovanni/.cache/guile/ccache/3.0-LE-8-4.5/home/giovanni/{git}/giovanni.biscuolo.net/guix/gnu/packages/ruby.scm.go
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/h6rqz0sv0cccjkrrljwmd3i43r307dgn-ruby-taskjuggler-3.7.1.drv
   /gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv
process 26694 acquired build slot '/var/guix/offload/batondor:22/0'
normalized load on machine 'batondor' is 0.00
building /gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv...
guix offload: sending 3 store items (0 MiB) to 'batondor'...
exporting path `/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjpd5bwv-taskjuggler-3.7.1.tar.xz-builder'
exporting path `/gnu/store/qrsggdlpx3zm8p9x9gpxx88d02wwrkz7-ruby-taskjuggler-fix-TjTime.patch'
exporting path `/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv'
offloading '/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv' to 'batondor'...
offloading build of /gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv to 'batondor'
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
@ build-started /gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv - x86_64-linux /var/log/guix/drvs/i4//zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv.bz2 21469
metadata.gz
data.tar.gz
checksums.yaml.gz
source is under 'checksums.yaml.gz'
Backtrace:
           2 (primitive-load "/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjp?")
In ice-9/eval.scm:
    619:8  1 (_ #(#<directory (guile-user) 7ffff3bb3f00> "checksum?"))
In unknown file:
           0 (chdir "checksums.yaml.gz")

ERROR: In procedure chdir:
In procedure chdir: Not a directory
builder for `/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv' failed with exit code 1
@ build-failed /gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv - 1 builder for `/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv' failed with exit code 1
derivation '/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv' offloaded to 'batondor' failed: build of `/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv' failed
build of /gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv failed
Could not find build log for '/gnu/store/i4zcbalzjp3khlcw0haf82y6syxkvz10-taskjuggler-3.7.1.tar.xz.drv'.
cannot build derivation `/gnu/store/h6rqz0sv0cccjkrrljwmd3i43r307dgn-ruby-taskjuggler-3.7.1.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/h6rqz0sv0cccjkrrljwmd3i43r307dgn-ruby-taskjuggler-3.7.1.drv' failed

--8<---------------cut here---------------end--------------->8---

Please what I'm doing wrong?

Thanks! Giovanni.

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

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

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

* Re: error building new package (In procedure chdir: Not a directory)
  2021-06-17 15:22 error building new package (In procedure chdir: Not a directory) Giovanni Biscuolo
@ 2021-06-17 20:52 ` Tobias Geerinckx-Rice
  2021-06-17 22:24   ` Tobias Geerinckx-Rice
  2021-06-22 15:36   ` Giovanni Biscuolo
  0 siblings, 2 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-06-17 20:52 UTC (permalink / raw)
  To: Giovanni Biscuolo; +Cc: guix-devel

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

Giovanni,

Giovanni Biscuolo 写道:
> If I try to build the package I get this error:
[…]

Your source tarball contains multiple gzipped files, one of which 
itself a tarball:

> metadata.gz
> data.tar.gz
> checksums.yaml.gz
> source is under 'checksums.yaml.gz'
> Backtrace:
>            2 (primitive-load 
>            "/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjp?")
> In ice-9/eval.scm:
>     619:8  1 (_ #(#<directory (guile-user) 7ffff3bb3f00> 
>     "checksum?"))
> In unknown file:
>            0 (chdir "checksums.yaml.gz")
>
> ERROR: In procedure chdir:
> In procedure chdir: Not a directory

Guix's heuristic is very simple: chdir to the first (or last, 
dunno) file it finds in a tarball, because foo-1.2.3.tar.gz is 
expected to contain a single foo-1.2.3 directory.  It usually 
works, but here it fails, so you need to use url-fetch/tarball 
and/or further unpack the double-packed sources yourself in a 
custom phase.

Kind regards,

T G-R

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

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

* Re: error building new package (In procedure chdir: Not a directory)
  2021-06-17 20:52 ` Tobias Geerinckx-Rice
@ 2021-06-17 22:24   ` Tobias Geerinckx-Rice
  2021-06-22 15:36   ` Giovanni Biscuolo
  1 sibling, 0 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-06-17 22:24 UTC (permalink / raw)
  Cc: Giovanni Biscuolo, guix-devel

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

Tobias Geerinckx-Rice 写道:
> url-fetch/tarball

Typo: /tarbomb.

Kind regards,

T G-R

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

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

* Re: error building new package (In procedure chdir: Not a directory)
  2021-06-17 20:52 ` Tobias Geerinckx-Rice
  2021-06-17 22:24   ` Tobias Geerinckx-Rice
@ 2021-06-22 15:36   ` Giovanni Biscuolo
  2021-06-22 16:35     ` Giovanni Biscuolo
  1 sibling, 1 reply; 7+ messages in thread
From: Giovanni Biscuolo @ 2021-06-22 15:36 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

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

Hello Tobias,

thank you for your help,

Tobias Geerinckx-Rice <me@tobias.gr> writes:

> Giovanni Biscuolo 写道:
>> If I try to build the package I get this error:
> […]
>
> Your source tarball contains multiple gzipped files, one of which 
> itself a tarball:
>
>> metadata.gz
>> data.tar.gz
>> checksums.yaml.gz
>> source is under 'checksums.yaml.gz'
>> Backtrace:
>>            2 (primitive-load 
>>            "/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjp?")
>> In ice-9/eval.scm:
>>     619:8  1 (_ #(#<directory (guile-user) 7ffff3bb3f00> 
>>     "checksum?"))
>> In unknown file:
>>            0 (chdir "checksums.yaml.gz")
>>
>> ERROR: In procedure chdir:
>> In procedure chdir: Not a directory
>
> Guix's heuristic is very simple: chdir to the first (or last, 
> dunno) file it finds in a tarball, because foo-1.2.3.tar.gz is 
> expected to contain a single foo-1.2.3 directory.  It usually 
> works, but here it fails,

Yes but it fails only if I try to apply the patch, if I remove the patch
(as in the v2 patch provided in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49042#26) the package
succesfully builds; I need to apply a patch to try fix a bug in the
package.

> so you need to use url-fetch/tarball and/or further unpack the
> double-packed sources yourself in a custom phase.

I'll try to do this: any example at hand please?

One last question: may it be a ruby-build-system issue?

Thank you! Giovanni.

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

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

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

* Re: error building new package (In procedure chdir: Not a directory)
  2021-06-22 15:36   ` Giovanni Biscuolo
@ 2021-06-22 16:35     ` Giovanni Biscuolo
  2021-06-22 17:50       ` Julien Lepiller
  0 siblings, 1 reply; 7+ messages in thread
From: Giovanni Biscuolo @ 2021-06-22 16:35 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: guix-devel

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

Hello,

some more info since I still do not understand where *.gz files are
coming from

Giovanni Biscuolo <g@xelera.eu> writes:

[...]

>> Your source tarball contains multiple gzipped files, one of which 
>> itself a tarball:
>>
>>> metadata.gz
>>> data.tar.gz
>>> checksums.yaml.gz
>>> source is under 'checksums.yaml.gz'
>>> Backtrace:
>>>            2 (primitive-load 
>>>            "/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjp?")
>>> In ice-9/eval.scm:
>>>     619:8  1 (_ #(#<directory (guile-user) 7ffff3bb3f00> 
>>>     "checksum?"))
>>> In unknown file:
>>>            0 (chdir "checksums.yaml.gz")
>>>
>>> ERROR: In procedure chdir:
>>> In procedure chdir: Not a directory

If I build the package with "--keep-failed" I can inspect the kept
building dir /home/guix-builder/guix-build-ruby-taskjuggler-3.7.1.drv-4,
and there are no *.gz files

[...]

>> so you need to use url-fetch/tarball and/or further unpack the
>> double-packed sources yourself in a custom phase.
>
> I'll try to do this: any example at hand please?

I've found and tried this:

--8<---------------cut here---------------start------------->8---

                  (add-after 'unpack 'unpack-bundled-sources
                    (lambda _
                      (with-directory-excursion "."
                        (invoke "tar" "xf" "checksums.yaml.gz"))))

--8<---------------cut here---------------end--------------->8---

but it fails:

--8<---------------cut here---------------start------------->8---

starting phase `unpack-bundled-sources'
tar: checksums.yaml.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
command "tar" "xf" "checksums.yaml.gz" failed with status 2

--8<---------------cut here---------------end--------------->8---

I still don't understand why appying a patch (with "(patches
(search-patches....))" in (source (origin...)) is failing.

Thanks! Giovanni

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

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

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

* Re: error building new package (In procedure chdir: Not a directory)
  2021-06-22 16:35     ` Giovanni Biscuolo
@ 2021-06-22 17:50       ` Julien Lepiller
  2021-06-23  6:50         ` Giovanni Biscuolo
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Lepiller @ 2021-06-22 17:50 UTC (permalink / raw)
  To: guix-devel, Giovanni Biscuolo, Tobias Geerinckx-Rice

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

I think that's because the patch first extracts the archive, chdirs to the first directory, and applies the patch. But if there's no directory, it can't chdir and fails.

Note that (with-directory-excursion ".") does nothing :)

Le 22 juin 2021 12:35:45 GMT-04:00, Giovanni Biscuolo <g@xelera.eu> a écrit :
>Hello,
>
>some more info since I still do not understand where *.gz files are
>coming from
>
>Giovanni Biscuolo <g@xelera.eu> writes:
>
>[...]
>
>>> Your source tarball contains multiple gzipped files, one of which 
>>> itself a tarball:
>>>
>>>> metadata.gz
>>>> data.tar.gz
>>>> checksums.yaml.gz
>>>> source is under 'checksums.yaml.gz'
>>>> Backtrace:
>>>>            2 (primitive-load 
>>>>            "/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjp?")
>>>> In ice-9/eval.scm:
>>>>     619:8  1 (_ #(#<directory (guile-user) 7ffff3bb3f00> 
>>>>     "checksum?"))
>>>> In unknown file:
>>>>            0 (chdir "checksums.yaml.gz")
>>>>
>>>> ERROR: In procedure chdir:
>>>> In procedure chdir: Not a directory
>
>If I build the package with "--keep-failed" I can inspect the kept
>building dir
>/home/guix-builder/guix-build-ruby-taskjuggler-3.7.1.drv-4,
>and there are no *.gz files
>
>[...]
>
>>> so you need to use url-fetch/tarball and/or further unpack the
>>> double-packed sources yourself in a custom phase.
>>
>> I'll try to do this: any example at hand please?
>
>I've found and tried this:
>
>--8<---------------cut here---------------start------------->8---
>
>                  (add-after 'unpack 'unpack-bundled-sources
>                    (lambda _
>                      (with-directory-excursion "."
>                        (invoke "tar" "xf" "checksums.yaml.gz"))))
>
>--8<---------------cut here---------------end--------------->8---
>
>but it fails:
>
>--8<---------------cut here---------------start------------->8---
>
>starting phase `unpack-bundled-sources'
>tar: checksums.yaml.gz: Cannot open: No such file or directory
>tar: Error is not recoverable: exiting now
>command "tar" "xf" "checksums.yaml.gz" failed with status 2
>
>--8<---------------cut here---------------end--------------->8---
>
>I still don't understand why appying a patch (with "(patches
>(search-patches....))" in (source (origin...)) is failing.
>
>Thanks! Giovanni
>
>-- 
>Giovanni Biscuolo
>
>Xelera IT Infrastructures

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

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

* Re: error building new package (In procedure chdir: Not a directory)
  2021-06-22 17:50       ` Julien Lepiller
@ 2021-06-23  6:50         ` Giovanni Biscuolo
  0 siblings, 0 replies; 7+ messages in thread
From: Giovanni Biscuolo @ 2021-06-23  6:50 UTC (permalink / raw)
  To: Julien Lepiller, guix-devel, Tobias Geerinckx-Rice

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

Hello Julien and Tobias,

Julien Lepiller <julien@lepiller.eu> writes:

> I think that's because the patch first extracts the archive, chdirs to
> the first directory, and applies the patch. But if there's no
> directory, it can't chdir and fails.

Yes, that's the problem: I thought that

  (patches (search-patches "ruby-taskjuggler-fix-TjTime.patch"))

was working the same as with other (origin...)s declarations but AFAIU
it does not work with "rubygems-uri"s

> Note that (with-directory-excursion ".") does nothing :)

Oh OK, anyway that piece of code is useless since "after-unpack" there
are no more gzipped files... obviously they are already unpacked :-D

> Le 22 juin 2021 12:35:45 GMT-04:00, Giovanni Biscuolo <g@xelera.eu> a écrit :

[...]

>>>> Your source tarball contains multiple gzipped files, one of which 
>>>> itself a tarball:
>>>>
>>>>> metadata.gz
>>>>> data.tar.gz
>>>>> checksums.yaml.gz
>>>>> source is under 'checksums.yaml.gz'
>>>>> Backtrace:
>>>>>            2 (primitive-load 
>>>>>            "/gnu/store/0d1j4s7c1h8w6z700sxb88jqmjp?")
>>>>> In ice-9/eval.scm:
>>>>>     619:8  1 (_ #(#<directory (guile-user) 7ffff3bb3f00> 
>>>>>     "checksum?"))
>>>>> In unknown file:
>>>>>            0 (chdir "checksums.yaml.gz")
>>>>>
>>>>> ERROR: In procedure chdir:
>>>>> In procedure chdir: Not a directory

I'm new to gem's but after I've "manually" downloaded
https://rubygems.org/downloads/taskjuggler-3.7.1.gem I see that the
three files listed above are part of the gem file structure: I guess
ruby-build-system is trying to apply the patch before unpacking the *.gz
archives, but AFAIU it should do it after unpacking.

I'll try to study the code to see if I understand how it works
and if this is a bug, but unfortunately I've little time this days.

Thank you for your help! Giovanni

[...]

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

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

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

end of thread, other threads:[~2021-06-23  6:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-17 15:22 error building new package (In procedure chdir: Not a directory) Giovanni Biscuolo
2021-06-17 20:52 ` Tobias Geerinckx-Rice
2021-06-17 22:24   ` Tobias Geerinckx-Rice
2021-06-22 15:36   ` Giovanni Biscuolo
2021-06-22 16:35     ` Giovanni Biscuolo
2021-06-22 17:50       ` Julien Lepiller
2021-06-23  6:50         ` Giovanni Biscuolo

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.