[webkit-dev] Better syntax for GYP (Was Common build system; was Re: WebKit Wishes)

Ryosuke Niwa rniwa at webkit.org
Tue Feb 5 14:01:06 PST 2013


On Tue, Feb 5, 2013 at 1:36 PM, Mark Mentovai <mark at chromium.org> wrote:

> In the end, I don’t think that the actual syntax (as opposed to the
> structured data that it contains) is all that important. GYP input files
> are fairly simple structured data consisting of very few types: dicts,
> lists, strings, and infrequent bools and ints. Any extant or nascent format
> that can handle these is a candidate. If there’s some kind of convergence
> on a beautiful one that’s easy to maintain and quick to parse, there’s no
> reason GYP can’t be taught to read it, even alongside the existing
> JSON-esque format that’s fed to the Python interpreter. If this is the only
> thing standing between a project and its adopting GYP, then it’s a really
> easy one to get over.
>

The syntax has always been the biggest problem when it comes to adopting
GYP in WebKit.

Let's take the following as an example as picked by Maciej
{
  'action_name': 'XMLNames',
  'inputs': [
    '../dom/make_names.pl',
    '../xml/xmlattrs.in',
  ],
  'outputs': [
    '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
    '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.h',
  ],
  'action': [
    'python',
    'scripts/action_makenames.py',
    '<@(_outputs)',
    '--',
    '<@(_inputs)',
    '--',
    '--extraDefines', '<(feature_defines)'
  ],
  'msvs_cygwin_shell': 1,
},

Using a YAML-like syntax, we can rewrite it as:
XMLName:
    inputs:
        <(SHARED_INTERMEDIATE_DIR)/../dom/make_names.pl
        <(SHARED_INTERMEDIATE_DIR)/../xml/xmlattrs.in
    outputs:
        XMLNames.cpp
        XMLNames.h
    action:
        python scripts/action_makenames.py <@(_outputs) -- <@(_inputs) --
--extraDefines <(feature_defines)
    msvs_cygwin_shell: True

To me, this YAML-like syntax reads significantly better.

Now, I don't like all the magic strings like "<(SHARED_INTERMEDIATE_DIR)/../"
and  "<@(_outputs) -- <@(_inputs) -- --extraDefines <(feature_defines)".
Can someone with build system knowlede prettify them?

- R. Niwa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130205/a956bc85/attachment.html>


More information about the webkit-dev mailing list