diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn index bc54953b58e..5bce92ec533 100644 --- a/build/toolchain/win/BUILD.gn +++ b/build/toolchain/win/BUILD.gn @@ -22,6 +22,8 @@ assert(is_win) # This tool will is used as a wrapper for various commands below. tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir) +ninja_path = rebase_path("//buildtools/ninja/ninja") + if (use_goma) { goma_prefix = "$goma_dir/gomacc.exe " } else { @@ -72,7 +74,7 @@ template("msvc_toolchain") { # TODO(brettw) enable this when GN support in the binary has been rolled. #precompiled_header_type = "msvc" pdbname = "{{target_out_dir}}/{{target_output_name}}_c.pdb" - command = "ninja -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname" + command = "$ninja_path -t msvc -e $env -- $cl /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname" depsformat = "msvc" description = "CC {{output}}" outputs = [ @@ -93,7 +95,7 @@ template("msvc_toolchain") { if (is_clang && invoker.current_cpu == "x86") { flags = "-m32" } - command = "ninja -t msvc -e $env -- $cl $flags /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname" + command = "$ninja_path -t msvc -e $env -- $cl $flags /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd$pdbname" depsformat = "msvc" description = "CXX {{output}}" outputs = [ diff --git a/runtime/third_party/binary_size/src/explain_binary_size_delta.py b/runtime/third_party/binary_size/src/explain_binary_size_delta.py index 13f7c120237..ecf59a431f2 100755 --- a/runtime/third_party/binary_size/src/explain_binary_size_delta.py +++ b/runtime/third_party/binary_size/src/explain_binary_size_delta.py @@ -15,7 +15,7 @@ dumps. Example: # obtain symbol data from first binary in /tmp/nm1.dump cd $CHECKOUT1_SRC - ninja -C out/Release binary_size_tool + buildtools/ninja/ninja -C out/Release binary_size_tool tools/binary_size/run_binary_size_analysis \ --library --destdir /tmp/throwaway @@ -23,7 +23,7 @@ dumps. Example: # obtain symbol data from second binary in /tmp/nm2.dump cd $CHECKOUT2_SRC - ninja -C out/Release binary_size_tool + buildtools/ninja/ninja -C out/Release binary_size_tool tools/binary_size/run_binary_size_analysis \ --library --destdir /tmp/throwaway diff --git a/runtime/tools/wiki/xref_extractor/bin/main.dart b/runtime/tools/wiki/xref_extractor/bin/main.dart index f24a9fd7c3b..b785dc71171 100644 --- a/runtime/tools/wiki/xref_extractor/bin/main.dart +++ b/runtime/tools/wiki/xref_extractor/bin/main.dart @@ -88,7 +88,7 @@ Usage: dart runtime/tools/wiki/xref_extractor/bin/main.dart /// same input C++ files and this greatly confuses cquery. Future generateCompileCommands() async { print('Extracting compilation commands from build files for ReleaseX64'); - final result = await Process.run('ninja', [ + final result = await Process.run('buildtools/ninja/ninja', [ '-C', '${Platform.isMacOS ? 'xcodebuild' : 'out'}/ReleaseX64', '-t', diff --git a/tools/build.py b/tools/build.py index aa0f6253ffc..296fe618aee 100755 --- a/tools/build.py +++ b/tools/build.py @@ -167,7 +167,7 @@ def BuildOneConfig(options, targets, target_os, mode, arch, sanitizer): build_config = utils.GetBuildConf(mode, arch, target_os, sanitizer) out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os, sanitizer) using_goma = False - command = ['ninja', '-C', out_dir] + command = ['buildtools/ninja/ninja', '-C', out_dir] if options.verbose: command += ['-v'] if UseGoma(out_dir): diff --git a/tools/generate_idefiles.py b/tools/generate_idefiles.py index afe4d5793e6..6b68ef44aa7 100755 --- a/tools/generate_idefiles.py +++ b/tools/generate_idefiles.py @@ -12,6 +12,7 @@ analysis_options.yaml for the Dart analyzer. import argparse import json import os +import re import subprocess import sys @@ -76,7 +77,8 @@ def GenerateCompileCommands(options): # Remove ninja prepend on Windows. # This is not fully correct, as now it fails to find a sysroot for # Windows. However, clangd completely fails with the `-t` flag. - command = command.replace("ninja -t msvc -e environment.x64 --", "") + command = re.sub(r"([^\s]*)ninja -t msvc -e environment.x64 --", "", + command) # Add sysroot from out\DebugX64\environment.x64 on Windows. # TODO(dacoharkes): Fetch the paths from that file. diff --git a/tools/linux_dist_support/run_debian_build.sh b/tools/linux_dist_support/run_debian_build.sh index 4f096636583..b36eefedb7b 100755 --- a/tools/linux_dist_support/run_debian_build.sh +++ b/tools/linux_dist_support/run_debian_build.sh @@ -4,8 +4,8 @@ # BSD-style license that can be found in the LICENSE file. set -x -ninja=$(which ninja) -depot_tools=$(dirname $ninja) +fetch=$(which fetch) +depot_tools=$(dirname $fetch) image="debian-package:0.1" dockerfile=tools/linux_dist_support/Debian.dockerfile docker build --build-arg depot_tools=$depot_tools -t $image - < $dockerfile