Commit 3bedee68 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[build] Exclude nosnap targets on nosnap builds

When using ninja to build without specifying explicit targets,
all existing targets in any BUILD.gn file are built/executed.

We now hide the snapshot targets behind the snapshot condition
to prevent them from being built and executed in nosnap builds.

CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_nosnap_rel

Bug: v8:7089
Change-Id: I4cd8ebadc377fd20b3887e9628990a75732ab74c
Reviewed-on: https://chromium-review.googlesource.com/778320Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49477}
parent e9d60225
......@@ -768,66 +768,68 @@ action("postmortem-metadata") {
rebase_path(sources, root_build_dir)
}
action("run_mksnapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [
":mksnapshot($v8_snapshot_toolchain)",
]
if (v8_use_snapshot) {
action("run_mksnapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
script = "tools/run.py"
deps = [
":mksnapshot($v8_snapshot_toolchain)",
]
sources = []
script = "tools/run.py"
outputs = [
"$target_gen_dir/snapshot.cc",
]
sources = []
args = [
"./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
"root_out_dir") + "/mksnapshot",
root_build_dir),
"--turbo_instruction_scheduling",
"--startup_src",
rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
]
if (v8_random_seed != "0") {
args += [
"--random-seed",
v8_random_seed,
outputs = [
"$target_gen_dir/snapshot.cc",
]
}
if (v8_os_page_size != "0") {
args += [
"--v8_os_page_size",
v8_os_page_size,
args = [
"./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
"root_out_dir") + "/mksnapshot",
root_build_dir),
"--turbo_instruction_scheduling",
"--startup_src",
rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
]
}
if (v8_perf_prof_unwinding_info) {
args += [ "--perf-prof-unwinding-info" ]
}
if (v8_random_seed != "0") {
args += [
"--random-seed",
v8_random_seed,
]
}
if (v8_use_external_startup_data) {
outputs += [ "$root_out_dir/snapshot_blob.bin" ]
args += [
"--startup_blob",
rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir),
]
}
if (v8_os_page_size != "0") {
args += [
"--v8_os_page_size",
v8_os_page_size,
]
}
if (v8_embed_script != "") {
sources += [ v8_embed_script ]
args += [ rebase_path(v8_embed_script, root_build_dir) ]
}
if (v8_perf_prof_unwinding_info) {
args += [ "--perf-prof-unwinding-info" ]
}
if (v8_enable_fast_mksnapshot) {
args += [
"--no-turbo-rewrite-far-jumps",
"--no-turbo-verify-allocation",
]
if (v8_use_external_startup_data) {
outputs += [ "$root_out_dir/snapshot_blob.bin" ]
args += [
"--startup_blob",
rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir),
]
}
if (v8_embed_script != "") {
sources += [ v8_embed_script ]
args += [ rebase_path(v8_embed_script, root_build_dir) ]
}
if (v8_enable_fast_mksnapshot) {
args += [
"--no-turbo-rewrite-far-jumps",
"--no-turbo-verify-allocation",
]
}
}
}
......@@ -909,44 +911,46 @@ v8_source_set("v8_nosnapshot") {
configs = [ ":internal_config" ]
}
v8_source_set("v8_snapshot") {
# Only targets in this file and the top-level visibility target can
# depend on this.
visibility = [
":*",
"//:gn_visibility",
]
deps = [
":js2c",
":js2c_experimental_extras",
":js2c_extras",
":v8_base",
]
public_deps = [
# This should be public so downstream targets can declare the snapshot
# output file as their inputs.
":run_mksnapshot",
]
if (v8_use_snapshot) {
v8_source_set("v8_snapshot") {
# Only targets in this file and the top-level visibility target can
# depend on this.
visibility = [
":*",
"//:gn_visibility",
]
sources = [
"$target_gen_dir/experimental-extras-libraries.cc",
"$target_gen_dir/extras-libraries.cc",
"$target_gen_dir/libraries.cc",
"$target_gen_dir/snapshot.cc",
"src/setup-isolate-deserialize.cc",
]
deps = [
":js2c",
":js2c_experimental_extras",
":js2c_extras",
":v8_base",
]
public_deps = [
# This should be public so downstream targets can declare the snapshot
# output file as their inputs.
":run_mksnapshot",
]
if (use_jumbo_build == true) {
jumbo_excluded_sources = [
# TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
# Generated source, contains same variable names as libraries.cc
sources = [
"$target_gen_dir/experimental-extras-libraries.cc",
"$target_gen_dir/extras-libraries.cc",
"$target_gen_dir/libraries.cc",
"$target_gen_dir/snapshot.cc",
"src/setup-isolate-deserialize.cc",
]
}
configs = [ ":internal_config" ]
if (use_jumbo_build == true) {
jumbo_excluded_sources = [
# TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
# Generated source, contains same variable names as libraries.cc
"$target_gen_dir/experimental-extras-libraries.cc",
"$target_gen_dir/libraries.cc",
]
}
configs = [ ":internal_config" ]
}
}
if (v8_use_external_startup_data) {
......@@ -2678,7 +2682,7 @@ v8_source_set("fuzzer_support") {
# Executables
#
if (current_toolchain == v8_snapshot_toolchain) {
if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment