Commit Graph

5 Commits (faf64f1f63a5cb3e37ed138d97aee953345ff7e9)

Author SHA1 Message Date
Junji Watanabe 3e7206ff0a Remove CPATH,LIBRARY_PATH,SDKROOT env vars set by macOS python3
macOS python3 sets those env vars implicitly. https://openradar.appspot.com/radar?id=5608755232243712

Removing them to avoid changing clang's behaviors.

Fixed: 1403485
Change-Id: I2ecf0cad8a1f69f5d7d180d2a2a003ce97365f3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4149962
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Junji Watanabe <jwata@google.com>
2 years ago
Junji Watanabe 2b1aa8dcab Add single file compile support for Windows in ninja wrappers
ninja.bat can't pass '^' for single file compile.
This change fixes ninja.bat to apply double quotas to args to preserve "^".
Note that ninja.bat still needs "^^" since single "^" is already removed  as an escape character.
This is the same implementation with autoninja.{bat, py}.

Test: http://go/paste/6182226814304256

Bug: 1340825
Change-Id: I183c7890634a77471a617c4cc2b9c8c33bc8487d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4060603
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
2 years ago
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>
2 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>
2 years ago