all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* cmake-build-system: modify-phases picks up wrong %standard-phases
@ 2020-01-18 12:02 Hartmut Goebel
  2020-01-20  9:18 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Goebel @ 2020-01-18 12:02 UTC (permalink / raw)
  To: Guix-devel

Hi,

I experience a strange problem: The package below (stripped down to show
the issue) uses the `qt-build-system`.

When running as shown, the build fails, since the `configure` phase is
taken from gnu-build-system.

It works fine, when modifying `(@ (guix build cmake-build-system)
%standard-phases)` instad of just %standard-phases` but - as prepared in
the line above.

It also works fine when not setting `#:modules`. (Setting `#:modules` is
required since in the real package definition some phase uses
`get-string-all` from (ice-9 textual-ports), which needs to be added to
`#:modules`).

What might cause this issue?

Actual behavior: Running `guix build -f ...` on the package definition
below fails with error message ".../configure: No such file or directory
… command "…/configure" failed with status 127" - which means the phase
`configure is taken from gnu-build-system.

Expected behavior: Running `guix build -f ...` on the package definition
below fails with error message "Configuring incomplete, errors occurred
… command "cmake" … failed with status 1" - which means the phase
`configure is taken from cmake-build-system.

(use-modules (guix packages)
         (guix build-system cmake)
         (guix download))
;; This package definition is stripped down to show the bug
(package
  (name "akonadi")
  (version "19.08.3")
  (source
   (origin
     (method url-fetch)
     (uri (string-append "mirror://kde/stable/applications/" version
             "/src/akonadi-" version ".tar.xz"))
     (sha256
      (base32 "0v7f1049wjnqxhwxr1443wc2cfbdqmf15xcwjz3j1m0vgdva9pyg"))))
  (build-system cmake-build-system)
  (arguments
   `(;;#:modules (,@%cmake-build-system-modules)
     #:phases
     ;;(modify-phases (@ (guix build cmake-build-system) %standard-phases)
     (modify-phases %standard-phases
       (add-after 'configure 'dummy
         (lambda _
       #t)))))
  (home-page "")
  (synopsis "")
  (description "")
  (license #f))

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: cmake-build-system: modify-phases picks up wrong %standard-phases
  2020-01-18 12:02 cmake-build-system: modify-phases picks up wrong %standard-phases Hartmut Goebel
@ 2020-01-20  9:18 ` Ludovic Courtès
  2020-01-23 13:55   ` Hartmut Goebel
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2020-01-20  9:18 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: Guix-devel

Hi Hartmut,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> I experience a strange problem: The package below (stripped down to show
> the issue) uses the `qt-build-system`.
>
> When running as shown, the build fails, since the `configure` phase is
> taken from gnu-build-system.
>
> It works fine, when modifying `(@ (guix build cmake-build-system)
> %standard-phases)` instad of just %standard-phases` but - as prepared in
> the line above.
>
> It also works fine when not setting `#:modules`. (Setting `#:modules` is
> required since in the real package definition some phase uses
> `get-string-all` from (ice-9 textual-ports), which needs to be added to
> `#:modules`).
>
> What might cause this issue?


[...]

>   (build-system cmake-build-system)
>   (arguments
>    `(;;#:modules (,@%cmake-build-system-modules)

The problem stems from a confusion between “imported modules” and
“modules in scope” (don’t worry, you’re not the first one to be tripped
up by this!).

‘%cmake-build-system-modules’ and similarly-named variables contain the
closure of the modules to be _imported_ on the build side for
‘cmake-build-system’ to work.

However, the modules that you want _in scope_ are only those used as the
default value of #:modules in ‘cmake-build’, namely:

  ((guix build cmake-build-system)
   (guix build utils))

If you do:

  #:modules ,%cmake-build-system-modules

then you’re also putting (guix build gnu-build-system) in scope, hence
the collision for the ‘%standard-phases’ binding.

HTH!

Ludo’.

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

* Re: cmake-build-system: modify-phases picks up wrong %standard-phases
  2020-01-20  9:18 ` Ludovic Courtès
@ 2020-01-23 13:55   ` Hartmut Goebel
  0 siblings, 0 replies; 3+ messages in thread
From: Hartmut Goebel @ 2020-01-23 13:55 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

Hi Ludo,

thanks for the explanation.
> If you do:
>
>   #:modules ,%cmake-build-system-modules
>
> then you’re also putting (guix build gnu-build-system) in scope, hence
> the collision for the ‘%standard-phases’ binding.

I wonder whether this could this be avoided by changing the order:

  (define %cmake-build-system-modules
    `((guix build cmake-build-system)
      ,@%gnu-build-system-modules))

into

  (define %cmake-build-system-modules
    `(,@%gnu-build-system-modules
      (guix build cmake-build-system)))

Or whether we should change `%standard-phases` int
`%camek-standard-phases` (and reps. for the other build-systems)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

end of thread, other threads:[~2020-01-23 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18 12:02 cmake-build-system: modify-phases picks up wrong %standard-phases Hartmut Goebel
2020-01-20  9:18 ` Ludovic Courtès
2020-01-23 13:55   ` Hartmut Goebel

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.