all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* File not found during package build
@ 2021-07-24 18:32 phodina
  2021-08-18 14:41 ` zimoun
  0 siblings, 1 reply; 4+ messages in thread
From: phodina @ 2021-07-24 18:32 UTC (permalink / raw)
  To: help-guix@gnu.org

Hi All,

during package build in the phase `check` I get a strange error regarding file not found.

The file in question is an executable script within the directory.

It must be present there as the chmod operation succeeds.
However, invocation of make then fails as it can't find the script.

phase `build' succeeded after 0.1 seconds
starting phase `check'
make: Entering directory '/tmp/guix-build-novaboot-20210126a.drv-0/source/tests'
./wvtool runall ./novaboot.wv ./parser.wv ./expect.wv ./server.wv ./uboot.wv
make: ./wvtool: No such file or directory
make: *** [Makefile:6: all] Error 127

---
(define-public novaboot
(package
  (name "novaboot")
  (version "20210126a")
  (source (origin
            (method git-fetch)
            (uri
	      (git-reference
		(url "https://github.com/wentasah/novaboot")
		(commit version)))
            (sha256
             (base32
              "1xwgxpngjp345fg4xmacyxm21wqvx4h6n6b51wnvivvzjj9vga4z"))))
  (build-system gnu-build-system)
  (inputs `(("perl" ,perl) ("perl-expect" ,perl-expect)))
  (arguments
    '(#:phases (modify-phases %standard-phases
		(delete 'configure)
		 (add-before 'build 'set-prefix-in-makefile
                    (lambda* (#:key outputs #:allow-other-keys)
                     (let ((out (assoc-ref outputs "out")))
                        (substitute* "Makefile"
                          (("PREFIX=.*")
                           (string-append "PREFIX="
                                           "\n")))
			(substitute* "Makefile"
				     (("DESTDIR=.*")
				      (string-append "DESTDIR=" out "\n"))))
		      ))
		 (replace 'check
			     (lambda* (#:key outputs #:allow-other-keys)
				      (chdir "tests")
				     (chmod "wvtool" #o555)
				     (invoke "make"))))))
  (synopsis "A tool that automates booting of operating systems on target hardware or in qemu")
  (description "Novaboot is a tool that automates booting of operating systems on target hardware (typically embedded boards) or in Qemu. Initially, it was developed to boot NOVA Microhypervisor (hence the name), but nowadays is well suited for booting Linux (and perhaps other OSes) too.")
  (home-page "https://github.com/wentasah/novaboot")
  (license license:gpl2)))


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

* Re: File not found during package build
@ 2021-07-24 21:52 Sarah Morgensen
  2021-07-25 19:09 ` phodina
  0 siblings, 1 reply; 4+ messages in thread
From: Sarah Morgensen @ 2021-07-24 21:52 UTC (permalink / raw)
  To: phodina; +Cc: help-guix@gnu.org

Hello,

phodina <phodina@protonmail.com> writes:

> Hi All,
>
> during package build in the phase `check` I get a strange error regarding file not found.
>
> The file in question is an executable script within the directory.
>
> It must be present there as the chmod operation succeeds.
> However, invocation of make then fails as it can't find the script.
>
> phase `build' succeeded after 0.1 seconds
> starting phase `check'
> make: Entering directory '/tmp/guix-build-novaboot-20210126a.drv-0/source/tests'
> ./wvtool runall ./novaboot.wv ./parser.wv ./expect.wv ./server.wv ./uboot.wv
> make: ./wvtool: No such file or directory
> make: *** [Makefile:6: all] Error 127

The issue here is that wvtool begins with the shebang

  #!/usr/bin/env python3

so you'll need python in native-inputs.

>
> ---
> (define-public novaboot
> (package
>   (name "novaboot")
>   (version "20210126a")
>   (source (origin
>             (method git-fetch)
>             (uri
> 	      (git-reference
> 		(url "https://github.com/wentasah/novaboot")
> 		(commit version)))
>             (sha256
>              (base32
>               "1xwgxpngjp345fg4xmacyxm21wqvx4h6n6b51wnvivvzjj9vga4z"))))
>   (build-system gnu-build-system)
>   (inputs `(("perl" ,perl) ("perl-expect" ,perl-expect)))
>   (arguments
>     '(#:phases (modify-phases %standard-phases
> 		(delete 'configure)
> 		 (add-before 'build 'set-prefix-in-makefile
>                     (lambda* (#:key outputs #:allow-other-keys)
>                      (let ((out (assoc-ref outputs "out")))
>                         (substitute* "Makefile"
>                           (("PREFIX=.*")
>                            (string-append "PREFIX="
>                                            "\n")))
> 			(substitute* "Makefile"
> 				     (("DESTDIR=.*")
> 				      (string-append "DESTDIR=" out "\n"))))
> 		      ))
> 		 (replace 'check
> 			     (lambda* (#:key outputs #:allow-other-keys)
> 				      (chdir "tests")
> 				     (chmod "wvtool" #o555)
> 				     (invoke "make"))))))

Also, the main Makefile has a 'test' target so you can just use

  #:test-target "test"

in arguments rather than replacing the check phase.

>   (synopsis "A tool that automates booting of operating systems on target hardware or in qemu")
>   (description "Novaboot is a tool that automates booting of operating systems on target hardware (typically embedded boards) or in Qemu. Initially, it was developed to boot NOVA Microhypervisor (hence the name), but nowadays is well suited for booting Linux (and perhaps other OSes) too.")
>   (home-page "https://github.com/wentasah/novaboot")
>   (license license:gpl2)))

