summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1868 from kadler/fix-aix-signal-checkingJan Niklas Hasse2020-11-021-0/+10
|\ | | | | Handle process signalling correctly on AIX
| * Handle process signalling correctly on AIXKevin Adler2020-10-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX shells set the exit code to 128 + the signal number, which coincidentally matches the layout used by the WIFSIGNALLED/WTERMSIG macros on most Unix-like systems, but not on AIX. Instead, AIX stores the signal value in the bottom 8 bits and also bits 16-23. The only time ninja currently handles signals correctly is when the shell used to call the program dies via signal. To handle both scenarios, we detect the shell exit code format and convert it to the format that the WIFSIGNALED/WTERMSIG macros expect. Fixes #1623
* | Merge pull request #1834 from jhasse/close-during-generatorJan Niklas Hasse2020-11-022-2/+5
|\ \ | |/ |/| Close BuildLog while running generators, fix #1724
| * Close BuildLog while running generators, fix #1724Jan Niklas Hasse2020-08-262-2/+5
| | | | | | | | | | | | | | | | | | | | | | While #1780 delayed opening .ninja_log until the first write, this this didn't fully fix the issue on Windows: There might be build statements which run before the generator resulting in an actual write to .ninja_log. To fix this once and for all the BuildLog now gets closed before running the generator. BuildLog::log_file_path_ won't be cleared so that it can be opened again after the generator finished.
* | Check return value of setvbuf, fix #509Jan Niklas Hasse2020-10-302-2/+6
| |
* | Comply with project formatting rules wrt 80 column linesMichael Jones2020-09-308-13/+19
| |
* | Remove 'using namespace std' from header files, properly namespace all std ↵Michael Jones2020-09-3026-276/+250
| | | | | | | | symbols
* | Add 'using namespace std;' to all cc files to prepare for removing it from ↵Michael Jones2020-09-3055-1/+109
| | | | | | | | header files
* | Merge pull request #1789 from neheb/ifJan Niklas Hasse2020-09-101-2/+1
|\ \ | | | | | | [clang-tidy] fix small false positive
| * | [clang-tidy] fix small false positiveRosen Penev2020-06-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | else if has to be on the same line it seems. Found with readability-misleading-indentation Signed-off-by: Rosen Penev <rosenp@gmail.com>
* | | Merge pull request #1786 from neheb/membJan Niklas Hasse2020-09-102-8/+3
|\ \ \ | | | | | | | | [clang-tidy] remove redundant member init
| * | | [clang-tidy] remove redundant member initRosen Penev2020-06-182-8/+3
| |/ / | | | | | | | | | | | | | | | Found with readability-redundant-member-init Signed-off-by: Rosen Penev <rosenp@gmail.com>
* | | Improve error handling in inline.shAlastair Harrison2020-08-281-3/+10
| |/ |/| | | | | | | | | | | | | | | Previously the script would generate some output and return a zero error code, even if the calls to `od` or `sed` failed. This change ensures that: - If `od` or `sed` fail then the script will fail. - Output will only be written on success.
* | Mark this 1.10.1.gitJan Niklas Hasse2020-08-181-1/+1
| |
* | Merge pull request #1780 from jhasse/delay-openJan Niklas Hasse2020-08-034-47/+89
|\ \ | | | | | | Delay actually opening log files until the first write, fix #1724
| * | Delay actually opening log files until the first write, fix #1724Jan Niklas Hasse2020-05-234-47/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling DepsLog/BuildLog::OpenForWrite will now only save the file path. The actual opening of the file (moved to OpenForWriteIfNeeded) happens right before the first write attempt. This is needed so that the files aren't held open when the generator runs (i.e. RebuildManifest) as it may call tools like recompact which won't be able to open the file on Windows. The disadvantage is that now the error reporting happens at a later time and will be reported as a failed write, not a failed open.
* | | Fix typosDimitris Apostolou2020-07-072-3/+3
| | |
* | | Merge pull request #1804 from ninja-build/nico-patch-2Nico Weber2020-06-211-1/+6
|\ \ \ | | | | | | | | Include sys/select.h in subprocess-posix.cc
| * | | Include sys/select.h in subprocess-posix.ccNico Weber2020-06-211-1/+6
| | |/ | |/| | | | | | | | | | pselect() is in sys/select.h in "newer" (2001) versions of posix, so add an include for it. While here, only include poll.h if USE_PPOLL is defined.
* | | Include unistd.h in disk_interface.ccNico Weber2020-06-211-0/+2
|/ / | | | | | | stat() needs unistd.h in addition to sys/stat.h and sys/types.h per POSIX. At least one (hobby) OS does need unistd.h, so add an include for it.
* | [clang-tidy] check empty instead of size (#1784)Rosen Penev2020-06-044-4/+4
| | | | | | | | | | Found with readability-container-size-empty Signed-off-by: Rosen Penev <rosenp@gmail.com>
* | [clang-tidy] remove pointless c_str() (#1785)Rosen Penev2020-06-041-1/+1
| | | | | | | | | | Found with readability-redundant-string-cstr Signed-off-by: Rosen Penev <rosenp@gmail.com>
* | bugfix: Process escaped colon in GCC depfiles. (#1774)zero91782020-05-203-24/+121
|/ | | | | | | | | | | | | | | | | | | | | * Added ability to parse escaped colons in GCC Dep files enabling ninja to parse dep files of GCC 10 on Windows * Added generated depfile_parser.cc * Addressed formatting * Added extra tests with real world examples of paths produced by both GCC 10 and Clang and GCC pre 10. Adjusted one test so it doesn't fail * Adjusted regular expression to not match \: if the character following the : is either EOF or whitespace * Fixed typo in regex (should be 0x20 for space not 0xa) * Changed regular expression form using lookahead to instead matching a separate expression. This was needed as re2c pre version 1.17 is broken when using lookaheads. Also added tests for \: followed by whitespace * Addressed formatting * Forgot a missing std:: * Fixed formatting for spaces after , as well as respecting column width
* MinGW now has _mktemp_s, use overload with size parameterJan Niklas Hasse2020-05-181-11/+2
| | | | | | | | | MSVC also used the custom implementation, since the function isn't a macro and therefore #ifndef _mktemp_s didn't work as intended.
* Null terminate the out2 string passed as filter2 to log.Restatyydevelop2020-04-151-1/+1
|
* Merge pull request #1637 from beevik/windows-create-process-fixJan Niklas Hasse2020-03-261-5/+13
|\ | | | | Improve error messages when ninja commands fail on Windows.
| * Improve error messages when ninja commands fail on Windows.Brett Vickers2019-08-281-5/+13
| | | | | | | | | | | | | | | | When a call to the Win32 API CreateProcessA fails, ninja now outputs the exact command string that caused it to fail. It also detects when the command contained leading whitespace and outputs a hint that lets the user know why the command failed.
* | browse.py: use html.escape for python3Michael Hirsch, Ph.D2020-02-191-2/+5
| | | | | | | | | | fixes #1741 fixes #1736
* | mark this 1.10.0.gitJan Niklas Hasse2020-01-271-1/+1
| |
* | restat: No need for loading build.ninjaJan Niklas Hasse2020-01-161-1/+1
| | | | | | | | | | This results in a huge speed up for large builds (e.g. Chromium). See #1718.
* | restat: Accept list of outputs to restat (none means all)Jan Niklas Hasse2020-01-164-8/+43
| | | | | | | | | | This will become handy when the generator only wants to restat the build.ninja entry in the log. See #1718.
* | Merge branch 'master' into clean_dead_outputsJan Niklas Hasse2020-01-0424-310/+868
|\ \
| * \ Merge pull request #1534 from mathstuf/remove-depslog-restrictionJan Niklas Hasse2020-01-0410-141/+378
| |\ \ | | | | | | | | manifest_parser: remove multi-output depslog restriction
| | * | depfile_parser_test: test buggy -MP behaviorBen Boeckel2019-11-203-2/+31
| | | | | | | | | | | | | | | | | | | | This ensures the current behavior of rejecting this case due to `x` being reused as an input.
| | * | depfile_parser: remove restriction on multiple outputsBen Boeckel2019-11-2010-138/+344
| | | |
| | * | build: add to deps log for each edge outputBen Boeckel2019-11-201-7/+9
| | | |
| * | | Merge pull request #1685 from jhasse/restatJan Niklas Hasse2020-01-047-24/+197
| |\ \ \ | | | | | | | | | | Add restat tool which recalculates all mtimes in the build log
| | * | | Ignore nonexistent .ninja_log/.ninja_deps for restat and recompactJan Niklas Hasse2019-12-237-26/+66
| | | | |
| | * | | Add restat tool which recalculates all mtimes in the build logJan Niklas Hasse2019-12-234-0/+133
| | | | |
| * | | | Fix logic-error in IsPathDead, see #1432Jan Niklas Hasse2019-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conditional `(!n || !n->in_edge()) && ` was moved up. It now needs to be inversed because there's a `return false;`. See https://github.com/ninja-build/ninja/commit/3beebde51a2089ecb01820f1428efe0263deaeea#diff-78294872cbf9d32f4f972288561fa718R146 and https://github.com/ninja-build/ninja/pull/1432#discussion_r321827528
| * | | | Fix error handling for getcwdAndreas Kempf2019-12-271-2/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting from the Linux man page for errno, "The value in errno is significant only when the return value of the call indicated an error (i.e., -1 from most system calls; -1 or NULL from most library functions); a function that succeeds is allowed to change errno. The value of errno is never set to zero by any system call or library function." Successful calls to getcwd are allowed to set errno causing the compilation database not to be written. Spurious failures of this nature were observed on AIX. Adjust the error handling for getcwd so that errno is only checked if the call returned NULL.
| * | | build.cc: constify BuildStatusKonstantin Kharlamov2019-11-202-4/+4
| | | | | | | | | | | | | | | | Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
| * | | build.cc: constify a map in BuildStatusKonstantin Kharlamov2019-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Modifying a key in C++ associative containers is UB. Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
| * | | graph.cc: constify DependencyScanKonstantin Kharlamov2019-11-202-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
| * | | build.cc: constify a few Plan functionsKonstantin Kharlamov2019-11-202-13/+13
| | | | | | | | | | | | | | | | Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
| * | | build.cc: constify a map key in RealCommandRunnerKonstantin Kharlamov2019-11-201-3/+3
| |/ / | | | | | | | | | | | | | | | Modifying a key in C++ associative containers is UB. Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
| * | Merge pull request #1680 from jonesmz/patch-1Jan Niklas Hasse2019-11-162-2/+2
| |\ \ | | | | | | | | Fix invalid preprocessor #if
| | * | Update graph_test.ccMichael Jones2019-11-141-1/+1
| | | |
| | * | Fix invalid preprocessor #ifMichael Jones2019-11-141-1/+1
| | | |
| * | | Fix minor typo of return valuexianglin10062019-11-151-2/+2
| |/ / | | | | | | Return value of ManifestParser::ParseEdge shoule be boolean