Compile Chromium completely outside of Visual Studio, yet still debug it inside VS?

52 views
Skip to first unread message

Robert Oschler

unread,
Aug 17, 2017, 9:51:47 PM8/17/17
to Chromium-discuss
I have temporarily given up on compiling Chromium until my new PC shows up next week.  I spent a week trying every variation of VS2015, VS2017, x86 vs x64 setting, with NACL and without, etc. and many complete re-fetch and reinstall attempts while trying to get it work.  Nothing worked and the errors were different each trial.  Sometimes "permission denied" on the OBJ files, sometimes VS2015 in particular fatal crashing in numerous places, etc.  Given that each trial took 12 hours to build in VS, since I only (only!) have a quad core with 16 GB of RAM, it's been a long, laborious painful process.  

When I say "nothing worked" I should point out that I did "see a ghost" one time.  For some truly odd reason, the very first time I fetched and built the project it built.  The trouble all started when I modified a widely used header file that triggered a near full rebuild, and the trouble never stopped after that.  I triple-assure you that I did completely wipe the directory I set up for fetching and building the sources before doing a brand new re-fetch.  The only thing I can hypothesize (weakly) is that some idiotic problem with a Visual Studio shadow object or cache, or some other weird file or DLL change wrecked my setup after the full rebuild in a way that I can't figure out, and that there is no information about on the web that I can find.

Next week I'm getting a 16-core with 64 GB of RAM as a last resort.  However, I don't see how it's going to change anything, because running out of memory was never an issue with my current system, as far as I could tell.  Just lots of weird bugs and crashes.

So as a backup last resort, I'm wondering if there is a way to build the Chromium project with Ninja completely *outside* of Visual Studio?  But built in such a way that the executable and symbol tables can still be debugged inside Visual Studio?  Chromium is my first exposure to Ninja so I have no idea how to go about using it directly, assuming that's even an option.  My other reason for wanting to go straight to Ninja is the hope that I'll get better error messages that take me directly to the actual problem.

If all of this doesn't work I am quitting my job and starting a robot llama petting zoo and I hate llamas! (Not really.  I will start a petting zoo but I don't hate llamas, at least not on Sundays),  At this point I wish someone would come up with a Linux/IntelliJ solution that I could try instead.

Yuta Kitamura

unread,
Aug 18, 2017, 1:04:37 AM8/18/17
to robert....@gmail.com, Chromium-discuss
First, I'd recommend reading the following docs thoroughly:

A few individual advice:
  • Disable antivirus in your checkout (it may slow down your build quite a bit; also, some antivirus software is known to be troublesome)
  • Set is_component_build to true, and enable_nacl to false
  • You can build chrome without VS: open command prompt, go to the src/ directory, and hit "ninja -C out\Default chrome". You can still debug the binary with VS or WinDBG. (If I remember correctly, gn --ide option is unnecessary if you just want to debug)
  • You may want to specify -jN (N is a number) option to ninja; type "ninja --help" in command prompt for further info


--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss


JAYTHACEO

unread,
Aug 18, 2017, 1:44:36 PM8/18/17
to Chromium-discuss
Maybe setup a hypervisor and use a Ubuntu/Linux distro.. I seem to find that is easier and solved most of the problems I have had

Robert Oschler

unread,
Aug 18, 2017, 3:12:32 PM8/18/17
to Chromium-discuss, robert....@gmail.com
Hello Yuta,

I already read those docs, several times, and did try  setting is_component_build to true and enable_nacl to false along with other combinations.  No luck.

Thanks for the Ninja tips.  That will be next avenue of attack if the new system does not solve my problems.

You said "gn --ide option is unnecessary if you just want to debug"

Can't I modify the source outside of VS, recompile outside of Ninja, and debug that way?  What am I asking is if VS is necessary at all to work on the Chromium source code, when it comes to either editing or debugging?

Robert Oschler

unread,
Aug 18, 2017, 3:13:46 PM8/18/17
to Chromium-discuss
Hello JAYTHACEO,

I don't know if that's worth the effort or not.  Can you tell me what problems you were having?  That way I can see if they were similar to mine.
Reply all
Reply to author
Forward
0 new messages