Hope that helps,
Sarah


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

* Re: File not found during package build
  2021-07-24 21:52 File not found during package build Sarah Morgensen
@ 2021-07-25 19:09 ` phodina
  0 siblings, 0 replies; 4+ messages in thread
From: phodina @ 2021-07-25 19:09 UTC (permalink / raw)
  To: help-guix@gnu.org; +Cc: Sarah Morgensen

Thanks Sarah.

Sure, I'll stick with the standard way to run the check phase.


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

* Re: File not found during package build
  2021-07-24 18:32 phodina
@ 2021-08-18 14:41 ` zimoun
  0 siblings, 0 replies; 4+ messages in thread
From: zimoun @ 2021-08-18 14:41 UTC (permalink / raw)
  To: phodina, help-guix@gnu.org

Hi,

On Sat, 24 Jul 2021 at 18:32, phodina <phodina@protonmail.com> wrote:

> (define-public novaboot
> (package
>   (name "novaboot")
>   (version "20210126a")
>   (source (origin
>             (method git-fetch)
>             (uri
> 	      (git-reference
> 		(url "https://github.com/wentasah/novaboot")
> 		(commit version)))
>             (sha256
>              (base32
>               "1xwgxpngjp345fg4xmacyxm21wqvx4h6n6b51wnvivvzjj9vga4z"))))
>   (build-system gnu-build-system)
>   (inputs `(("perl" ,perl) ("perl-expect" ,perl-expect)))

Where is defined the symbol ’perl-expect’?

>   (arguments
>     '(#:phases (modify-phases %standard-phases
> 		(delete 'configure)
> 		 (add-before 'build 'set-prefix-in-makefile
>                     (lambda* (#:key outputs #:allow-other-keys)
>                      (let ((out (assoc-ref outputs "out")))
>                         (substitute* "Makefile"
>                           (("PREFIX=.*")
>                            (string-append "PREFIX="
>                                            "\n")))
> 			(substitute* "Makefile"
> 				     (("DESTDIR=.*")
> 				      (string-append "DESTDIR=" out "\n"))))
> 		      ))
> 		 (replace 'check
> 			     (lambda* (#:key outputs #:allow-other-keys)
> 				      (chdir "tests")
> 				     (chmod "wvtool" #o555)
> 				     (invoke "make"))))))
>   (synopsis "A tool that automates booting of operating systems on target hardware or in qemu")
>   (description "Novaboot is a tool that automates booting of operating systems on target hardware (typically embedded boards) or in Qemu. Initially, it was developed to boot NOVA Microhypervisor (hence the name), but nowadays is well suited for booting Linux (and perhaps other OSes) too.")
>   (home-page "https://github.com/wentasah/novaboot")
>   (license license:gpl2)))

Then I get this, which means that it also depends on Python.  See in the log:

--8<---------------cut here---------------start------------->8---
starting phase `patch-generated-file-shebangs'

[...]

patch-shebang: ./tests/wvtool: warning: no binary for interpreter `python3' found in $PATH
--8<---------------cut here---------------end--------------->8---

Adding Python in the ’inputs’ list, I get:

--8<---------------cut here---------------start------------->8---
starting phase `check'
./wvtool runall ./novaboot.wv ./parser.wv ./expect.wv ./server.wv ./uboot.wv
Traceback (most recent call last):
  File "./wvtool", line 131, in <module>
    term = Term()
  File "./wvtool", line 71, in __init__
    if os.environ['TERM'] == 'dumb':
  File "/gnu/store/9w9jvy3bgjg4qaqmrij01nbppiccqr7c-python-3.8.2/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'TERM'
make: *** [Makefile:6: all] Error 1
--8<---------------cut here---------------end--------------->8---

Note that I am not convinced that ’chmod’ is required here.

Well to be continued to have the package working. ;-)

Hope that helps,
simon


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

end of thread, other threads:[~2021-08-18 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 21:52 File not found during package build Sarah Morgensen
2021-07-25 19:09 ` phodina
  -- strict thread matches above, loose matches on Subject: below --
2021-07-24 18:32 phodina
2021-08-18 14:41 ` zimoun

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.