Message ID | 825d10894496a97e5e45033bc6e8dba5a5b1141d.1683930989.git.bjc@spork.org |
---|---|
State | New |
Headers | show |
Series | [bug#63149,v2] gnu: criu: Fix build | expand |
I've decided to just patch the mtime conversion directly into criu, rather than trying to factor it out. This is mainly because the original version of ‘ensure-no-mtimes-pre-1980’ throws an error when it attempts to change timestamps of symlinks. Ideally, that will be fixed someday, but that will cause huge downstream changes. In the mean-time, we can use this, and delete it after fixing ‘ensure-no-mtimes-pre-1980’. -bjc
Hi, Brian Cully <bjc@spork.org> skribis: > 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. Tweaked the commit log and applied. Thank you, and apologies for the delay! Ludo’.
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))