New issue
Advanced search Search tips

Issue 775611 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 746956



Sign in to add a comment

Putting jumbo files in gen/ changes the header search path with microsoft's compiler (and compatible)

Project Member Reported by thakis@chromium.org, Oct 17 2017

Issue description

For whatever reason, I had the file out/gnwin//gen/base/base/trace_event/etw_manifest/chrome_events_win.h in my file system, in addition to the expected file location out/gnwin//gen/base/trace_event/etw_manifest/chrome_events_win.h.

The first file was last touched many months ago, and was virtually empty. Nothing ever picked it up, so it was no problem.

Then I tried the jumbo build today, and I got:

FAILED: obj/base/base/base_jumbo_3.obj 
../../third_party/llvm-build/Release+Asserts/bin/clang-cl --rsp-quoting=posix /nologo /showIncludes  @obj/base/base/base_jumbo_3.obj.rsp /c gen/base/base_jumbo_3.cc /Foobj/base/base/base_jumbo_3.obj /Fd"obj/base/base_cc.pdb"
In file included from gen/base/base_jumbo_3.cc:56:
gen/base/../../../../base/trace_event/trace_event_etw_export_win.cc(30,10):  error: #include resolved using non-portable Microsoft search rules as: gen/base/base/trace_event/etw_manifest/chrome_events_win.h [-Werror,-Wmicrosoft-include]
#include "base/trace_event/etw_manifest/chrome_events_win.h"  // NOLINT
         ^


followed by many screenfuls of errors, and eventually a compiler crash-on-invalid (https://bugs.llvm.org/show_bug.cgi?id=34981).

This is because in Microsoft compilers, the directories of all files in the include stack are also part of the header search path. For details, see slides 34-37 on https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_15 (look at speaker notes)


Since jumbo-generated files hang out in gen/$name like other generated headers, this has the effect of adding gen/$name as a global -I directory for Microsoft compilers, which can cause stale generated files to be picked up, as it was here.


As a fix, I'd suggest that jumbo files go in gen/jumbo/$name instead. That would prevent this.
 

Comment 1 by thakis@chromium.org, Oct 17 2017

I verified that this here made my issue go away:

diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni
index 37b04ccc8d74..2e45f570b25c 100644
--- a/build/config/jumbo.gni
+++ b/build/config/jumbo.gni
@@ -91,6 +91,7 @@ template("internal_jumbo_target") {
         gen_target_dir = alt_gen_target_dir
       }
     }
+    gen_target_dir = "$gen_target_dir/jumbo"
   } else {
     gen_target_dir = "<will not be used>"  # Will not result in
                                            # anything used anyway.

Comment 2 by brat...@opera.com, Oct 25 2017

Cc: yn...@vivaldi.com
Turns out we also have a problem with paths getting too long on Windows (adding yngve at vivaldi to CC) so how to make them more unique and at the same time shorter?

Right now we just use get_path_info("...", "gen_dir") in gn and I don't know of a better way.
Status: Assigned (was: Untriaged)

Sign in to add a comment