diff options
author | Ben Wagner <benjaminwagner@google.com> | 2018-06-19 10:34:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-19 17:29:15 +0000 |
commit | 96aa535b782f31df0f063213c2958acba32a808d (patch) | |
tree | b31c2ac0ba3c7e84f648fec46b4d2e29267b78d8 | |
parent | ba61029c5b4939fc33a8cd5db3e7e19c6742cc4b (diff) |
Remove .bat and .exe from commands where possible.
We expect .BAT and .EXE to be on PATHEXT. Also, although Python
CreateProcess doesn't honor PATHEXT, it will try .EXE. This allows most
commands to be platform-independent, and also resolves the issue with
the cpython package not including python.bat.
No-Tree-Checks: true
Docs-Preview: https://skia.org/?cl=135626
Bug: chromium:852581
Change-Id: Iab4189407df44ff4ad4d37da07ff52414229d397
Reviewed-on: https://skia-review.googlesource.com/135626
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
12 files changed, 25 insertions, 41 deletions
diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn index 1c0c2dc56a..6229e45ee9 100644 --- a/gn/toolchain/BUILD.gn +++ b/gn/toolchain/BUILD.gn @@ -23,10 +23,8 @@ declare_args() { } if (host_os == "win") { - python = "python.bat" stamp = "cmd.exe /c echo >" } else { - python = "python" stamp = "touch" } @@ -180,7 +178,7 @@ toolchain("msvc") { tool("copy") { cp_py = rebase_path("../cp.py") - command = "$python $cp_py {{source}} {{output}}" + command = "python $cp_py {{source}} {{output}}" description = "copy {{source}} {{output}}" } } @@ -247,7 +245,7 @@ template("gcc_like_toolchain") { rspfile = "{{output}}.rsp" rspfile_content = "{{inputs}}" ar_py = rebase_path("../ar.py") - command = "$python $ar_py $ar {{output}} $rspfile" + command = "python $ar_py $ar {{output}} $rspfile" outputs = [ "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", ] @@ -292,13 +290,13 @@ template("gcc_like_toolchain") { tool("copy") { cp_py = rebase_path("../cp.py") - command = "$python $cp_py {{source}} {{output}}" + command = "python $cp_py {{source}} {{output}}" description = "copy {{source}} {{output}}" } tool("copy_bundle_data") { cp_py = rebase_path("../cp.py") - command = "$python $cp_py {{source}} {{output}}" + command = "python $cp_py {{source}} {{output}}" description = "copy_bundle_data {{source}} {{output}}" } diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go index 01098e2605..c9816c712e 100644 --- a/infra/bots/gen_tasks.go +++ b/infra/bots/gen_tasks.go @@ -196,9 +196,6 @@ var ( }, } - RECIPE_BUNDLE_UNIX = "recipe_bundle/recipes" - RECIPE_BUNDLE_WIN = "recipe_bundle/recipes.bat" - // Flags. builderNameSchemaFile = flag.String("builder_name_schema", "", "Path to the builder_name_schema.json file. If not specified, uses infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json from this repo.") assetsDir = flag.String("assets_dir", "", "Directory containing assets.") diff --git a/infra/bots/recipe_modules/build/android.py b/infra/bots/recipe_modules/build/android.py index ba57db89a1..34d4df199b 100644 --- a/infra/bots/recipe_modules/build/android.py +++ b/infra/bots/recipe_modules/build/android.py @@ -58,9 +58,7 @@ def compile_fn(api, checkout_root, out_dir): args['extra_cflags'] = repr(extra_cflags).replace("'", '"') gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted(args.iteritems())) - gn = 'gn.exe' if 'Win' in os else 'gn' - ninja = 'ninja.exe' if 'Win' in os else 'ninja' - gn = skia_dir.join('bin', gn) + gn = skia_dir.join('bin', 'gn') with api.context(cwd=skia_dir): api.run(api.python, 'fetch-gn', @@ -95,7 +93,7 @@ def compile_fn(api, checkout_root, out_dir): else: api.run(api.step, 'gn gen', cmd=[gn, 'gen', out_dir, '--args=' + gn_args]) - api.run(api.step, 'ninja', cmd=[ninja, '-k', '0', '-C', out_dir]) + api.run(api.step, 'ninja', cmd=['ninja', '-k', '0', '-C', out_dir]) def copy_extra_build_products(api, src, dst): diff --git a/infra/bots/recipe_modules/build/chromebook.py b/infra/bots/recipe_modules/build/chromebook.py index f7af5552d3..63e4f781e7 100644 --- a/infra/bots/recipe_modules/build/chromebook.py +++ b/infra/bots/recipe_modules/build/chromebook.py @@ -6,7 +6,6 @@ def compile_fn(api, checkout_root, out_dir): skia_dir = checkout_root.join('skia') configuration = api.vars.builder_cfg.get('configuration') - os = api.vars.builder_cfg.get('os') target_arch = api.vars.builder_cfg.get('target_arch') clang_linux = api.vars.slave_dir.join('clang_linux') @@ -84,10 +83,7 @@ def compile_fn(api, checkout_root, out_dir): args['extra_ldflags'] = repr(extra_ldflags).replace("'", '"') gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted(args.iteritems())) - - gn = 'gn.exe' if 'Win' in os else 'gn' - ninja = 'ninja.exe' if 'Win' in os else 'ninja' - gn = skia_dir.join('bin', gn) + gn = skia_dir.join('bin', 'gn') with api.context(cwd=skia_dir, env=env): api.run(api.python, 'fetch-gn', @@ -95,7 +91,7 @@ def compile_fn(api, checkout_root, out_dir): infra_step=True) api.run(api.step, 'gn gen', cmd=[gn, 'gen', out_dir, '--args=' + gn_args]) api.run(api.step, 'ninja', - cmd=[ninja, '-k', '0', '-C', out_dir, 'nanobench', 'dm']) + cmd=['ninja', '-k', '0', '-C', out_dir, 'nanobench', 'dm']) def copy_extra_build_products(api, src, dst): diff --git a/infra/bots/recipe_modules/build/chromecast.py b/infra/bots/recipe_modules/build/chromecast.py index 9ba5dc6f6d..fcccf4df2f 100644 --- a/infra/bots/recipe_modules/build/chromecast.py +++ b/infra/bots/recipe_modules/build/chromecast.py @@ -6,7 +6,6 @@ def compile_fn(api, checkout_root, out_dir): skia_dir = checkout_root.join('skia') configuration = api.vars.builder_cfg.get('configuration') - os = api.vars.builder_cfg.get('os') target_arch = api.vars.builder_cfg.get('target_arch') # TODO(kjlubick): can this toolchain be replaced/shared with chromebook? @@ -62,10 +61,7 @@ def compile_fn(api, checkout_root, out_dir): args['extra_ldflags'] = repr(extra_ldflags).replace("'", '"') gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted(args.iteritems())) - - gn = 'gn.exe' if 'Win' in os else 'gn' - ninja = 'ninja.exe' if 'Win' in os else 'ninja' - gn = skia_dir.join('bin', gn) + gn = skia_dir.join('bin', 'gn') with api.context(cwd=skia_dir): api.run(api.python, 'fetch-gn', @@ -73,7 +69,7 @@ def compile_fn(api, checkout_root, out_dir): infra_step=True) api.run(api.step, 'gn gen', cmd=[gn, 'gen', out_dir, '--args=' + gn_args]) api.run(api.step, 'ninja', - cmd=[ninja, '-k', '0', '-C', out_dir, 'nanobench', 'dm']) + cmd=['ninja', '-k', '0', '-C', out_dir, 'nanobench', 'dm']) def copy_extra_build_products(api, src, dst): diff --git a/infra/bots/recipe_modules/build/default.py b/infra/bots/recipe_modules/build/default.py index 5c88febe2e..7bdbf4f38b 100644 --- a/infra/bots/recipe_modules/build/default.py +++ b/infra/bots/recipe_modules/build/default.py @@ -249,10 +249,7 @@ def compile_fn(api, checkout_root, out_dir): args['extra_ldflags'] = repr(extra_ldflags).replace("'", '"') gn_args = ' '.join('%s=%s' % (k,v) for (k,v) in sorted(args.iteritems())) - - gn = 'gn.exe' if 'Win' in os else 'gn' - ninja = 'ninja.exe' if 'Win' in os else 'ninja' - gn = skia_dir.join('bin', gn) + gn = skia_dir.join('bin', 'gn') with api.context(cwd=skia_dir): api.run(api.python, @@ -272,7 +269,7 @@ def compile_fn(api, checkout_root, out_dir): with api.env(env): api.run(api.step, 'gn gen', cmd=[gn, 'gen', out_dir, '--args=' + gn_args]) - api.run(api.step, 'ninja', cmd=[ninja, '-k', '0', '-C', out_dir]) + api.run(api.step, 'ninja', cmd=['ninja', '-k', '0', '-C', out_dir]) def copy_extra_build_products(api, src, dst): diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json index ee5e9d1d65..fe220dd36e 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json @@ -29,7 +29,7 @@ }, { "cmd": [ - "[START_DIR]/cache/work/skia/bin/gn.exe", + "[START_DIR]/cache/work/skia/bin/gn", "gen", "[START_DIR]/cache/work/skia/out/Build-Win-Clang-arm64-Release-Android/Release", "--args=extra_cflags=[\"-DDUMMY_ndk_version=42\"] is_debug=false ndk=\"[START_DIR]/n\" target_cpu=\"arm64\"" @@ -43,7 +43,7 @@ }, { "cmd": [ - "ninja.exe", + "ninja", "-k", "0", "-C", diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json index 69aabc3974..5af4f84af2 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json @@ -29,7 +29,7 @@ }, { "cmd": [ - "[START_DIR]/cache/work/skia/bin/gn.exe", + "[START_DIR]/cache/work/skia/bin/gn", "gen", "[START_DIR]/cache/work/skia/out/Build-Win-Clang-x86-Debug-Exceptions/Debug", "--args=cc=\"clang\" clang_win=\"[START_DIR]/clang_win\" cxx=\"clang++\" extra_cflags=[\"-O1\", \"/EHsc\", \"-DDUMMY_clang_win_version=42\"] target_cpu=\"x86\" win_sdk=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c/win_sdk\" win_vc=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c/VC\"" @@ -43,7 +43,7 @@ }, { "cmd": [ - "ninja.exe", + "ninja", "-k", "0", "-C", diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json index 0f8aa55e62..ca19f491c2 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json @@ -29,7 +29,7 @@ }, { "cmd": [ - "[START_DIR]/cache/work/skia/bin/gn.exe", + "[START_DIR]/cache/work/skia/bin/gn", "gen", "[START_DIR]/cache/work/skia/out/Build-Win-Clang-x86_64-Release-Vulkan/Release_x64", "--args=cc=\"clang\" clang_win=\"[START_DIR]/clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_enable_vulkan_debug_layers=false skia_vulkan_sdk=\"[START_DIR]/win_vulkan_sdk\" target_cpu=\"x86_64\" win_sdk=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c/win_sdk\" win_vc=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c/VC\"" @@ -43,7 +43,7 @@ }, { "cmd": [ - "ninja.exe", + "ninja", "-k", "0", "-C", diff --git a/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json b/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json index 93f86d69b2..6f5bdee0e3 100644 --- a/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json +++ b/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json @@ -138,7 +138,7 @@ }, { "cmd": [ - "[START_DIR]/cache/work/skia/bin/gn.exe", + "[START_DIR]/cache/work/skia/bin/gn", "gen", "[START_DIR]/cache/work/skia/out/Build-Win-Clang-x86-Debug/Debug", "--args=cc=\"clang\" clang_win=\"[START_DIR]/clang_win\" cxx=\"clang++\" extra_cflags=[\"-O1\", \"-DDUMMY_clang_win_version=42\"] target_cpu=\"x86\" win_sdk=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c/win_sdk\" win_vc=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c/VC\"" @@ -152,7 +152,7 @@ }, { "cmd": [ - "ninja.exe", + "ninja", "-k", "0", "-C", diff --git a/site/user/build.md b/site/user/build.md index 899a11b581..eaf0f68b1c 100644 --- a/site/user/build.md +++ b/site/user/build.md @@ -263,6 +263,8 @@ You can then pass the VC and SDK paths to GN by setting your GN args: This toolchain is the only way we support 32-bit builds, by also setting `target_cpu="x86"`. There is also a corresponding 2015 toolchain, downloaded via `infra/bots/assets/win_toolchain_2015`. +The Skia build assumes that the PATHEXT environment variable contains ".EXE". + ### Visual Studio Solutions If you use Visual Studio, you may want to pass `--ide=vs` to `bin/gn gen` to diff --git a/tools/git-sync-deps b/tools/git-sync-deps index 78449d9682..7599eacbcb 100755 --- a/tools/git-sync-deps +++ b/tools/git-sync-deps @@ -11,8 +11,8 @@ Args: An optional list of deps_os values. Environment Variables: - GIT_EXECUTABLE: path to "git" binary; if unset, will look for one of - ['git', 'git.exe', 'git.bat'] in your default path. + GIT_EXECUTABLE: path to "git" binary; if unset, will look for git in + your default path. GIT_SYNC_DEPS_PATH: file to get the dependency list from; if unset, will use the file ../DEPS relative to this script's directory. @@ -43,7 +43,7 @@ def git_executable(): A string suitable for passing to subprocess functions, or None. """ envgit = os.environ.get('GIT_EXECUTABLE') - searchlist = ['git', 'git.exe', 'git.bat'] + searchlist = ['git'] if envgit: searchlist.insert(0, envgit) with open(os.devnull, 'w') as devnull: |