Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: tfarina/ninja
...
head fork: tfarina/ninja
  • 9 commits
  • 8 files changed
  • 0 commit comments
  • 3 contributors
Commits on Mar 30, 2013
@martine martine allow paths with '!' in depfiles 7ab6dcb
Commits on Apr 02, 2013
@nico nico Dollar signs in depfiles are escaped as "$$", not "\$".
See http://llvm.org/PR15642. I checked that gcc does produce depfiles
containing "$$" for files with "$" signs in their name (and as of
r178540, so does clang). I also checked that .d files that escape dollar
signs with "\$" are not read correctly by make.
e2701da
@martine martine Merge pull request #525 from nico/escapedollar
Dollar signs in depfiles are escaped as "$$", not "\$".
f01d7f0
Commits on Apr 05, 2013
@martine martine tag a feature with the right version number cf74108
@martine martine decided against using XXX in the manual for unknown versions a87ffee
@martine martine add noreturn attr on Fatal() 75381bc
@martine martine refactor some of the output mtime-handling code
Reduces duplicated explain output.
372a7a8
Commits on Apr 06, 2013
@RedX2501 RedX2501 Improved bash completion when using tools like '-t clean' ca04327
@martine martine Merge pull request #526 from RedX2501/improved_bash_completion
Improved bash completion when using tools like '-t clean'
1baebab
View
7 RELEASING
@@ -3,8 +3,7 @@ Notes to myself on all the steps to make for a Ninja release.
1. git checkout release; git merge master
2. fix version number in source (it will likely conflict in the above)
3. fix version in doc/manual.asciidoc
-4. grep doc/manual.asciidoc for XXX, fix version references
-5. rebuild manual, put in place on website
-6. commit, tag, push
-7. construct release notes from prior notes
+4. rebuild manual, put in place on website
+5. commit, tag, push
+6. construct release notes from prior notes
credits: git shortlog -s --no-merges REV..
View
2  doc/manual.asciidoc
@@ -555,7 +555,7 @@ If you provide a variable named `builddir` in the outermost scope,
Version compatibility
~~~~~~~~~~~~~~~~~~~~~
-_Available since Ninja 1.XXX._
+_Available since Ninja 1.2._
Ninja version labels follow the standard major.minor.patch format,
where the major version is increased on backwards-incompatible
View
29 misc/bash-completion
@@ -18,16 +18,23 @@
_ninja_target() {
local cur targets dir line targets_command OPTIND
cur="${COMP_WORDS[COMP_CWORD]}"
- dir="."
- line=$(echo ${COMP_LINE} | cut -d" " -f 2-)
- while getopts C: opt "${line[@]}"; do
- case $opt in
- C) dir="$OPTARG" ;;
- esac
- done;
- targets_command="ninja -C ${dir} -t targets all"
- targets=$((${targets_command} 2>/dev/null) | awk -F: '{print $1}')
- COMPREPLY=($(compgen -W "$targets" -- "$cur"))
- return 0
+
+ if [[ "$cur" == "--"* ]]; then
+ # there is currently only one argument that takes --
+ COMPREPLY=($(compgen -P '--' -W 'version' -- "${cur:2}"))
+ else
+ dir="."
+ line=$(echo ${COMP_LINE} | cut -d" " -f 2-)
+ # filter out all non relevant arguments but keep C for dirs
+ while getopts C:f:j:l:k:nvd:t: opt "${line[@]}"; do
+ case $opt in
+ C) dir="$OPTARG" ;;
+ esac
+ done;
+ targets_command="ninja -C ${dir} -t targets all"
+ targets=$((${targets_command} 2>/dev/null) | awk -F: '{print $1}')
+ COMPREPLY=($(compgen -W "$targets" -- "$cur"))
+ fi
+ return
}
complete -F _ninja_target ninja
View
97 src/depfile_parser.cc
@@ -53,10 +53,10 @@ bool DepfileParser::Parse(string* content, string* err) {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 128, 0, 128, 128, 128, 128, 128,
+ 0, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 128, 0, 0, 128, 0, 0,
+ 128, 128, 128, 128, 128, 128, 0, 0,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
@@ -84,56 +84,48 @@ bool DepfileParser::Parse(string* content, string* err) {
};
yych = *in;
- if (yych <= 'Z') {
- if (yych <= '*') {
- if (yych <= 0x00) goto yy6;
- if (yych <= '\'') goto yy8;
- if (yych <= ')') goto yy4;
- goto yy8;
+ if (yych <= '[') {
+ if (yych <= '$') {
+ if (yych <= 0x00) goto yy7;
+ if (yych <= ' ') goto yy9;
+ if (yych <= '#') goto yy6;
+ goto yy4;
} else {
- if (yych <= '<') {
- if (yych <= ':') goto yy4;
- goto yy8;
- } else {
- if (yych <= '=') goto yy4;
- if (yych <= '?') goto yy8;
- goto yy4;
- }
+ if (yych <= '=') goto yy6;
+ if (yych <= '?') goto yy9;
+ if (yych <= 'Z') goto yy6;
+ goto yy9;
}
} else {
- if (yych <= '_') {
- if (yych == '\\') goto yy2;
- if (yych <= '^') goto yy8;
- goto yy4;
+ if (yych <= '`') {
+ if (yych <= '\\') goto yy2;
+ if (yych == '_') goto yy6;
+ goto yy9;
} else {
- if (yych <= 'z') {
- if (yych <= '`') goto yy8;
- goto yy4;
- } else {
- if (yych == '~') goto yy4;
- goto yy8;
- }
+ if (yych <= 'z') goto yy6;
+ if (yych == '~') goto yy6;
+ goto yy9;
}
}
yy2:
++in;
- if ((yych = *in) <= '$') {
+ if ((yych = *in) <= '#') {
if (yych <= '\n') {
if (yych <= 0x00) goto yy3;
- if (yych <= '\t') goto yy11;
+ if (yych <= '\t') goto yy14;
} else {
- if (yych == ' ') goto yy13;
- if (yych <= '"') goto yy11;
- goto yy13;
+ if (yych == ' ') goto yy16;
+ if (yych <= '"') goto yy14;
+ goto yy16;
}
} else {
if (yych <= 'Z') {
- if (yych == '*') goto yy13;
- goto yy11;
+ if (yych == '*') goto yy16;
+ goto yy14;
} else {
- if (yych <= '\\') goto yy13;
- if (yych == '|') goto yy13;
- goto yy11;
+ if (yych <= '\\') goto yy16;
+ if (yych == '|') goto yy16;
+ goto yy14;
}
}
yy3:
@@ -144,8 +136,8 @@ bool DepfileParser::Parse(string* content, string* err) {
}
yy4:
++in;
- yych = *in;
- goto yy10;
+ if ((yych = *in) == '$') goto yy12;
+ goto yy11;
yy5:
{
// Got a span of plain text.
@@ -157,22 +149,35 @@ bool DepfileParser::Parse(string* content, string* err) {
continue;
}
yy6:
+ yych = *++in;
+ goto yy11;
+yy7:
++in;
{
break;
}
-yy8:
+yy9:
yych = *++in;
goto yy3;
-yy9:
+yy10:
++in;
yych = *in;
-yy10:
+yy11:
if (yybm[0+yych] & 128) {
- goto yy9;
+ goto yy10;
}
goto yy5;
-yy11:
+yy12:
+ ++in;
+ if (yybm[0+(yych = *in)] & 128) {
+ goto yy10;
+ }
+ {
+ // De-escape dollar character.
+ *out++ = '$';
+ continue;
+ }
+yy14:
++in;
{
// Let backslash before other characters through verbatim.
@@ -180,7 +185,7 @@ bool DepfileParser::Parse(string* content, string* err) {
*out++ = yych;
continue;
}
-yy13:
+yy16:
++in;
{
// De-escape backslashed character.
View
9 src/depfile_parser.in.cc
@@ -55,20 +55,25 @@ bool DepfileParser::Parse(string* content, string* err) {
re2c:indent:string = " ";
nul = "\000";
- escape = [ \\#*$[|];
+ escape = [ \\#*[|];
'\\' escape {
// De-escape backslashed character.
*out++ = yych;
continue;
}
+ '$$' {
+ // De-escape dollar character.
+ *out++ = '$';
+ continue;
+ }
'\\' [^\000\n] {
// Let backslash before other characters through verbatim.
*out++ = '\\';
*out++ = yych;
continue;
}
- [a-zA-Z0-9+,/_:.~()@=-]+ {
+ [a-zA-Z0-9+,/_:.~()@=-!]+ {
// Got a span of plain text.
int len = (int)(in - start);
// Need to shift it over if we're overwriting backslashes.
View
8 src/depfile_parser_test.cc
@@ -95,7 +95,7 @@ TEST_F(DepfileParserTest, Escapes) {
// it through.
string err;
EXPECT_TRUE(Parse(
-"\\!\\@\\#\\$\\%\\^\\&\\\\",
+"\\!\\@\\#$$\\%\\^\\&\\\\",
&err));
ASSERT_EQ("", err);
EXPECT_EQ("\\!\\@#$\\%\\^\\&\\",
@@ -104,10 +104,12 @@ TEST_F(DepfileParserTest, Escapes) {
}
TEST_F(DepfileParserTest, SpecialChars) {
+ // See filenames like istreambuf.iterator_op!= in
+ // https://github.com/google/libcxx/tree/master/test/iterators/stream.iterators/istreambuf.iterator/
string err;
EXPECT_TRUE(Parse(
"C:/Program\\ Files\\ (x86)/Microsoft\\ crtdefs.h: \n"
-" en@quot.header~ t+t-x=1",
+" en@quot.header~ t+t-x!=1",
&err));
ASSERT_EQ("", err);
EXPECT_EQ("C:/Program Files (x86)/Microsoft crtdefs.h",
@@ -115,7 +117,7 @@ TEST_F(DepfileParserTest, SpecialChars) {
ASSERT_EQ(2u, parser_.ins_.size());
EXPECT_EQ("en@quot.header~",
parser_.ins_[0].AsString());
- EXPECT_EQ("t+t-x=1",
+ EXPECT_EQ("t+t-x!=1",
parser_.ins_[1].AsString());
}
View
25 src/graph.cc
@@ -161,24 +161,25 @@ bool DependencyScan::RecomputeOutputDirty(Edge* edge,
// Dirty if the output is older than the input.
if (most_recent_input && output->mtime() < most_recent_input->mtime()) {
+ TimeStamp output_mtime = output->mtime();
+
// If this is a restat rule, we may have cleaned the output with a restat
// rule in a previous run and stored the most recent input mtime in the
// build log. Use that mtime instead, so that the file will only be
// considered dirty if an input was modified since the previous run.
- TimeStamp most_recent_stamp = most_recent_input->mtime();
+ bool used_restat = false;
if (edge->GetBindingBool("restat") && build_log() &&
(entry = build_log()->LookupByOutput(output->path()))) {
- if (entry->restat_mtime < most_recent_stamp) {
- EXPLAIN("restat of output %s older than most recent input %s "
- "(%d vs %d)",
- output->path().c_str(), most_recent_input->path().c_str(),
- entry->restat_mtime, most_recent_stamp);
- return true;
- }
- } else {
- EXPLAIN("output %s older than most recent input %s (%d vs %d)",
- output->path().c_str(), most_recent_input->path().c_str(),
- output->mtime(), most_recent_stamp);
+ output_mtime = entry->restat_mtime;
+ used_restat = true;
+ }
+
+ if (output_mtime < most_recent_input->mtime()) {
+ EXPLAIN("%soutput %s older than most recent input %s "
+ "(%d vs %d)",
+ used_restat ? "restat of " : "", output->path().c_str(),
+ most_recent_input->path().c_str(),
+ output_mtime, most_recent_input->mtime());
return true;
}
}
View
10 src/util.h
@@ -25,8 +25,14 @@
#include <vector>
using namespace std;
+#ifdef _MSC_VER
+#define NORETURN __declspec(noreturn)
+#else
+#define NORETURN __attribute__((noreturn));
+#endif
+
/// Log a fatal message and exit.
-void Fatal(const char* msg, ...);
+void Fatal(const char* msg, ...) NORETURN;
/// Log a warning message.
void Warning(const char* msg, ...);
@@ -85,7 +91,7 @@ string ElideMiddle(const string& str, size_t width);
string GetLastErrorString();
/// Calls Fatal() with a function name and GetLastErrorString.
-void Win32Fatal(const char* function);
+void Win32Fatal(const char* function) NORETURN;
#endif
#endif // NINJA_UTIL_H_

No commit comments for this range

Something went wrong with that request. Please try again.