Commit Graph

2641 Commits

Author SHA1 Message Date
Alastair Harrison
67f960be1b Improve error handling in inline.sh
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.
2020-08-28 12:18:55 +01:00
Alastair Harrison
5b80abbc72 CMake: Add support for "browse" mode
Fixes ninja-build/ninja#1822, fixes ninja-build/ninja#1853

Adds support for `ninja -t browse` to CMake builds.

The platform support logic is copied from configure.py, so Windows,
Solaris and AIX are treated as 'unsupported' platforms. All other
platforms are assumed to be supported.

As discussed in #1853, when built via CMake the `ninja` executable
looks for a binary called `python` in the current path, in order to
launch the "browse" mode. The behaviour differs from that of the
configure.py script, which looks for a python executable that has the
*same name* as the python executable that invoked the configure script.
2020-08-27 21:50:35 +01:00
Jan Niklas Hasse
9ddd3c9177 Mark this 1.10.1.git 2020-08-18 21:24:50 +02:00
Jan Niklas Hasse
00968321d6
Merge pull request #1780 from jhasse/delay-open
Delay actually opening log files until the first write, fix #1724
2020-08-03 12:48:17 +02:00
David Callu
086a9b2f88 cmake: use PROJECT_{SOURCE,BINARY}_DIR instead of CMAKE_{SOURCE,BINARY}_DIR
CMAKE_SOURCE_DIR refer to the full path to the top level of the current
CMake source tree
PROJECT_SOURCE_DIR refer to the source directory of the last call to the
project() command made in the current directory scope or one of its parents

