wutingcindy / gyp

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

msvs_guid required for proper dependency resolution #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using gyp r901 in Chromium.

I have a temporary/scaffolding target gfx_unittests:

    {
      # TODO(rsesek): Remove this target once ui_unittests is run on the
      # waterfall instead of gfx_unittests.
      'target_name': 'gfx_unittests',
      'type': 'none',
      'msvs_guid': '1D386FA9-2501-41E2-8FE8-527DAF479CE6',
      'dependencies': [
        'ui_unittests',
      ],
      'actions': [
        {
          'message': 'TEMPORARY: Copying ui_unittests to gfx_unittests',
          'variables': {
            'ui_copy_target': '<(PRODUCT_DIR)/ui_unittests<(EXECUTABLE_SUFFIX)',
            'ui_copy_dest': '<(PRODUCT_DIR)/gfx_unittests<(EXECUTABLE_SUFFIX)',
          },
          'inputs': ['<(ui_copy_target)'],
          'outputs': ['<(ui_copy_dest)'],
          'action_name': 'TEMP_copy_ui_unittests',
          'action': [
            'python', '-c',
            'import shutil; ' \
            'shutil.copyfile(\'<(ui_copy_target)\', \'<(ui_copy_dest)\')'
          ]
        }
      ],
    },

That depends on ui_unittests:

  'targets': [
    {
      'target_name': 'ui_unittests',
      'type': 'executable',
      'msvs_guid': 'C412B00F-2098-4833-B3DE-A1B8B7A094F0',
      'dependencies': [
        '../base/base.gyp:base',
        '../base/base.gyp:test_support_base',
        '../skia/skia.gyp:skia',
        '../testing/gmock.gyp:gmock',
        '../testing/gtest.gyp:gtest',
        'ui_base',
        'ui_gfx',
        'gfx_resources',
      ],
      'sources': [
        'base/animation/animation_container_unittest.cc',
        'base/animation/animation_unittest.cc',
     # you get the idea...
    }

I had omitted the msvs_guid attribute from gfx_unittests and the compiler tried 
to build gfx_unittests before ui_unittets. I've attached the trybot build log. 
You'll note in the log that some of the transitive dependencies (like ui_base 
and ui_gfx) weren't built either.

Original issue reported on code.google.com by rsesek@chromium.org on 17 Mar 2011 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago
I was unable to repro this on my Windows machine with a ToT build and ToT gyp 
(r934).  I'm going to try removing all the msvs_guids (starting with just 
src/ui) and see if it passes the try bots.

Original comment by tony@chromium.org on 8 Jun 2011 at 11:16

GoogleCodeExporter commented 9 years ago
Sweet!
Thanks!

Original comment by bradnelson@google.com on 9 Jun 2011 at 12:43

GoogleCodeExporter commented 9 years ago
Looks like it went OK:
http://build.chromium.org/p/tryserver.chromium/builders/win/builds/36097

Original comment by tony@chromium.org on 9 Jun 2011 at 6:47