Reputation: 2673
I'm trying to build the executable target for ChromeDriver from source with GN, which I installed in a directory on my PATH with Depot Tools, but when I run gn BUILD.gn
I'm getting this error:
gn.py: Could not find checkout in any parent of the current path.
This must be run inside a checkout.
I'm not sure if I need to checkout the entire Chromium directory, if I'm not setting this up correctly?
UPDATE
I've downloaded a working binary of gn with the help of gn_tool.
I'm still unsure what command I'm supposed to run for "building the chromedriver target", because right now every command I try seems to give me this error:
ERROR Can't find source root. I could not find a ".gn" file in the current directory or any parent,and the --root command-line argument was not specified.
...even though there is a BUILD.gn file in the directory where I'm running gn...
Upvotes: 13
Views: 18165
Reputation: 3371
Looks like some dependencies are missing. You can pull the dependencies by running
gclient sync
which should download the required dependencies for Chrome driver to compile. Then run the following commands to start compiling Chrome driver:
gn gen out/YourBuildFolder
ninja -C out/YourBuildFolder chromedriver
The above gn gen...
command will basically prepare the build folder for the ninja build system to compile by copying the dependencies and preparing necessary files. And ninja -C...
command will actually start compiling the files
Hope that works. Thanks
Upvotes: 8
Reputation: 7102
This error occurs when you don't have a buildtools directory, such as the one in src/chromium/buildtools
checked in to your git repository.
A cheap way to get this to work outside of chromium's source tree is to copy theirs to your build dir, e.g.:
cp -r ~/src/chromium/buildtools myrepo/buildtools
and check it in to git
cd myrepo
git add buildtools
git commit -m "add buildtools"
you should then be able to run gn gen out
successfully in that repository.
Upvotes: 0
Reputation: 1
path of depot_tool is not setup, try in terminal:
export PATH="$PATH:/path/to/depot_tools"
in src you have gn as well so that's why code is running.
Src folder does not has gn - executable file. This complaint means that the build system cannot find ng.exe(for windows) file is located in "build_tools" packet(do not confuse with "depot_tools" ). You may set CHROMIUM_BUILDTOOLS_PATH=D:\PROJECTS\Web\ to find it. But you have to download correct version of this.
Upvotes: -1
Reputation: 2386
path of depot_tool is not setup, try in terminal:
export PATH="$PATH:/path/to/depot_tools"
in src you have gn as well so that's why code is running.
Upvotes: -1
Reputation: 229
I had same problem but figured it out.
When I run gn in depot_tool directory, I got same error message.
But I run gn in chromium/src directory, gn works!
Upvotes: 3
Reputation: 249
I have same problem just now.
According to https://chromium.googlesource.com/chromium/src/tools/gn/+/HEAD/docs/standalone.md, '.gn' and other build config files are missing. It seems the project can not be built standalone. Perhaps you should checkout the entire Chromium directory.
Upvotes: -1