KeyError

84 views
Skip to first unread message

Stu

unread,
Nov 1, 2010, 12:02:17 PM11/1/10
to gyp-developer
Hi all,
I was after a bit of end-user support (apologies if this is the wrong
place, please feel free to direct me to a more appropriate place!).
I'm trying to make use of the cld library as part of the Chromium
source. I see that there is a gyp file in this directory, so am I
correct in saying that the best way to build this library is to use
gyp to make some form of solution that will help me build it?

When I try to gyp the gyp file I get some errors about the library
keyword in the file. This is on Ubuntu, but the same happens on OSX.
This is my ubuntu output:


stuart@mercury:~$ gyp chromium/src/third_party/cld/cld.gyp
Traceback (most recent call last):
File "/usr/bin/gyp", line 18, in <module>
sys.exit(gyp.main(sys.argv[1:]))
File "/usr/lib/pymodules/python2.6/gyp/__init__.py", line 445, in
main
options.circular_check)
File "/usr/lib/pymodules/python2.6/gyp/__init__.py", line 84, in
Load
depth, generator_input_info, check, circular_check)
File "/usr/lib/pymodules/python2.6/gyp/input.py", line 2148, in Load
depth, check)
File "/usr/lib/pymodules/python2.6/gyp/input.py", line 380, in
LoadTargetBuildFile
build_file_path)
File "/usr/lib/pymodules/python2.6/gyp/input.py", line 967, in
ProcessVariablesAndConditionsInDict
build_file)
File "/usr/lib/pymodules/python2.6/gyp/input.py", line 982, in
ProcessVariablesAndConditionsInList
ProcessVariablesAndConditionsInDict(item, is_late, variables,
build_file)
File "/usr/lib/pymodules/python2.6/gyp/input.py", line 896, in
ProcessVariablesAndConditionsInDict
expanded = ExpandVariables(value, is_late, variables, build_file)
File "/usr/lib/pymodules/python2.6/gyp/input.py", line 666, in
ExpandVariables
' in ' + build_file
KeyError: 'Undefined variable library in chromium/src/third_party/cld/
cld.gyp while trying to load chromium/src/third_party/cld/cld.gyp'

Any help would be greatly appreciated.

Cheers,

S.

Evan Martin

unread,
Nov 1, 2010, 12:07:12 PM11/1/10
to Stu, gyp-developer
The Chromium gyp files are all interdependent. "library" is defined
in one of the outer gyp files.

I think it'd probably be easier to reuse cld by importing the files
into your project's current build system.

Michael Moss

unread,
Nov 1, 2010, 12:12:34 PM11/1/10
to Stu, gyp-developer
cld.gyp uses the variable '<(library)', which is defined elsewhere in
chrome. The chrome gyp files tend not to be stand-alone (at a minimum,
cld.gyp pulls in icu/icu.gyp), though in this case, the dependencies
might be reasonably minimal. You can try to force it by exporting
something like:

GYP_DEFINES="library=static"

then run your gyp command again.

Michael

On Mon, Nov 1, 2010 at 9:02 AM, Stu <stuart.b...@gmail.com> wrote:

Evan Martin

unread,
Nov 1, 2010, 12:16:36 PM11/1/10
to Michael Moss, Stu, gyp-developer
Ooh, that's a better idea than mine. But I think you want
"library=shared_library" (with the _library at the end), unless what
you wrote is equivalent.

Evan Martin

unread,
Nov 1, 2010, 12:16:55 PM11/1/10
to Michael Moss, Stu, gyp-developer
Er, library=static_library.

Michael Moss

unread,
Nov 1, 2010, 12:18:06 PM11/1/10
to Evan Martin, Stu, gyp-developer
Yes, sorry, the proper values are either "static_library" or
"shared_library". Thanks.

Thomas Van Lenten

unread,
Nov 1, 2010, 12:21:13 PM11/1/10
to Michael Moss, Stu, gyp-developer
Odds are you need the settings in common.gypi, so using the full files is probably safer then hunting down all the breadcrumbs needed.

TVL

Stu

unread,
Nov 2, 2010, 4:17:00 AM11/2/10
to gyp-developer
Hi all,

Thanks for the pointers. I've tried to build the whole thing under
Windows and this now correctly creates lots of Visual Studio solution
files, one of which is for the cld with its necessary dependencies.
I'm working on it under Linux at the moment. What I actually need is
to use the CLD from within Python, so I need to get the CLD and it's
deps bundled up in a dll I think and then I can import with c_types.

Cheers,
S.

On Nov 1, 4:21 pm, Thomas Van Lenten <thoma...@chromium.org> wrote:
> Odds are you need the settings in common.gypi, so using the full files is
> probably safer then hunting down all the breadcrumbs needed.
>
> TVL
>
>
>
>
>
>
>
> On Mon, Nov 1, 2010 at 12:12 PM, Michael Moss <mm...@chromium.org> wrote:
> > cld.gyp uses the variable '<(library)', which is defined elsewhere in
> > chrome. The chrome gyp files tend not to be stand-alone (at a minimum,
> > cld.gyp pulls in icu/icu.gyp), though in this case, the dependencies
> > might be reasonably minimal. You can try to force it by exporting
> > something like:
>
> > GYP_DEFINES="library=static"
>
> > then run your gyp command again.
>
> > Michael
>
Reply all
Reply to author
Forward
0 new messages