New issue
Advanced search Search tips

Issue 667565 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

GN: source_set to static_library change leads to undiagnosable warning/error

Project Member Reported by brucedaw...@chromium.org, Nov 22 2016

Issue description

While changing some source_set targets to static_library I made the change below in chromium\src\native_client\src:

diff --git a/src/trusted/service_runtime/BUILD.gn b/src/trusted/service_runtime/BUILD.gn
index d326b15..707c914 100644
--- a/src/trusted/service_runtime/BUILD.gn
+++ b/src/trusted/service_runtime/BUILD.gn
@@ -46,7 +46,7 @@ source_set("nacl_error_code") {
 }

 if (current_toolchain == nacl_asm_toolchain) {
-  source_set("sel_asm") {
+  static_library("sel_asm") {
     if (current_cpu == "x86") {
       sources = [
         "arch/x86_32/nacl_switch_32.S",

When running "ninja chrome" after this I got the following warnings:

ninja: warning: multiple rules generate fake. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
[1 processes, 1/7 @ 863.6/s : 0.001s ] fake
FAILED: fake
fake
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.

I was able to identify the problem because I had only made a few BUILD.gn changes but in another situation the diagnosis could have been much harder - the warning message and the failure don't seem to indicate the problem very well.

I'm not sure if my args.gn settings matter but here they are:

is_chrome_branded = true
is_component_build = false
is_debug = false
target_cpu = "x86"
 
strange. Is that output really right? I don't know where the "fake" would be coming from.
I'm glad it's not just me who found it inscrutable.

It happens with any of the nacl *_asm source_set targets - which presumably means any of the ones containing .S sources files.
Summary: GN: source_set to static_library change leads to undiagnosable warning/error (was: GN: soure_set to static_library change leads to undiagnosable warning/error)

Sign in to add a comment