gnu: ninja: Do not report files with mtime = 0 as missing.
This is a followup to 47f315a
.
* gnu/packages/patches/ninja-zero-mtime.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/ninja.scm (ninja)[source]: Reinstate 'patches' field and add
this patch.
[arguments]: Remove 'apply-ninja-tests.patch' phase.
This commit is contained in:
parent
c5c4c4b437
commit
2e839545c7
|
@ -537,6 +537,7 @@ dist_patch_DATA = \
|
||||||
gnu/packages/patches/ngircd-handle-zombies.patch \
|
gnu/packages/patches/ngircd-handle-zombies.patch \
|
||||||
gnu/packages/patches/ngircd-no-dns-in-tests.patch \
|
gnu/packages/patches/ngircd-no-dns-in-tests.patch \
|
||||||
gnu/packages/patches/ninja-tests.patch \
|
gnu/packages/patches/ninja-tests.patch \
|
||||||
|
gnu/packages/patches/ninja-zero-mtime.patch \
|
||||||
gnu/packages/patches/nss-pkgconfig.patch \
|
gnu/packages/patches/nss-pkgconfig.patch \
|
||||||
gnu/packages/patches/nvi-assume-preserve-path.patch \
|
gnu/packages/patches/nvi-assume-preserve-path.patch \
|
||||||
gnu/packages/patches/nvi-dbpagesize-binpower.patch \
|
gnu/packages/patches/nvi-dbpagesize-binpower.patch \
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (gnu packages)
|
#:use-module (gnu packages)
|
||||||
#:use-module (gnu packages base)
|
|
||||||
#:use-module (gnu packages python))
|
#:use-module (gnu packages python))
|
||||||
|
|
||||||
(define-public ninja
|
(define-public ninja
|
||||||
|
@ -38,23 +37,13 @@
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1h3yfwcfl61v493vna6jia2fizh8rpig7qw2504cvkr6gid3p5bw"))
|
"1h3yfwcfl61v493vna6jia2fizh8rpig7qw2504cvkr6gid3p5bw"))
|
||||||
;; XXX Ninja's build system doesn't cope well with zeroed
|
(patches (map search-patch
|
||||||
;; time stamps in the source tree, so we must avoid using
|
'("ninja-zero-mtime.patch" "ninja-tests.patch")))))
|
||||||
;; 'patch-and-repack'.
|
|
||||||
#; (patches (list (search-patch "ninja-tests.patch")))))
|
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(native-inputs `(("python" ,python-2)
|
(native-inputs `(("python" ,python-2)))
|
||||||
("patch" ,patch)
|
|
||||||
("ninja-tests.patch" ,(search-patch "ninja-tests.patch"))))
|
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases
|
'(#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-after
|
|
||||||
'unpack 'apply-ninja-tests.patch
|
|
||||||
;; XXX Apply the patch here to avoid 'patch-and-repack'. See above.
|
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
|
||||||
(zero? (system* "patch" "--force" "-p1" "-i"
|
|
||||||
(assoc-ref inputs "ninja-tests.patch")))))
|
|
||||||
(replace
|
(replace
|
||||||
'configure
|
'configure
|
||||||
(lambda _
|
(lambda _
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
Work around a design defect in Ninja whereby a zero mtime is used to
|
||||||
|
denote missing files (we happen to produce files that have a zero mtime
|
||||||
|
and yet really do exist.)
|
||||||
|
|
||||||
|
--- ninja-1.5.3/src/disk_interface.cc 2014-11-24 18:37:47.000000000 +0100
|
||||||
|
+++ ninja-1.5.3/src/disk_interface.cc 2015-07-18 23:20:38.572290139 +0200
|
||||||
|
@@ -194,6 +194,12 @@ TimeStamp RealDiskInterface::Stat(const
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (st.st_mtime == 0)
|
||||||
|
+ // All the code assumes that mtime == 0 means "file missing". Here we
|
||||||
|
+ // know the file is not missing, so tweak the mtime.
|
||||||
|
+ st.st_mtime = 1;
|
||||||
|
+
|
||||||
|
return st.st_mtime;
|
||||||
|
#endif
|
||||||
|
}
|
Loading…
Reference in New Issue