diff mbox series

[bug#64081,1/2] gnu: fenics: Make sure 'jit.py' can find 'dolfin.pc'.

Message ID 9c787f4f582e4cfebd4349b15a3e88fe253627b9.1686843252.git.ludo@gnu.org
State New
Headers show
Series [bug#64081,1/2] gnu: fenics: Make sure 'jit.py' can find 'dolfin.pc'. | expand

Commit Message

Ludovic Courtès June 15, 2023, 3:35 p.m. UTC
From: Ludovic Courtès <ludovic.courtes@inria.fr>

* gnu/packages/simulation.scm (fenics)[inputs]: Move PYTHON-PKGCONFIG
to...
[propagated-inputs]: ... here.
[arguments]: Add 'set-dolfin-pc-file-name' phase.
---
 gnu/packages/simulation.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


base-commit: 26602f4063a6e0c626e8deb3423166bcd0abeb90

Comments

Ludovic Courtès June 24, 2023, 2:24 p.m. UTC | #1
Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

> From: Ludovic Courtès <ludovic.courtes@inria.fr>
>
> * gnu/packages/simulation.scm (fenics)[inputs]: Move PYTHON-PKGCONFIG
> to...
> [propagated-inputs]: ... here.
> [arguments]: Add 'set-dolfin-pc-file-name' phase.

I’m pushing v2 because it fixes a real issue and doesn’t introduce any
regression:

  https://qa.guix.gnu.org/issue/64081

However, the test suite appears to time out, at least occasionally, even
on x86_64:

  https://bordeaux.guix.gnu.org/build/ce84f62b-efc0-4519-94b2-c1debc54b752/log

The log ends like this:

--8<---------------cut here---------------start------------->8---
10/38 Test #20: demo_periodic_mpi ......................   Passed    9.24 sec
      Start 22: demo_poisson_mpi
11/38 Test #22: demo_poisson_mpi .......................   Passed    8.26 sec
      Start 24: demo_singular-poisson_mpi
12/38 Test #24: demo_singular-poisson_mpi ..............   Passed   12.59 sec
      Start 26: demo_stokes-iterative_mpi
--8<---------------cut here---------------end--------------->8---

Would be good to see if there’s a real problem hiding or if we’re
dealing with a long-running test or something.

This is not a regression AFAICS:

--8<---------------cut here---------------start------------->8---
$ guix weather fenics-dolfin
computing 1 package derivations for x86_64-linux...
looking for 1 store items on https://ci.guix.gnu.org...
https://ci.guix.gnu.org ⛈
  0.0% substitutes available (0 out of 1)
  unknown substitute sizes
  0.0 MiB on disk (uncompressed)
  0.196 seconds per request (0.2 seconds in total)
  5.1 requests per second

  0.0% (0 out of 1) of the missing items are queued
  0 queued builds
  build rate: 12.96 builds per hour
      x86_64-linux: 4.93 builds per hour
      aarch64-linux: 2.28 builds per hour
      i686-linux: 4.00 builds per hour
      powerpc64le-linux: 1.85 builds per hour
      armhf-linux: 0.05 builds per hour
looking for 1 store items on https://bordeaux.guix.gnu.org...
https://bordeaux.guix.gnu.org ⛈
  0.0% substitutes available (0 out of 1)
  unknown substitute sizes
  0.0 MiB on disk (uncompressed)
  0.153 seconds per request (0.2 seconds in total)
  6.5 requests per second
  (continuous integration information unavailable)
$ guix describe
Generation 267  Jun 19 2023 00:15:56    (current)
  guix bf9afed
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: bf9afedef9c55aa0092b562077d9f2c743d9a29c
--8<---------------cut here---------------end--------------->8---

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 059be5a2be..9eeb57babe 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -716,12 +716,14 @@  (define-public fenics
        ("ply" ,python-ply)
        ("pytest" ,python-pytest)
        ("python-decorator" ,python-decorator)
-       ("python-pkgconfig" ,python-pkgconfig)
        ,@(package-native-inputs fenics-dolfin)))
     (propagated-inputs
      `(("dolfin" ,fenics-dolfin)
        ("petsc4py" ,python-petsc4py)
-       ("slepc4py" ,python-slepc4py)))
+       ("slepc4py" ,python-slepc4py)
+
+       ;; 'dolfin/jit/jit.py' parses 'dolfin.pc' at run time.
+       ("python-pkgconfig" ,python-pkgconfig)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -729,6 +731,15 @@  (define-public fenics
            (lambda _
              (substitute* "python/setup.py"
                (("pybind11==") "pybind11>="))))
+         (add-after 'unpack 'set-dolfin-pc-file-name
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Instead of cluttering the user's 'PKG_CONFIG_PATH' environment
+             ;; variable, hard-code the 'dolfin.pc' absolute file name.
+             (let ((pc-file (search-input-file inputs
+                                               "/lib/pkgconfig/dolfin.pc")))
+               (substitute* "python/dolfin/jit/jit.py"
+                 (("pkgconfig\\.parse\\(\"dolfin\"\\)")
+                  (string-append "pkgconfig.parse(\"" pc-file "\")"))))))
          (add-after 'patch-source-shebangs 'set-paths
            (lambda _
              ;; Define paths to store locations.