Junji Watanabe
22bbba13ce
Do not show python stack trace in ninja.py when KeyboardInterrupt happens
...
Before
```
❯ ninja -C out/Default
ninja: Entering directory `out/Default'
Traceback (most recent call last):
File "/Users/jwata/depot_tools/ninja.py", line 85, in <module>
sys.exit(main(sys.argv))
File "/Users/jwata/depot_tools/ninja.py", line 79, in main
return subprocess.call([ninja_path] + args[1:])
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 351, in call
return p.wait(timeout=timeout)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1189, in wait
return self._wait(timeout=timeout)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1917, in _wait
(pid, sts) = self._try_wait(0)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1875, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
```
After
```
❯ ninja -C out/Default
ninja: Entering directory `out/Default'
interrupted
```
Fixed: 1398687
Change-Id: I7cbc80f2214d46b492c6e9ade7b0d78766a8a6f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4085366
Reviewed-by: Nico Weber <thakis@chromium.org>
Auto-Submit: Junji Watanabe <jwata@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
2 years ago
Brian Osman
a0cf432171
Tweak ninja fallback logic
...
In Skia (for example), GetPrimarySolutionPath works, but FindGclientRoot
does not (users tend not to use gclient to sync DEPS, etc).
Without this change, we'd get to the loop. If a user had pulled ninja to
third_party/ninja/ninja, then it would work just fine. If they hadn't,
python would throw an exception on the os.path.join line, because we'd
be passing a NoneType as the first argument.
Bug: chromium:1340825
Change-Id: Iab86450c5b6f00bc9c2716b9504debc9a56d9bb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4034942
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
3 years ago
Junji Watanabe
1f67d5573f
Add ninja wrappers to trigger DEPS ninja
...
This is the first step to deprecate ninja binaries in depot_tools.
depot_tools/{ninja, ninja.bat} will call ninja.py, which finds CIPD ninja under src/third_party in the current gclient source tree. https://crrev.com/c/3869740
If it fails to find, it does fallback to an existing ninja binary in depot_tools, until removing the references to the legacy ninja binaries.
# For those who see the deprecation message,
You need to install ninja using DEPS at your project. (https://crrev.com/c/3869740 is an example.)
If your project doesn't have DEPS, you need to install ninja and include it in PATH manually. e.g. sudo apt install ninja-build
Test:
Linux builder: https://ci.chromium.org/swarming/task/5e9cfc917aa3f110?server=chromium-swarm.appspot.com
Windows builder: https://ci.chromium.org/swarming/task/5e9d48885c460b10?server=chromium-swarm.appspot.com
Bug: 1340825
Change-Id: I70d1863d72ddfa65b87a62c9bde8ff63f7641d13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3925341
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
3 years ago