Skip to content

Commit

Permalink
Revert of GN: Properly mark all NaCl test depencies as data_deps (pat…
Browse files Browse the repository at this point in the history
…chset chromium#2 id:20001 of https://codereview.chromium.org/1547463004/ )

Reason for revert:
broke windows GN build:
https://build.chromium.org/p/chromium.win/builders/Win%20x64%20GN/builds/9754/steps/generate_build_files/logs/stdio

E:\b\build\slave\Win_x64_GN\build\src\buildtools\win\gn gen //out/Release_x64 "--args=is_debug=false is_component_build=false use_goma=true goma_dir=\"E:\b\build\goma\" symbol_level=1" --check
  -> returned 1
ERROR Input to target not generated by a dependency.
The file:
  //out/Release_x64/nacl_irt_x86_64.nexe
is listed as an input or source for the target:
  //chrome/installer/mini_installer:archive(//build/toolchain/win:x64)
but this file was not generated by any dependencies of the target. The target
that generates the file is:
  //ppapi/native_client:nacl_irt_debuglink(//build/toolchain/nacl:irt_x64)

Original issue's description:
> GN: Properly mark all NaCl test depencies as data_deps
>
> NaCl tests and helpers are build as standalone executables and
> hence need to be marked as data_deps to be copied over to shards.
>
> BUG=462791
>
> Committed: https://crrev.com/21255d8b9b0ace0629fd941ee128cf9adf356b31
> Cr-Commit-Position: refs/heads/master@{#367367}

TBR=brettw@chromium.org,bradnelson@chromium.org,phosek@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=462791

Review URL: https://codereview.chromium.org/1555223002

Cr-Commit-Position: refs/heads/master@{#367396}
  • Loading branch information
danbeam authored and Commit bot committed Jan 4, 2016
1 parent 095ae47 commit 65423bc
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 65 deletions.
2 changes: 1 addition & 1 deletion chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ if (!is_android) {
}
if (is_win || is_linux) {
sources += [ "../browser/nacl_host/test/nacl_gdb_browsertest.cc" ]
data_deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ]
deps += [ "//chrome/browser/nacl_host/test:mock_nacl_gdb" ]
}
if (is_win) {
# TODO(halyavin) NaCl on Windows can't open debug stub socket in
Expand Down
6 changes: 3 additions & 3 deletions chrome/test/data/nacl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ group("nacl") {
newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}"
glibc = "//build/toolchain/nacl:glibc_${target_cpu}"
pnacl = "//build/toolchain/nacl:newlib_pnacl"
data_deps = [
deps = [
":exit_status_test($glibc)",
":exit_status_test($newlib)",
":exit_status_test($pnacl)",
Expand Down Expand Up @@ -74,13 +74,13 @@ group("nacl") {
]
if (is_linux) {
nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi"
data_deps += [
deps += [
":irt_exception_test($nonsfi)",
":irt_manifest_file($nonsfi)",
":shared_test_files($nonsfi)",
]
if (is_clang) {
data_deps += [ ":nonsfi_libc_free" ]
deps += [ ":nonsfi_libc_free" ]
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions components/nacl/loader/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ if (is_linux) {
}

group("helper_nonsfi") {
data_deps = [
deps = [
":nacl_helper_nonsfi_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)",
]
}
Expand All @@ -159,7 +159,6 @@ if (is_linux) {
testonly = true
data_deps = [
":helper_nonsfi_unittests",
":nacl_helper_nonsfi_unittests_main_copy(//build/toolchain/nacl:newlib_pnacl_nonsfi)",
]
}
}
Expand Down
5 changes: 1 addition & 4 deletions extensions/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ source_set("app_shell_lib") {
]

if (is_linux) {
deps += [
"//components/nacl/loader:helper_nonsfi",
"//components/nacl/loader:nacl_helper",
]
deps += [ "//components/nacl/loader:nacl_helper" ]
}
}

Expand Down
86 changes: 35 additions & 51 deletions ppapi/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ source_set("ppapi_gles2_lib") {
if (enable_nacl) {
if (is_nacl) {
shared_library("ppapi_cpp_lib_shared") {
output_name = "libppapi_cpp"

# When using gcc, we hide all symbols by default, but that breaks at
# link time as the test executable requires symbols defined in the
# shared library.
Expand All @@ -213,8 +211,7 @@ if (enable_nacl) {
]
}

executable("ppapi_nacl_tests_nexe") {
output_name = "ppapi_nacl_tests"
executable("ppapi_nacl_tests") {
include_dirs = [ "lib/gl/include" ]
sources = ppapi_sources.test_common_source_files +
ppapi_sources.test_nacl_source_files
Expand All @@ -238,7 +235,7 @@ if (enable_nacl) {
action("translate_pexe_to_nexe") {
# We specify the toolchain explicitly because in the Non-SFI case, we
# still want to use the pexe built using the newlib_pnacl toolchain.
tests = ":ppapi_nacl_tests_nexe(//build/toolchain/nacl:newlib_pnacl)"
tests = ":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)"

pexe = get_label_info(tests, "root_out_dir") + "/ppapi_nacl_tests.pexe"
nexe = "${root_out_dir}/ppapi_nacl_tests.nexe"
Expand Down Expand Up @@ -298,29 +295,26 @@ if (enable_nacl) {
}
}

copy("ppapi_nacl_tests_copy") {
copy("nacl_tests_copy") {
sources = [
"${root_out_dir}/ppapi_nacl_tests.nexe",
]

# The CPU names used in tests/ppapi_nacl_tests_newlib.nmf
# are the ones used in GYP (x32 for x86).
if (target_cpu == "x86" ||
(is_nacl_nonsfi && (target_cpu == "x86" || target_cpu == "x64"))) {
nmf_cpu = "x32"
} else {
nmf_cpu = target_cpu
}
if (current_cpu == "pnacl") {
if (is_nacl_nonsfi) {
suffix = "pnacl_newlib_${nmf_cpu}_nonsfi"
suffix = "pnacl"
} else {
if (target_cpu == "x86") {
nmf_cpu = "x32"
} else {
suffix = "pnacl_newlib_${nmf_cpu}"
nmf_cpu = target_cpu
}
if (is_nacl_glibc) {
suffix = "glibc_${nmf_cpu}"
} else {
suffix = "newlib_${nmf_cpu}"
}
} else if (is_nacl_glibc) {
suffix = "glibc_${nmf_cpu}"
} else {
suffix = "newlib_${nmf_cpu}"
}
outputs = [
"${root_build_dir}/{{source_name_part}}_${suffix}.nexe",
Expand All @@ -331,55 +325,45 @@ if (enable_nacl) {
]
} else {
deps = [
":ppapi_nacl_tests_nexe",
":ppapi_nacl_tests",
]
}
}

if (is_nacl_nonsfi) {
generate_nonsfi_test_nmf("ppapi_nacl_tests_nmf") {
nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf"
files = get_target_outputs(":ppapi_nacl_tests_copy")
executable = files[0]
deps = [
":ppapi_nacl_tests_copy",
]
}
} else {
generate_nmf("ppapi_nacl_tests_nmf") {
if (is_nacl_glibc) {
nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf"
stage_dependencies = root_build_dir
} else if (current_cpu == "pnacl") {
nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf"
} else {
nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf"
}
executables = get_target_outputs(":ppapi_nacl_tests_copy")
deps = [
":ppapi_nacl_tests_copy",
]
generate_nmf("ppapi_nacl_tests_nmf") {
if (is_nacl_glibc) {
nmf = "${root_build_dir}/ppapi_nacl_tests_glibc.nmf"
stage_dependencies = root_build_dir
} else if (current_cpu == "pnacl") {
nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl.nmf"
} else {
nmf = "${root_build_dir}/ppapi_nacl_tests_newlib.nmf"
}
executables = get_target_outputs(":nacl_tests_copy")
deps = [
":nacl_tests_copy",
]
}

group("ppapi_nacl_tests") {
data_deps = [
":ppapi_nacl_tests_copy",
":ppapi_nacl_tests_nmf",
generate_nonsfi_test_nmf("ppapi_nacl_tests_pnacl_nonsfi_nmf") {
nmf = "${root_build_dir}/ppapi_nacl_tests_pnacl_nonsfi.nmf"
executable = "${root_out_dir}/ppapi_nacl_tests.nexe"
deps = [
":translate_pexe_to_nexe",
]
}
}

group("ppapi_nacl_tests_all") {
data_deps = [
":copy_test_files",
":ppapi_nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})",
":ppapi_nacl_tests(//build/toolchain/nacl:glibc_${target_cpu})",
":nacl_tests_copy(//build/toolchain/nacl:clang_newlib_${target_cpu})",
":ppapi_nacl_tests_nmf(//build/toolchain/nacl:glibc_${target_cpu})",
]
if (enable_pnacl) {
data_deps += [
":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl)",
":ppapi_nacl_tests(//build/toolchain/nacl:newlib_pnacl_nonsfi)",
":ppapi_nacl_tests_nmf(//build/toolchain/nacl:newlib_pnacl)",
":ppapi_nacl_tests_pnacl_nonsfi_nmf(//build/toolchain/nacl:newlib_pnacl_nonsfi)",
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions ppapi/native_client/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ if (is_nacl) {
}

group("irt") {
data_deps = [
public_deps = [
":nacl_irt_debug(//build/toolchain/nacl:irt_${target_cpu})",
":nacl_irt_debuglink(//build/toolchain/nacl:irt_${target_cpu})",
]

# On 32-bit Windows, we also ship the 64-bit IRT.
if (is_win && target_cpu == "x86") {
data_deps += [
public_deps += [
":nacl_irt_debug(//build/toolchain/nacl:irt_x64)",
":nacl_irt_debuglink(//build/toolchain/nacl:irt_x64)",
]
Expand Down
4 changes: 2 additions & 2 deletions ppapi/tests/extensions/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import("//ppapi/native_client/nacl_test_data.gni")
group("extensions") {
newlib = "//build/toolchain/nacl:clang_newlib_${target_cpu}"
pnacl = "//build/toolchain/nacl:newlib_pnacl"
data_deps = [
deps = [
":ppapi_tests_extensions_background_keepalive($newlib)",
":ppapi_tests_extensions_load_unload($newlib)",
":ppapi_tests_extensions_media_galleries($newlib)",
Expand All @@ -21,7 +21,7 @@ group("extensions") {
]
if ((target_cpu == "x86" || target_cpu == "x64") && is_linux) {
nonsfi = "//build/toolchain/nacl:newlib_pnacl_nonsfi"
data_deps += [ ":ppapi_tests_extensions_packaged_app($nonsfi)" ]
deps += [ ":ppapi_tests_extensions_packaged_app($nonsfi)" ]
}
}

Expand Down

0 comments on commit 65423bc

Please sign in to comment.