Commit Graph

2713 Commits

Author SHA1 Message Date
Colin Cross
045890cee3 Simplify running edges status
Store the number of running edges instead of trying to compute it
from the started and finshed edge counts, which may be different
for starting and ending status messages.  Allows removing the status
parameter to PrintStatus and the EdgeStatus enum.
2020-12-18 12:38:29 -08:00
Colin Cross
dede9ac780 Move edge time from Status to Builder
The times that end up in the build log currently originate in the
status printer, and are propagated back out to the Builder.  Move
the edge times into the Builder instead, and move the overall start
time into NinjaMain so it doesn't get reset during manifest
rebuilds.
2020-12-18 12:38:25 -08:00
Jan Niklas Hasse
68f971460b
Merge pull request #1893 from AdamKorcz/fuzz1
Added fuzzer with build script and seed
2020-12-11 12:08:22 +01:00
Jan Niklas Hasse
91f4a498b2
Merge pull request #1894 from gjasny/modern-add-test-signature
cmake: Use modern add_test signature
2020-12-11 12:06:59 +01:00
Gregor Jasny
721db105e6 cmake: Use modern add_test signature
Using this modern signature makes CMake/CTest use the effective
binary path and works also with multi-config generators which put
binaries in extra `Release` folders.
2020-12-11 08:36:26 +01:00
AdamKorcz
365a149069 Created oss-fuzz folder and moved build.sh and sample ninja file into it 2020-12-10 18:00:26 +00:00
AdamKorcz
9c801316ba Added fuzzer with build script and seed 2020-12-08 20:18:29 +00:00
Jan Niklas Hasse
58f77f972b Ignore new clangd cache directory, too 2020-12-06 15:49:29 +01:00
Jan Niklas Hasse
507db2c022
Merge pull request #1791 from neheb/exp
[clang-tidy] add explicit to single argument constructors
2020-12-06 12:15:55 +01:00
Jan Niklas Hasse
e664814b6a
Merge pull request #1790 from neheb/bool
[clang-tidy] simplify boolean expression
2020-12-06 12:15:06 +01:00
Rosen Penev
0351d68f0a
[clang-tidy] add explicit to single argument constructors
Found with google-explicit-constructor

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-05 22:15:54 -08:00
Rosen Penev
7c36b8871a
[clang-tidy] simplify boolean expression
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-05 15:47:18 -08:00
Jan Niklas Hasse
deb542192b
Merge pull request #1873 from jhasse/remove-travis
Replace Travis CI with GitHub Actions
2020-12-05 23:41:18 +01:00
Jan Niklas Hasse
7705fedfaf
Merge pull request #1876 from orgads/msvc-warnings
Suppress MSVC warnings
2020-12-05 23:41:02 +01:00
Jan Niklas Hasse
160531764c Ignore clangd files 2020-12-04 13:05:25 +01:00
Jan Niklas Hasse
629f926294
Merge pull request #1866 from jhasse/unique-edge-ids
Add unique IDs to edges
2020-12-03 18:37:09 +01:00
Jan Niklas Hasse
7193fb7c1e
Merge pull request #1792 from neheb/dec
[clang-tidy] fix inconsistent declarations
2020-12-03 10:55:34 +01:00
Rosen Penev
76ecd30541
[clang-tidy] fix inconsistent declarations
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-02 15:30:15 -08:00
Jan Niklas Hasse
7cff4770b5
Merge pull request #1887 from mjguzik/freebsd_cpuset
Add FreeBSD support to GetProcessorCount
2020-12-01 10:01:37 +01:00
Mateusz Guzik
9d4ea5a8e8 Add FreeBSD support to GetProcessorCount 2020-11-30 23:01:41 +00:00
Jan Niklas Hasse
ed056bdd8c mark this 1.10.2.git 2020-11-28 12:21:05 +01:00
Jan Niklas Hasse
242b7dd900 GitHub Actions: Build Universal Binary for macOS 2020-11-23 17:32:13 +01:00
Jan Niklas Hasse
a30ccaef73
Merge pull request #1879 from kadler/aix-cleanup
Fix building on AIX
2020-11-14 16:03:41 +01:00
Jan Niklas Hasse
a0b56413e4
Merge pull request #1880 from kadler/fix-hash-benchmark
Fix buffer overread in hash_collision_benchmark.cc
2020-11-14 00:31:45 +01:00
Jan Niklas Hasse
a03dd05def
Merge pull request #1878 from hdf89shfdfs/multi_generator_bug
Fix mulit-configuration bug
2020-11-14 00:03:47 +01:00
Kevin Adler
a8ad533289
Fix buffer overread in hash_collision_benchmark.cc
The randomly generated command strings are not null-terminated and
implicitly converted to StringPiece objects, which will use strlen to
determine how long the passed `char*` is. Without the null terminator,
this results in undefined behavior and regularly causes crashes on AIX.
2020-11-13 17:02:55 -06:00
Kevin Adler
92fc37555f
Fix test crashes on AIX
Both hash_collision_bench and manifest_parser_perftest crash on AIX with

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
IOT/Abort trap (core dumped)

32-bit AIX applications by default allocates only a single 256M segment
for stack and heap for 32-bit applications, which is insufficient for
these tests. When building these tests on AIX in 32-bit mode, increase
the max number of segments so they will run without crashing.
2020-11-13 15:40:51 -06:00
Kevin Adler
b52970e86b
Add libperfstat to AIX CMake build 2020-11-13 15:40:51 -06:00
Kevin Adler
1cb029b33c
Use internal getopt for IBM i and AIX 2020-11-13 15:40:51 -06:00
hdf89shfdfs
8cf4a393fa Fix mulit-configuration bug. This affected users who use
multi-configuration generators for building ninja.
2020-11-13 07:07:02 -05:00
Orgad Shaneh
d709a37d14 Suppress MSVC warnings
* D9025: overriding '/GR' with '/GR-'
* C4100: 'argc': unreferenced formal parameter
* C4244: '=': conversion from 'int' to 'char', possible loss of data (on tolower)
* C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
* C4702: unreachable code (after Fatal)
* C4706: assignment within conditional expression
* C4996: 'strcpy': This function or variable may be unsafe
2020-11-11 13:52:54 +02:00
Jan Niklas Hasse
3094b5c289
Merge pull request #1787 from neheb/str
[clang-tidy] remove pointless string init
2020-11-10 11:34:44 +00:00
Rosen Penev
9fa3491284
[clang-tidy] remove pointless string init
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-07 12:27:26 -08:00
Jan Niklas Hasse
c09122cc3d Replace Travis CI with GitHub Actions 2020-11-06 19:21:31 +00:00
Jan Niklas Hasse
17bcd4c8d6
Merge pull request #1867 from jhasse/github-actions-docker
GitHub Actions: Run more tests on Ubuntu 20.04 (Docker)
2020-11-06 16:09:25 +01:00
Jan Niklas Hasse
7653ebd059
Merge pull request #1870 from nmulcahey/cmake
cmake: Use ${CMAKE_COMMAND} instead of `cmake`
2020-11-05 09:34:25 +01:00
Nathan Mulcahey
f92b5b61f3 cmake: Use ${CMAKE_COMMAND} instead of cmake
Not all users have `cmake` on their PATH and this causes a build
failure.
2020-11-03 08:41:20 -08:00
Jan Niklas Hasse
e87c49751e
Merge pull request #1868 from kadler/fix-aix-signal-checking
Handle process signalling correctly on AIX
2020-11-02 17:02:59 +01:00
Jan Niklas Hasse
0b5be1489a
Merge pull request #1834 from jhasse/close-during-generator
Close BuildLog while running generators, fix #1724
2020-11-02 17:02:40 +01:00
Kevin Adler
7ea6c537d2
Handle process signalling correctly on AIX
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
2020-10-31 01:02:37 -05:00
Jan Niklas Hasse
ee2e2faa13 GitHub Actions: Run more tests on Ubuntu 20.04 (Docker) 2020-10-31 01:03:09 +01:00
Colin Cross
03cbfc6522 Add unique IDs to edges
Edges are nominally ordered by order in the build manifest, but in
fact are ordered by memory address.  In most cases the memory address
will be monontonically increasing.  Since serialized build output will
need unique IDs, add a monotonically increasing ID to edges, and use
that for sorting instead of memory address.
2020-10-30 10:58:36 +01:00
Jan Niklas Hasse
d45ff8ebf8 Check return value of setvbuf, fix #509 2020-10-30 10:02:35 +01:00
Jan Niklas Hasse
8323cf108f
Merge pull request #1865 from ThePrez/ibmi
build: Add IBM i compile/link flags
2020-10-30 09:29:28 +01:00
Jesse Gorzinski
e74884f026 fixup: remove unneeded CMAKE_C_FLAGS 2020-10-29 10:33:49 -05:00
Jesse Gorzinski
5203aa49ed build: Add IBM i compile/link flags 2020-10-29 10:00:47 -05:00
Jan Niklas Hasse
5993141c09
Merge pull request #1614 from splinter-build/std-namespace-for-headerfiles
Remove 'using namespace std' from header files, properly namespace all std symbols
2020-10-19 12:45:10 +02:00
Jan Niklas Hasse
08eb91637a
Merge pull request #1855 from splinter-build/add-sanitizers
Add debug build with sanitizers support, fix scan-build
2020-10-03 13:21:35 +02:00
Michael Jones
6fa1c59e02 Add debug build with sanitizers support 2020-10-02 12:46:03 -05:00
Jan Niklas Hasse
3dc8664859
Merge pull request #1852 from splinter-build/scan-build
Add clang-analyze to build
2020-10-02 18:44:42 +02:00