Dates in the future cause "ninja: error: manifest 'build.ninja' still dirty after 100 tries"
Author: jplsekCreated Dec 4, 2019Updated Jul 22, 2026
I'm running a CI where patches sometimes have their timestamps in the future. Meson/ninja fails to compile patches where the times are in the future.
The workaround is to just update the time on all the files (find . -exec touch {} +).
(Not really sure if this is a meson issue, a ninja issue, or even a python issue based on other bug reports)
Sorry if this is a duplicate. My searching didn't find a bug report that had a final resolution/workaround.
Example
main.c:
#include<stdio.h>
int main(int argc, char **argv) {
printf("Hello there.\n");
return 0;
}meson.build:
project('tutorial', 'c')
executable('demo', 'main.c')$ touch -a -m -t 203011110000.00 meson.build
$ meson builddir
The Meson build system
Version: 0.51.2
Source dir: /home/jplsek/Documents/ninja-time-hello
Build dir: /home/jplsek/Documents/ninja-time-hello/builddir
Build type: native build
Project name: tutorial
Project version: undefined
C compiler for the host machine: cc (gcc 9.2.1 "cc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Build targets in project: 1
Found ninja-1.9.0 at /usr/bin/ninja
$ ninja -C builddir
ninja: Entering directory `builddir'
...
[0/1] Regenerating build files.
The Meson build system
Version: 0.51.2
Source dir: /home/jplsek/Documents/ninja-time-hello
Build dir: /home/jplsek/Documents/ninja-time-hello/builddir
Build type: native build
Project name: tutorial
Project version: undefined
C compiler for the host machine: cc (gcc 9.2.1 "cc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Build targets in project: 1
Found ninja-1.9.0 at /usr/bin/ninja
[0/1] Regenerating build files.
The Meson build system
Version: 0.51.2
Source dir: /home/jplsek/Documents/ninja-time-hello
Build dir: /home/jplsek/Documents/ninja-time-hello/builddir
Build type: native build
Project name: tutorial
Project version: undefined
C compiler for the host machine: cc (gcc 9.2.1 "cc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Build targets in project: 1
Found ninja-1.9.0 at /usr/bin/ninja
ninja: error: manifest 'build.ninja' still dirty after 100 triesExpectation
To either compile anyways (similar to using a Makefile), or to fail on its first try and provide an error message related to the time being an issue.
Source: ninja-build/ninja