ChrisPei / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

Late expansion of an empty list contains a single empty string #328

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Late expansion of an empty list in a list context results in one element -- a 
single empty string -- not zero elements as expected.

This happens with both generators I tested, ninja and make.

Building the example below demonstrates the problem.

    {
      'targets': [
        {
          'target_name': 'empty_list_bug',
          'type': 'none',
          'variables': {
            'empty_list': [],
            'early_empty_list': ['<@(empty_list)'],
            'late_empty_list': ['>@(empty_list)'],
          },
          'actions': [
            {
              'action_name': 'echo',
              'inputs': [ '/bin/bash' ],
              'outputs': [ '/tmp/nothing' ],
              'action': [
                'echo',
                'empty_list=(<(empty_list))',
                'early_empty_list=(<(early_empty_list))',
                'late_empty_list=(<(late_empty_list))',
              ],
            },
          ],
        },
      ],
    }

Actual output:
empty_list=() early_empty_list=() late_empty_list=("")

Expected output:
empty_list=() early_empty_list=() late_empty_list=()

Original issue reported on code.google.com by newt@chromium.org on 27 Mar 2013 at 12:17

GoogleCodeExporter commented 9 years ago
Update: this only happens when the variable is later early-expanded.  Not sure 
what the behavior should be here, so perhaps this is working as intended?  
Still seems odd to me.

Original comment by newt@chromium.org on 27 Mar 2013 at 12:43