New issue
Advanced search Search tips

Issue 615500 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 2
Type: Bug



Sign in to add a comment

widevine_cdm_manifest target copies the whole folder when there's no file to copy

Project Member Reported by xhw...@chromium.org, May 27 2016

Issue description

In third_party/widevine/cdm/widevine_cdm.gyp, we have a widevine_cdm_manifest target:

    {
      # GN version: //third_party/widevine/cdm:widevine_cdm_manifest
      'target_name': 'widevine_cdm_manifest',
      'type': 'none',
      'conditions': [
        [ 'branding == "Chrome"', {
          'copies': [{
            'destination': '<(PRODUCT_DIR)/WidevineCdm',
            'files': [ '<(widevine_cdm_manifest_file)' ],
          }],
        }],
      ],
    },

On platforms like Linux, |widevine_cdm_manifest_file| is empty, where I suppose that nothing will be copied.

However, it seems gyp + ninja don't agree. The ninja file generated is like:

build WidevineCdm/.: copy ../../third_party/widevine/cdm

Then when I build widevine_cdm_manifest, it'll do the following:

COPY ../../third_party/widevine/cdm WidevineCdm

which will copy the whole src/third_party/widevine/cdm folder into out/{Debug|Release}/WidevineCdm.

This doesn't affect anything today, but it looks really bad and should be fixed.

We don't have this issue in GN as GN doesn't allow copy with empty input files.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/35e11eb20c09bef5c5b8ba0eb3b352ab314d94d3

commit 35e11eb20c09bef5c5b8ba0eb3b352ab314d94d3
Author: xhwang <xhwang@chromium.org>
Date: Thu Jun 02 06:16:24 2016

media: Fix widevine_cdm_manifest target

On Linux/ChromeOS, we don't use manifest.json for Widevine CDM.
Therefore the "widevine_cdm_manifest_file" list is empty. Then, in a GYP
build, copying an empty list to a destination will actually cause the
whole folder where the gyp file is located to be copied. See BUG for
more details.

This CL fixes this issue by only coping the manifest when the list is
not empty.

BUG= 615500 
TEST=Tested on Linux where the list is empty and on Windows where the
list is not empty.

Review-Url: https://codereview.chromium.org/2023383003
Cr-Commit-Position: refs/heads/master@{#397308}

[modify] https://crrev.com/35e11eb20c09bef5c5b8ba0eb3b352ab314d94d3/third_party/widevine/cdm/widevine_cdm.gyp

Status: Fixed (was: Available)

Sign in to add a comment