diff mbox series

[bug#70056,RFC] draft: gnu: Add mfem.

Message ID adcc00db46287e4467c69bb102a7cb80e088724b.1711634614.git.paul@apatience.com
State New
Headers show
Series [bug#70056,RFC] draft: gnu: Add mfem. | expand

Commit Message

Paul A. Patience March 28, 2024, 2:17 p.m. UTC
* gnu/packages/maths.scm (mfem): New variable.

Change-Id: Ida81f2b081a016e91426b68437909653020976f5
---
Hi,

I'm trying to package MFEM, but I get the following error while building:

--8<---------------cut here---------------start------------->8---
The following derivations will be built:
  /gnu/store/ibv1qjm24b2z4qsfhsw7q4izalcbb7rd-mfem-4.6.drv
  /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv
building /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv...
Initialized empty Git repository in /gnu/store/dc5fx7xfg67fsvl5brdxnbgkirirqxd0-mfem-4.6-checkout/.git/
From https://github.com/mfem/mfem
 * tag               v4.6       -> FETCH_HEAD
warning: unable to access '//.config/git/ignore': Permission denied
warning: unable to access '//.config/git/attributes': Permission denied
warning: unable to access '//.config/git/ignore': Permission denied
Note: switching to 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 69fbae7 Merge pull request #3841 from mfem/mfem-4.6-dev
suspicious ownership or permission on `/gnu/store/dc5fx7xfg67fsvl5brdxnbgkirirqxd0-mfem-4.6-checkout'; rejecting this build output
build of /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv failed
View build log at '/var/log/guix/drvs/l0/df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv.gz'.
cannot build derivation `/gnu/store/ibv1qjm24b2z4qsfhsw7q4izalcbb7rd-mfem-4.6.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/ibv1qjm24b2z4qsfhsw7q4izalcbb7rd-mfem-4.6.drv' failed
--8<---------------cut here---------------end--------------->8---

Basically it complains of suspicious ownership or permission.
I looked at the permissions of the contents of the repository when cloning it
manually, and nothing seems to be world-writable, as
nix/libstore/build.cc:2373 seems to be trying to protect against.

Regarding the Git warning at the top, I looked in the repository for any
references to Git attributes and ignore files, but did not find any.
I suspect it is looking for the .config directory in $HOME, but the variable
is unset, of course.

What's more, I tried with url-fetch, and it also results in suspicious
ownership or permission.

I'm at a loss as to what to do.

Can someone give me a hand?

Thanks,
Paul

 gnu/packages/maths.scm | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)


base-commit: fb9549164520ad993c2fbbaedc899844d57baabc

Comments

Ludovic Courtès April 2, 2024, 3:38 p.m. UTC | #1
Hi Paul,

"Paul A. Patience" <paul@apatience.com> skribis:

> HEAD is now at 69fbae7 Merge pull request #3841 from mfem/mfem-4.6-dev
> suspicious ownership or permission on `/gnu/store/dc5fx7xfg67fsvl5brdxnbgkirirqxd0-mfem-4.6-checkout'; rejecting this build output
> build of /gnu/store/l0df6d28w16dhnnpcr1qg26xvpmyrkqa-mfem-4.6-checkout.drv failed

Could you try updating guix-daemon?  (You might need to roll back first
to avoid the bug above.)

While fixing
<https://guix.gnu.org/en/blog/2024/fixed-output-derivation-sandbox-bypass-cve-2024-27297/>,
I first pushed a “broken” fix that led to the problem above.  If you
were unlucky and upgraded guix-daemon right at that time (I fixed it
with a followup commit ~24h later), then you have the problem above.

HTH!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1b4d325649..5e81225947 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -151,6 +151,7 @@  (define-module (gnu packages maths)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libunwind)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
@@ -6890,6 +6891,53 @@  (define-public dealii-openmpi
             (delete 'unset-cpath)))))
     (synopsis "Finite element library (with MPI support)")))
 
+(define-public mfem
+  (package
+    (name "mfem")
+    (version "4.6")
+    (source
+     (origin
+       ;; (method url-fetch)
+       ;; (uri (string-append "https://github.com/mfem/mfem/archive/refs/tags/v"
+       ;;                     version ".tar.gz"))
+       ;; (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mfem/mfem")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0m57j5kd7glc8lfp5bdmmx4az4fs6lkqjwd970w4fx8gylxff3n9"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     (list graphviz doxygen perl))      ; documentation
+    (inputs
+     (list gfortran
+           gnutls
+           lapack
+           libunwind
+           metis
+           mpfr
+           netcdf
+           suitesparse-amd
+           suitesparse-btf
+           suitesparse-camd
+           suitesparse-ccolamd
+           suitesparse-cholmod
+           suitesparse-colamd
+           suitesparse-config
+           suitesparse-klu
+           suitesparse-umfpack
+           sundials
+           zlib))
+    (home-page "https://mfem.org/")
+    (synopsis "Finite element library")
+    (description "MFEM is a modular parallel C++ library for finite element
+methods.  Its goal is to enable high-performance scalable finite element
+discretization research and application development on a wide variety of
+platforms, ranging from laptops to supercomputers.")
+    (license license:bsd-3)))
+
 (define-public flann
   (package
     (name "flann")