when ninja is use as a subproject, the build fail because of this.
2020-07-17 09:56:32 +02:00
Dimitris Apostolou
6c5e886aac Fix typos 2020-07-07 13:00:22 +02:00
Nico Weber
48a9fb5d0d
Merge pull request #1804 from ninja-build/nico-patch-2
Include sys/select.h in subprocess-posix.cc
2020-06-21 19:21:51 -04:00
Nico Weber
89984d5729
Merge pull request #1803 from ninja-build/nico-patch-1
Include unistd.h in disk_interface.cc
2020-06-21 19:21:14 -04:00
Nico Weber
b191404828
Include sys/select.h in subprocess-posix.cc
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.
2020-06-21 18:37:46 -04:00
Nico Weber
580f57fe77
Include unistd.h in disk_interface.cc
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.
2020-06-21 18:32:02 -04:00
Jan Niklas Hasse
8948ec2de6 GitHub Actions: Switch to MSVC's subdirectory 2020-06-15 09:39:05 +02:00
Jan Niklas Hasse
86d30f775d
GitHub Actions: PowerShell requires \ instead of / 2020-06-15 09:26:20 +02:00
Jan Niklas Hasse
76ea0462a3
GitHub Actions: Run ninja_test directly (Windows) 2020-06-15 09:19:40 +02:00
Rosen Penev
be6c7afcd1
[clang-tidy] check empty instead of size (#1784)
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-04 09:47:37 +02:00
Rosen Penev
a32a2087b6
[clang-tidy] remove pointless c_str() (#1785)
Found with readability-redundant-string-cstr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-04 09:46:43 +02:00
Jan Niklas Hasse
ea9f736100 Add missing Apache license header, fix #1781 2020-05-25 10:58:34 +02:00
Jan Niklas Hasse
cc79afbc05 Delay actually opening log files until the first write, fix #1724
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.
2020-05-23 18:44:25 +02:00
zero9178
52649de2c5
bugfix: Process escaped colon in GCC depfiles. (#1774)
* 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
2020-05-20 14:38:36 +02:00
Jan Niklas Hasse
cf021f32e6 MinGW now has _mktemp_s, use overload with size parameter
MSVC also used the custom implementation, since the function isn't a
macro and therefore

  #ifndef _mktemp_s

didn't work as intended.
2020-05-18 11:57:34 +02:00
Jan Niklas Hasse
c6148b0c33 GitHub Actions: Run ninja_test directly 2020-05-14 11:07:24 +02:00
Jan Niklas Hasse
9a77d91952
Merge pull request #1769 from scivision/pytest_win
test: skip non-Windows tests if on Windows
2020-04-30 14:47:44 +02:00
Michael Hirsch, Ph.D
e44fcbede9
test: skip non-Windows tests if on Windows 2020-04-27 11:39:48 -04:00
Jan Niklas Hasse
112217185e Add output test for 'no work to do.' 2020-04-24 12:58:20 +02:00
Jan Niklas Hasse
8ca068c395
Merge pull request #1765 from past-due/macos_deployment_target_1
macOS workflow: specify the minimum version of macOS supported
2020-04-18 10:45:40 +02:00
past-due
b91ceb65c8 Add MACOSX_DEPLOYMENT_TARGET to macos workflow 2020-04-17 20:21:03 -04:00
Jan Niklas Hasse
7d00661c1b
Merge pull request #1763 from nomadbyte/master
Null terminate the out2 string passed as filter2 to log.Restat
2020-04-15 09:10:42 +02:00
yydevelop
5fa5f1c15c Null terminate the out2 string passed as filter2 to log.Restat 2020-04-14 19:58:58 -05:00
Jan Niklas Hasse
7c556be510 Turn CONTRIBUTING.md into a link 2020-04-06 16:05:27 +02:00
Jan Niklas Hasse
64ebbcb31a
Merge pull request #1748 from scivision/opts
enable Intel, IBM XL, and PGI compilers without header/source changes
2020-04-06 09:01:47 +02:00
Michael Hirsch, Ph.D
418d59b8a6 only apply optional flags when compiler works 2020-04-06 02:38:13 -04:00
Jan Niklas Hasse
8900fa55b5
Merge pull request #1637 from beevik/windows-create-process-fix
Improve error messages when ninja commands fail on Windows.
2020-03-26 22:55:26 +01:00
Jan Niklas Hasse
b50e1e3bc6
Merge pull request #1756 from floppym/readme
Replace references to README with README.md
2020-03-23 14:20:56 +01:00
Mike Gilbert
b748d08561 Replace references to README with README.md
The README file was renamed to README.md in commit
a37da20ae7.
2020-03-20 19:38:26 -04:00
Jan Niklas Hasse
1f3cc7b720
Merge pull request #1742 from scivision/cmake
CMake: modernize
2020-03-03 11:10:02 +01:00
Michael Hirsch, Ph.D
ea16698e0a
cmake: append instead of set(x ...) 2020-02-20 22:14:27 -05:00
Michael Hirsch, Ph.D
e6f5bcffb3
cmake: remove redundant cmake_policy()
cmake_minimum_required(VERSION 3.15) implicitly sets to NEW all
policies from CMP0094 and older
2020-02-20 22:14:27 -05:00
Jan Niklas Hasse
2ca4c711f7
Merge pull request #1744 from scivision/htmlesc
browse.py: use html.escape for python3
2020-02-20 11:08:20 +01:00
Jan Niklas Hasse
39cf5266dd
Merge pull request #1745 from scivision/ciupdate
CI: update CMake use
2020-02-20 11:07:24 +01:00
Michael Hirsch, Ph.D
f24d01e83c
ci: use latest checkout action 2020-02-19 06:05:44 -05:00
Michael Hirsch, Ph.D
5ae2ce8f55
ci: use contemporary CMake commands and use latest CMake 2020-02-19 06:05:21 -05:00
Michael Hirsch, Ph.D
4d744de3ee
browse.py: use html.escape for python3
fixes #1741
fixes #1736
2020-02-19 05:55:46 -05:00
Jan Niklas Hasse
9fd5d3e00b
Merge pull request #1737 from rezso/patch-1
Add install target to CMake build
2020-02-10 13:31:14 +01:00
rezso
34d1bf2f1d Add install target to CMake build 2020-02-08 19:08:06 +01:00
Jan Niklas Hasse
4853c4d6f1
Merge pull request #1734 from xlotlu/patch-1
fix typo
2020-02-07 22:20:46 +01:00
Ionuț Ciocîrlan
416d529efe
fix typo 2020-02-07 02:15:34 +02:00
Jan Niklas Hasse
9119166b4c Drop deprecated bootstrap.py 2020-02-05 18:11:01 +01:00
Jan Niklas Hasse
12fe8b6ea8 clang-format: Do not derive pointer binding from file
See https://github.com/ninja-build/ninja/pull/1438#issuecomment-483353542
2020-02-05 18:08:54 +01:00
Jan Niklas Hasse
b8e3841d69
Merge pull request #1726 from mathstuf/manual-manifest-reference
manual: remove "manifest" reference from the manual
2020-01-30 09:31:51 +01:00
Ben Boeckel
0644463f57 manual: remove "manifest" reference from the manual
Nothing else describes what a "manifest" is in user-facing docs.
2020-01-29 14:06:30 -05:00
Jan Niklas Hasse
08ecbd6c15 mark this 1.10.0.git 2020-01-27 11:35:41 +01:00