chromium-src-build/util/BUILD.gn

52 строки
1.3 KiB
Plaintext
Исходник Обычный вид История

# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
Support dummy commit for LASTCHANGE This is to generate reproducible binary between commits for Linux by giving use_dummy_lastchange=true in args.gn. This CL makes binaries independent from commit hash at least for below (time consuming) targets on Linux. * content_unittests * interactive_ui_tests * content_shell (for webkit_layout_tests) * content_browsertests * browser_tests If we can generate deterministic binary, test execution on build bot can be cached. And it will improve CQ cycle time. But we don't know how often we make changes not introducing functional change in binaries. So this CL is mainly for getting some stats from test on Linux buildbot and evaluate whether it is better to go forward or not for other platforms. See more backgrounds here. https://docs.google.com/document/d/16dalG0ssugZlwc7BBzUoBQUmuqM0S_gwtG2uxL0htdw/edit# TBR: pfeldman@chromium.org Bug: 869348 Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I1b351b2135fd5e749ed575484b2182e847a420c9 Reviewed-on: https://chromium-review.googlesource.com/1151169 Commit-Queue: Takuto Ikuta <tikuta@chromium.org> Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org> Reviewed-by: Misha Efimov <mef@chromium.org> Reviewed-by: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#579668} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 36541eb81aae62b267dcc88d1fdaef912450299a
2018-08-01 05:09:56 +03:00
import("//build/util/lastchange.gni")
action("webkit_version") {
script = "version.py"
template_file = "webkit_version.h.in"
gn format //build A starting point for doing all of src, and adding a PRESUBMIT. Includes https://codereview.chromium.org/772663002/ and https://codereview.chromium.org/770053002/. I haven't pushed new binaries yet. Generated via: > cd build > git ls-files *.gn *.gni | sed -e "s/^/@..\\\\out\\\\Debug\\\\gn format --in-place /" >x.bat && x.bat The only things that I don't love in the current output are: 1. Turning args = [ "--depfile", rebase_path(depfile, root_build_dir), "--android-sdk-tools", rebased_android_sdk_build_tools, "--dex-path", rebased_output, ] into: args = [ "--depfile", rebase_path(depfile, root_build_dir), "--android-sdk-tools", rebased_android_sdk_build_tools, "--dex-path", rebased_output, ] The heuristic for this isn't trivial though, and it also affects e.g. '-Xclang' in cflags, as well as assignments to temporaries that are later assigned to args. 2. Turning single line if (defined(invoker.inputs)) { inputs = invoker.inputs } into if (defined(invoker.inputs)) { inputs = invoker.inputs } This could be argued to be an improvement, but as it's very boilerplate-y perhaps an exception to allow single line in this case is worthwhile. I think there was discussion of new syntax for this case too, something like "inputs ?= invoker.inputs" maybe. In both cases, I think it's worthwhile to get formatting turned on, and then go back and special case these if we decide it's worthwhile. R=brettw@chromium.org BUG=348474 Review URL: https://codereview.chromium.org/766573003 Cr-Original-Commit-Position: refs/heads/master@{#306305} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: b199254f481c5db36d56e83fce40594b06d2b81f
2014-12-02 03:25:20 +03:00
inputs = [
lastchange_file,
template_file,
]
output_file = "$target_gen_dir/webkit_version.h"
outputs = [
output_file,
]
args = [
# LASTCHANGE contains "<build hash>-<ref>". The user agent only wants the
# "<build hash>" bit, so chop off everything after it.
"-e",
"LASTCHANGE=LASTCHANGE[:LASTCHANGE.find('-')]",
gn format //build A starting point for doing all of src, and adding a PRESUBMIT. Includes https://codereview.chromium.org/772663002/ and https://codereview.chromium.org/770053002/. I haven't pushed new binaries yet. Generated via: > cd build > git ls-files *.gn *.gni | sed -e "s/^/@..\\\\out\\\\Debug\\\\gn format --in-place /" >x.bat && x.bat The only things that I don't love in the current output are: 1. Turning args = [ "--depfile", rebase_path(depfile, root_build_dir), "--android-sdk-tools", rebased_android_sdk_build_tools, "--dex-path", rebased_output, ] into: args = [ "--depfile", rebase_path(depfile, root_build_dir), "--android-sdk-tools", rebased_android_sdk_build_tools, "--dex-path", rebased_output, ] The heuristic for this isn't trivial though, and it also affects e.g. '-Xclang' in cflags, as well as assignments to temporaries that are later assigned to args. 2. Turning single line if (defined(invoker.inputs)) { inputs = invoker.inputs } into if (defined(invoker.inputs)) { inputs = invoker.inputs } This could be argued to be an improvement, but as it's very boilerplate-y perhaps an exception to allow single line in this case is worthwhile. I think there was discussion of new syntax for this case too, something like "inputs ?= invoker.inputs" maybe. In both cases, I think it's worthwhile to get formatting turned on, and then go back and special case these if we decide it's worthwhile. R=brettw@chromium.org BUG=348474 Review URL: https://codereview.chromium.org/766573003 Cr-Original-Commit-Position: refs/heads/master@{#306305} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: b199254f481c5db36d56e83fce40594b06d2b81f
2014-12-02 03:25:20 +03:00
"-f",
rebase_path(lastchange_file, root_build_dir),
rebase_path(template_file, root_build_dir),
rebase_path(output_file, root_build_dir),
]
}
action("chrome_version_json") {
script = "version.py"
_chrome_version_path = "//chrome/VERSION"
inputs = [
_chrome_version_path,
]
_output_file = "$root_gen_dir/CHROME_VERSION.json"
outputs = [
_output_file,
]
args = [
"--file",
rebase_path(_chrome_version_path, root_build_dir),
"--template",
"{\"full-quoted\": \"\\\"@MAJOR@.@MINOR@.@BUILD@.@PATCH@\\\"\"}",
"--output",
rebase_path(_output_file, root_build_dir),
]
}