unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brian Cully via Guix-patches via <guix-patches@gnu.org>
To: 63149@debbugs.gnu.org
Cc: Brian Cully <bjc@spork.org>
Subject: [bug#63149] [PATCH v2] gnu: criu: Fix build
Date: Fri, 12 May 2023 18:36:29 -0400	[thread overview]
Message-ID: <825d10894496a97e5e45033bc6e8dba5a5b1141d.1683930989.git.bjc@spork.org> (raw)
In-Reply-To: <d630b03419fa2c08cd6ccb58451ff13791f9013d.1682690665.git.bjc@spork.org>

Ensure all files being built are dated no earlier than 1980 by copying in a
modified (@@ (guix build python-build-system) ensure-no-mtimes-pre-1980) which
is symlink-aware. This copy should be removed when the original procedure is
modified to avoid calling UTIME on symlinks.

* gnu/packages/virtualization.scm (criu) [ensure-no-mtimes-pre-1980]: new
phase.
* gnu/packages/virtualization.scm (criu) [inputs]: Remove python.
* gnu/packages/virtualization.scm (criu) [native-inputs]: Add
python-toolchain.
---
 gnu/packages/virtualization.scm | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 4a0d6b0096..c88fd31146 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1697,6 +1697,8 @@ (define-public criu
              (string-append "XMLTO="
                             (search-input-file %build-inputs
                                                "/bin/xmlto")))
+       #:modules ((ice-9 ftw)
+                  ,@%gnu-build-system-modules)
        #:phases
        (modify-phases %standard-phases
          (delete 'configure)            ; no configure script
@@ -1719,6 +1721,17 @@ (define-public criu
              (substitute* "criu/include/plugin.h"
                (("/var") (string-append (assoc-ref outputs "out"))))
              ))
+         ;; TODO: use
+         ;; (@@ (guix build python-build-system) ensure-no-mtimes-pre-1980)
+         ;; when it no longer throws due to trying to call UTIME on symlinks.
+         (add-after 'unpack 'ensure-no-mtimes-pre-1980
+           (lambda _
+             (let ((early-1980 315619200))  ; 1980-01-02 UTC
+               (ftw "." (lambda (file stat flag)
+                          (unless (or (<= early-1980 (stat:mtime stat))
+                                      (eq? (stat:type stat) 'symlink))
+                            (utime file early-1980 early-1980))
+                          #t)))))
          (add-before 'build 'fix-symlink
            (lambda* (#:key inputs #:allow-other-keys)
              ;; The file 'images/google/protobuf/descriptor.proto' points to
@@ -1748,7 +1761,6 @@ (define-public criu
                (for-each delete-file (find-files out "\\.a$"))))))))
     (inputs
      `(("protobuf" ,protobuf)
-       ("python" ,python)
        ("python-protobuf" ,python-protobuf)
        ("iproute" ,iproute)
        ("libaio" ,libaio)
@@ -1763,7 +1775,8 @@ (define-public criu
            asciidoc
            xmlto
            docbook-xml
-           docbook-xsl))
+           docbook-xsl
+           python-toolchain))
     (propagated-inputs
      ;; included by 'rpc.pb-c.h'
      (list protobuf-c))

base-commit: b363fab46f5af42b3f653e2fee1834477bd5aacd
prerequisite-patch-id: 8a03c5e8bcd4c526b93c558d550725887f932e41
prerequisite-patch-id: 89400c29b4c30dfbe8492aff1751ca583397b4f0
prerequisite-patch-id: a1963f772e753239b80e6a7b0d9f55e0ab4d662b
-- 
2.40.1





  parent reply	other threads:[~2023-05-12 22:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28 14:04 [bug#63149] [PATCH] gnu: criu: Fix build Brian Cully via Guix-patches via
2023-04-28 14:05 ` Brian Cully via Guix-patches via
2023-05-12 22:36 ` Brian Cully via Guix-patches via [this message]
2023-05-12 23:00   ` Brian Cully via Guix-patches via
2023-05-19 14:02   ` bug#63149: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=825d10894496a97e5e45033bc6e8dba5a5b1141d.1683930989.git.bjc@spork.org \
    --to=guix-patches@gnu.org \
    --cc=63149@debbugs.gnu.org \
    --cc=bjc@spork.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).