Could not find gn.exe

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Could not find gn.exe

Postby Mayhew » Mon Mar 19, 2018 5:29 pm

I'm following the manual build setup steps and am seeing the following failure at the create.bat step

Generating CEF project files...
________ running 'gn gen out\Debug_GN_x86 --ide=vs2017 --sln=cef --filters=//cef/*' in 'c:\cef\code\chromium_git\chromium\src'
gn.py: Could not find gn executable at: c:\cef\code\chromium_git\chromium\src\buildtools\win\gn.exe

I do not see gn.exe in the buildtools\win folder. I didn't see any errors in the update steps. Is it possible I'm missing another environment var? I have GYP_MSVS_VERSION set to 2017.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: Could not find gn.exe

Postby Mayhew » Mon Mar 19, 2018 5:36 pm

Nevermind. I think I missed some instlall steps when installing VC2017. Trying that now.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: Could not find gn.exe

Postby Mayhew » Mon Mar 19, 2018 6:08 pm

Okay, that didn't work either. I'm not sure what part of the process gets gn.exe as it is not part of the depot_tools zip file. Any insight on where that file is retrieved?
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: Could not find gn.exe

Postby Mayhew » Mon Mar 19, 2018 6:27 pm

Okay, I think I may have needed to specify DEPOT_TOOLS_WIN_TOOLCHAIN=0 as an environment var. Running gclient runhooks seemed to add the gn.exe that was missing.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: Could not find gn.exe

Postby magreenblatt » Mon Mar 19, 2018 6:31 pm

GN should be downloaded by Chromium due to this: https://cs.chromium.org/chromium/src/DE ... mium&l=895. That step is triggered by automate-git.py calling `gclient sync` after checking out the Chromium source code. Did the checkout/sync succeed (check the console for error messages)? Does `src/buildtools/win/gn.exe` exist in your checkout?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Could not find gn.exe

Postby Mayhew » Mon Mar 19, 2018 6:50 pm

I didn't get any errors during the original update.bat (which calls automate-git.py) and create.bat BUT, I hadn't defined DEPOT_TOOLS_WIN_TOOLCHAIN=0 at that initial run so maybe that affected it...I'm not sure. I wanted to avoid a full forced sync so I tried the gclient runhooks which did run the gn_win section of the config. It is working now, but I wish I could narrow it down to ensure there isn't a step missing in the manual build doc.

Also, I hadn't followed all the steps for Windows here so maybe that caused some issues but again, not sure.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: Could not find gn.exe

Postby magreenblatt » Mon Mar 19, 2018 7:12 pm

The cef_create_projects script sets DEPOT_TOOLS_WIN_TOOLCHAIN=0 internally. To avoid confusion you should follow just the CEF build instructions (and not the Chromium instructions).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Could not find gn.exe

Postby Mayhew » Tue Mar 20, 2018 3:26 pm

Okay good to know.

For what it's worth, I think the problem may have stemmed from the fact that I did the original steps up through the sync with a path like c:\users\<me>\src\cef\code\blah.. and deep into the sync process there was a failure due to path names exceeding 256 chars, which is not allowed on Win. Rather than start over I moved the path to a shorter name like c:\cef\code\blah... and continued on. It's likely that my issues here were caused by that initial failure and may have been resolvable by a full force resync but I wasn't willing to do that.

That all said, it may be worth noting in the win setup info that your source path can run over the Win path limit if you add about 20 additional chars to add to your overall path naming vs using "c:\code". I.e. c:\<my path that has to be 20 chars or less>\code will work but longer ones will fail.
Mayhew
Expert
 
Posts: 303
Joined: Mon Apr 18, 2011 8:02 pm

Re: Could not find gn.exe

Postby magreenblatt » Tue Mar 20, 2018 5:43 pm

Thanks, MasterBuildQuickStart instructions updated.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 48 guests