Commit Graph

2780 Commits

Author SHA1 Message Date
Jan Niklas Hasse
1f02bc192a Fix logic-error in IsPathDead, see #1432
The conditional `(!n || !n->in_edge()) && ` was moved up. It now needs
to be inversed because there's a `return false;`. See
3beebde51a (diff-78294872cbf9d32f4f972288561fa718R146)
and
https://github.com/ninja-build/ninja/pull/1432#discussion_r321827528
2019-12-27 22:03:52 +01:00
Andreas Kempf
35169ddf47 Fix error handling for getcwd
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.
2019-12-27 15:54:42 +01:00
Jan Niklas Hasse
66b746044d Add a short documentation for restat tool 2019-12-23 14:34:52 +01:00
Jan Niklas Hasse
791c887e22 Ignore nonexistent .ninja_log/.ninja_deps for restat and recompact 2019-12-23 14:11:09 +01:00
Jan Niklas Hasse
8f87ee0469 Add restat tool which recalculates all mtimes in the build log 2019-12-23 14:11:09 +01:00
Jan Niklas Hasse
a67718de4e Run output test in temporary directory 2019-12-23 14:08:59 +01:00
KOLANICH
94c66fd01a Add .editorconfig
See https://editorconfig.org/ for more info.
2019-12-22 14:12:43 +01:00
Jan Niklas Hasse
ca08c43c0e Remove some outdated lines from .gitignore 2019-12-20 14:58:19 +01:00
Jan Niklas Hasse
77a630e78b GitHub Actions: Use CentOS 7 for Linux, fix #1533 2019-12-20 13:40:33 +01:00
Michael Jones
0c84b0ebd7 Enable Link Time Optimization for Release builds (#1701) 2019-12-03 22:46:56 +01:00
Michael Jones
c90a078edb Ignore Qt Creator project files (#1702) 2019-12-03 22:26:42 +01:00
Michael Jones
ba156d093c Have Github Actions also run tests (#1697) 2019-12-02 09:56:55 +01:00
Jan Niklas Hasse
3b82f99a88
Merge pull request #1666 from Helenerineium/master
Fix warnings on mingw builds
2019-11-24 13:14:09 +01:00
Jan Niklas Hasse
f37d101fdc Add basic build instructions to the README 2019-11-24 12:58:31 +01:00
Jan Niklas Hasse
a37da20ae7 Use short CONTRIBUTING.md instead of HACKING.md
* Only the most important parts and some new guidelines in
  CONTRIBUTING.md.
* Complete HACKING.md content moved to the GitHub wiki:
  https://github.com/ninja-build/ninja/wiki
* README is now also Markdown formatted.
2019-11-24 12:58:31 +01:00
Jan Niklas Hasse
6ee71118b8 Rename HACKING.md to CONTRIBUTING.md 2019-11-24 12:58:31 +01:00
Helenerineium
288f04eb17 Fix warnings on mingw build 2019-11-23 17:47:44 +08:00
Jan Niklas Hasse
ed154b9052
Merge pull request #1664 from Hi-Angel/constify-stuff3
More constification
2019-11-21 15:42:02 +01:00
Konstantin Kharlamov
1d4c65f2fd build.cc: constify BuildStatus
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-11-21 00:40:11 +03:00
Konstantin Kharlamov
95b2f8aa8e build.cc: constify a map in BuildStatus
Modifying a key in C++ associative containers is UB.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-11-21 00:40:11 +03:00
Konstantin Kharlamov
2cb0370e9a graph.cc: constify DependencyScan
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-11-21 00:40:11 +03:00
Konstantin Kharlamov
2492fcbd91 build.cc: constify a few Plan functions
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-11-21 00:40:11 +03:00
Konstantin Kharlamov
5fe25d2e03 build.cc: constify a map key in RealCommandRunner
Modifying a key in C++ associative containers is UB.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2019-11-21 00:40:11 +03:00
Cameron Desrochers
546e27c645 Style changes following code review 2019-11-20 16:31:14 -05:00
Ben Boeckel
ebbb9e2fdb depfile_parser_test: test buggy -MP behavior
This ensures the current behavior of rejecting this case due to `x`
being reused as an input.
2019-11-20 16:00:37 -05:00
Ben Boeckel
1daa7470ab depfile_parser: remove restriction on multiple outputs 2019-11-20 15:59:48 -05:00
Ben Boeckel
e2433c11d0 build: add to deps log for each edge output 2019-11-20 15:55:05 -05:00
Jan Niklas Hasse
59c9a00519
Merge pull request #1681 from nightlark/release-ninja-binaries
Add GitHub Actions workflow for building release binaries
2019-11-19 09:52:36 +01:00
Ryan Mast
9fa8a4b730
Trigger test run for release builds on PRs 2019-11-16 10:15:50 -08:00
Jan Niklas Hasse
2d15b04e41
Merge pull request #1680 from jonesmz/patch-1
Fix invalid preprocessor #if
2019-11-16 18:46:41 +01:00
Jan Niklas Hasse
8486a8886e
Merge pull request #1683 from xianglin1006/master
Fix minor typo of return value
2019-11-16 12:09:25 +01:00
xianglin1006
953efbce93
Fix minor typo of return value
Return value of ManifestParser::ParseEdge shoule be boolean
2019-11-15 16:40:36 +08:00
Ryan Mast
f1a3313115
Fix yaml lint (whitespace) errors in release action 2019-11-14 22:25:18 -08:00
Michael Jones
f8497798a3
Update graph_test.cc 2019-11-13 21:16:43 -06:00
Michael Jones
cdf33d8b87
Fix invalid preprocessor #if 2019-11-13 21:15:55 -06:00
Cameron Desrochers
9d502da06d Removed unnecessary #ifdef following code review 2019-11-13 12:17:31 -05:00
Cameron
48a8a7ae95
Use symbolic constant as suggested in code review
Co-Authored-By: Takuto Ikuta <atetubou@gmail.com>
2019-11-12 21:13:36 -05:00
Cameron Desrochers
de6485646d Fixed processor count detection on Windows when multiple processor groups (i.e. >64 processors) are present 2019-11-12 15:47:27 -05:00
Jan Niklas Hasse
3ef623acf1
Merge pull request #1672 from joakim-noah/patch-1
Add Bionic tweak for getloadavg
2019-11-11 10:19:29 +01:00
joakim-noah
115c654d27 Add Bionic tweak for getloadavg 2019-11-09 22:18:55 +05:30
Jan Niklas Hasse
21502ebbfb
Merge pull request #1665 from SibiSiddharthan/master
Fixed compilation by gcc on Windows
2019-11-02 14:26:15 +01:00
Sibi
980bc03f53 Fixed compilation by gcc on Windows 2019-11-02 17:43:58 +05:30
Ryan Mast
cd9d614075
Strip unnecessary info from the Linux binary 2019-10-30 23:00:49 -07:00
Ryan Mast
da2dad8953
Upload ninja binary to published releases 2019-10-30 22:30:12 -07:00
Ryan Mast
49a14a8b7c Add GitHub Action workflow to build ninja using CMake 2019-10-30 21:50:35 -07:00
Jan Niklas Hasse
40d45a7bb3
Merge pull request #1654 from BourgondAries/master
Ensure substring indexing never goes negative
2019-10-30 15:43:49 +01:00
Jan Niklas Hasse
97c5949ffe Revert "1492 add column headers to .ninja_log"
This reverts commit cfd0bd3007.

See #1662.
2019-10-28 13:11:03 +01:00
Jan Niklas Hasse
ca5cddc27f Travis CI: Remove broken Xcode config 2019-10-28 09:42:54 +01:00
Kevin Robert Stravers
04ce2ea7a2 Ensure substring indexing never goes negative
With widths lower than 4, the ElideMiddle function would crash because
its substring access would wrap around and attempt to access the max
size_t value. This patch fixes that.
2019-09-29 00:15:09 +02:00
Jan Niklas Hasse
21bd971ea9 CMake: Bump required version for object libraries 2019-09-21 23:44:42 +02:00