New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 622282 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug-Regression



Sign in to add a comment

Build of widevinecdm fails with mac_strip_release=1 and branding != Chrome

Project Member Reported by wdzierza...@opera.com, Jun 22 2016

Issue description

Version: 53.0.2774.0
OS: Mac

What steps will reproduce the problem?
(1) Generate projects with these variables set: proprietary_codecs=1 enable_widevine=1 mac_strip_release=1
(2) Build widevinecdm: ninja -C out/Release widevincecdm

What is the expected output?
Build succeeds.

What do you see instead?
[2/2] SOLINK WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib, POSTBUILDS
FAILED: WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.TOC 
if [ ! -e WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib -o ! -e WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.TOC ] || otool -l WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib | grep -q LC_REEXPORT_DYLIB ; then ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-search_paths_first -Wl,-dead_strip -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -arch x86_64 -L./ -install_name @loader_path/libwidevinecdm.dylib -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -stdlib=libc++ -o WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib @WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.rsp && (export BUILT_FRAMEWORKS_DIR=/Users/wdzierzanowski/src/chromium/src/out/Release; export BUILT_PRODUCTS_DIR=/Users/wdzierzanowski/src/chromium/src/out/Release; export CONFIGURATION=Release; export DYLIB_INSTALL_NAME_BASE=@loader_path; export EXECUTABLE_NAME=libwidevinecdm.dylib; export EXECUTABLE_PATH=libwidevinecdm.dylib; export FULL_PRODUCT_NAME=libwidevinecdm.dylib; export LD_DYLIB_INSTALL_NAME=@loader_path/libwidevinecdm.dylib; export MACH_O_TYPE=mh_dylib; export PRODUCT_NAME=widevinecdm; export PRODUCT_TYPE=com.apple.product-type.library.dynamic; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk; export SRCROOT=/Users/wdzierzanowski/src/chromium/src/out/Release/../../third_party/widevine/cdm; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=/Users/wdzierzanowski/src/chromium/src/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=0730; (cd ../../third_party/widevine/cdm && ../../../build/mac/strip_from_xcode); G=$?; ((exit $G) || rm -rf WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib) && exit $G) && { otool -l WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib | grep LC_ID_DYLIB -A 5; nm -gP WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib | cut -f1-2 -d' ' | grep -v U$; true; } > WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.TOC; else ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-search_paths_first -Wl,-dead_strip -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -arch x86_64 -L./ -install_name @loader_path/libwidevinecdm.dylib -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -stdlib=libc++ -o WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib @WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.rsp && (export BUILT_FRAMEWORKS_DIR=/Users/wdzierzanowski/src/chromium/src/out/Release; export BUILT_PRODUCTS_DIR=/Users/wdzierzanowski/src/chromium/src/out/Release; export CONFIGURATION=Release; export DYLIB_INSTALL_NAME_BASE=@loader_path; export EXECUTABLE_NAME=libwidevinecdm.dylib; export EXECUTABLE_PATH=libwidevinecdm.dylib; export FULL_PRODUCT_NAME=libwidevinecdm.dylib; export LD_DYLIB_INSTALL_NAME=@loader_path/libwidevinecdm.dylib; export MACH_O_TYPE=mh_dylib; export PRODUCT_NAME=widevinecdm; export PRODUCT_TYPE=com.apple.product-type.library.dynamic; export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk; export SRCROOT=/Users/wdzierzanowski/src/chromium/src/out/Release/../../third_party/widevine/cdm; export SOURCE_ROOT="${SRCROOT}"; export TARGET_BUILD_DIR=/Users/wdzierzanowski/src/chromium/src/out/Release; export TEMP_DIR="${TMPDIR}"; export XCODE_VERSION_ACTUAL=0730; (cd ../../third_party/widevine/cdm && ../../../build/mac/strip_from_xcode); G=$?; ((exit $G) || rm -rf WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib) && exit $G) && { otool -l WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib | grep LC_ID_DYLIB -A 5; nm -gP WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib | cut -f1-2 -d' ' | grep -v U$; true; } > WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.tmp && if ! cmp -s WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.tmp WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.TOC; then mv WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.tmp WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib.TOC ; fi; fi
Traceback (most recent call last):
  File "/Users/wdzierzanowski/src/chromium/src/third_party/widevine/cdm/../../../build/mac/strip_save_dsym", line 335, in <module>
    sys.exit(main(sys.argv))
  File "/Users/wdzierzanowski/src/chromium/src/third_party/widevine/cdm/../../../build/mac/strip_save_dsym", line 329, in main
    if not strip_and_make_fake_dsym(macho):
  File "/Users/wdzierzanowski/src/chromium/src/third_party/widevine/cdm/../../../build/mac/strip_save_dsym", line 263, in strip_and_make_fake_dsym
    macho_stat = os.stat(macho)
OSError: [Errno 2] No such file or directory: '/Users/wdzierzanowski/src/chromium/src/out/Release/libwidevinecdm.dylib'
ninja: build stopped: subcommand failed.


IIUC, the target type of 'widevinecdm' is set to 'shared_library' if branding != Chrome, because this builds the stub CDM in this case.  For Chrome branding, the target just copies pre-built binaries.  Thus, for branding != Chrome, the postbuild step "Strip If Needed" kicks in and fails, because it's told to look for libwidevinecdm.dylib in the root of out/Release/, while the stub CDM link step uses "-o WidevineCdm/_platform_specific/mac_x64/libwidevinecdm.dylib".
 

Comment 1 by xhw...@chromium.org, Jun 22 2016

Cc: -xhw...@chromium.org rsesek@chromium.org
Owner: xhw...@chromium.org
Status: Assigned (was: Untriaged)
Thanks for catching this. This is similar to issue 611990 where the problem is that strip_save_dsym doesn't support 'product_dir' in gyp or 'output_dir' in GN. The workaround is not to use 'product_dir' or 'output_dir', and copies the library to the destination folder.

Comment 2 by xhw...@chromium.org, Jun 23 2016

Cc: xhw...@chromium.org
Owner: ----
Status: Available (was: Assigned)
mharanczyk: 

Actually I don't have time to do this now. I wonder whether you could help fix this?

The fix should be pretty simple. You can follow the examples here:

https://cs.chromium.org/chromium/src/third_party/widevine/cdm/widevine_cdm.gyp?rcl=0&l=151

https://cs.chromium.org/chromium/src/media/media_cdm.gypi?rcl=0&l=190

According to https://bugs.chromium.org/p/chromium/issues/detail?id=330301#c14, you don't need to worry about GN builds.
Owner: wdzierza...@opera.com
Status: Assigned (was: Available)
Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 14 2016

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

commit 4b974c6063233f9e9874d5bde97883b8a57af638
Author: wdzierzanowski <wdzierzanowski@opera.com>
Date: Thu Jul 14 00:48:13 2016

Fix build of Widevine CDM stub on Mac

The combination of 'branding=Chromium' and 'enable_widevine=1' causes
'widevinecdm' to be a 'shared_library' build of the CDM stub.
Additionally combined with 'mac_strip_release=1', this triggers
'strip_save_dsym', which fails, because it doesn't support
'product_dir'.

This fix does to 'widevinecdm' what has already been done to
'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
and strips the stub binary, and 'widevinecdm' which just copies the
binary.

BUG= 622282 

TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful

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

[modify] https://crrev.com/4b974c6063233f9e9874d5bde97883b8a57af638/third_party/widevine/cdm/widevine_cdm.gyp

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 14 2016

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

commit d02d6024aa81ad854ad407d3b7525bd73b84b251
Author: yosin <yosin@chromium.org>
Date: Thu Jul 14 05:36:38 2016

Revert of Fix build of Widevine CDM stub on Mac (patchset #2 id:20001 of https://codereview.chromium.org/2117343005/ )

Reason for revert:
Build failure in win-asan bot:

https://uberchromegw.corp.google.com/i/official.desktop/builders/win-asan/builds/313/steps/compile/logs/stdio

ninja -w dupbuild=err -C C:\b\build\slave\win-asan\build\src\out\Release chrome_official_builder
ninja: Entering directory `C:\b\build\slave\win-asan\build\src\out\Release'
[Error 2] The system cannot find the file specified: 'C:\\b\\build\\slave\\win-asan\\build\\src\\out\\Release\\.ninja_log'
ninja: error: obj\third_party\widevine\cdm\widevinecdm_binary.ninja:108: multiple rules generate WidevineCdm/_platform_specific/win_x86/widevinecdm.dll [-w dupbuild=err]

Original issue's description:
> Fix build of Widevine CDM stub on Mac
>
> The combination of 'branding=Chromium' and 'enable_widevine=1' causes
> 'widevinecdm' to be a 'shared_library' build of the CDM stub.
> Additionally combined with 'mac_strip_release=1', this triggers
> 'strip_save_dsym', which fails, because it doesn't support
> 'product_dir'.
>
> This fix does to 'widevinecdm' what has already been done to
> 'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
> and strips the stub binary, and 'widevinecdm' which just copies the
> binary.
>
> BUG= 622282 
>
> TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful
>
> Committed: https://crrev.com/4b974c6063233f9e9874d5bde97883b8a57af638
> Cr-Commit-Position: refs/heads/master@{#405371}

TBR=ddorwin@chromium.org,xhwang@chromium.org,wdzierzanowski@opera.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 622282 

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

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

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 14 2016

Labels: merge-merged-2796
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80cb30b6100e737e492fbdc90316d3235d315ff9

commit 80cb30b6100e737e492fbdc90316d3235d315ff9
Author: Yoshifumi Inoue <yosin@chromium.org>
Date: Thu Jul 14 05:50:14 2016

Revert of Fix build of Widevine CDM stub on Mac (patchset #2 id:20001 of https://codereview.chromium.org/2117343005/ )

Reason for revert:
Build failure in win-asan bot:

https://uberchromegw.corp.google.com/i/official.desktop/builders/win-asan/builds/313/steps/compile/logs/stdio

ninja -w dupbuild=err -C C:\b\build\slave\win-asan\build\src\out\Release chrome_official_builder
ninja: Entering directory `C:\b\build\slave\win-asan\build\src\out\Release'
[Error 2] The system cannot find the file specified: 'C:\\b\\build\\slave\\win-asan\\build\\src\\out\\Release\\.ninja_log'
ninja: error: obj\third_party\widevine\cdm\widevinecdm_binary.ninja:108: multiple rules generate WidevineCdm/_platform_specific/win_x86/widevinecdm.dll [-w dupbuild=err]

Original issue's description:
> Fix build of Widevine CDM stub on Mac
>
> The combination of 'branding=Chromium' and 'enable_widevine=1' causes
> 'widevinecdm' to be a 'shared_library' build of the CDM stub.
> Additionally combined with 'mac_strip_release=1', this triggers
> 'strip_save_dsym', which fails, because it doesn't support
> 'product_dir'.
>
> This fix does to 'widevinecdm' what has already been done to
> 'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
> and strips the stub binary, and 'widevinecdm' which just copies the
> binary.
>
> BUG= 622282 
>
> TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful
>
> Committed: https://crrev.com/4b974c6063233f9e9874d5bde97883b8a57af638
> Cr-Commit-Position: refs/heads/master@{#405371}

TBR=ddorwin@chromium.org,xhwang@chromium.org,wdzierzanowski@opera.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 622282 

Review-Url: https://codereview.chromium.org/2150853002
Cr-Commit-Position: refs/heads/master@{#405438}
(cherry picked from commit d02d6024aa81ad854ad407d3b7525bd73b84b251)

Review URL: https://codereview.chromium.org/2152663002 .

Cr-Commit-Position: refs/branch-heads/2796@{#2}
Cr-Branched-From: 3b37a9689b42738426fdbf9b225d224e704a5af7-refs/heads/master@{#405391}

[modify] https://crrev.com/80cb30b6100e737e492fbdc90316d3235d315ff9/third_party/widevine/cdm/widevine_cdm.gyp

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 14 2016

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

commit 117144d7ad598ec731f258f5272142708274d635
Author: wdzierzanowski <wdzierzanowski@opera.com>
Date: Thu Jul 14 23:50:30 2016

Reland of "Fix build of Widevine CDM stub on Mac"

The combination of 'branding=Chromium' and 'enable_widevine=1' causes
'widevinecdm' to be a 'shared_library' build of the CDM stub.
Additionally combined with 'mac_strip_release=1', this triggers
'strip_save_dsym', which fails, because it doesn't support
'product_dir'.

This fix does to 'widevinecdm' what has already been done to
'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
and strips the stub binary, and 'widevinecdm' which just copies the
binary.

This CL relands https://codereview.chromium.org/2117343005/ with the
following change:

The new 'widevinecdm_binary' target is now defined conditionally for the
case when it is really needed, to fix the ninja error "multiple rules
generate WidevineCdm/_platform_specific/win_x86/widevinecdm.dll".

BUG= 622282 

TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful

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

[modify] https://crrev.com/117144d7ad598ec731f258f5272142708274d635/third_party/widevine/cdm/widevine_cdm.gyp

Status: Verified (was: Started)
Cc: ddorwin@chromium.org rkuroiwa@chromium.org tinskip@chromium.org
 Issue 627224  has been merged into this issue.
Labels: Merge-Request-53
Please merge to M53 if acceptable.

Comment 12 by dimu@google.com, Jul 15 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
Please merge your change to M53 branch 2785 ASAP (latest by 4:00 PM PST on Monday, 07/18) in order to make it to M53 dev release next week before Beta promotion.
Hi, I suppose this is addressed to me?  Sorry, it's the first time I get a merge request and the process is rather hazy to me.

I've found https://www.chromium.org/developers/how-tos/drover, but I'm not a committer, so that's out of the question.  Please advise.
ddorwin@, could you please help to merge this change to M53 branch 2785 as  wdzierzanowski@opera.com is not a committer.


Project Member

Comment 16 by bugdroid1@chromium.org, Jul 18 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f1182f3cbfccc487ffa7eae74adc61c3b48c8fa

commit 1f1182f3cbfccc487ffa7eae74adc61c3b48c8fa
Author: David Dorwin <ddorwin@chromium.org>
Date: Mon Jul 18 18:10:18 2016

Reland of "Fix build of Widevine CDM stub on Mac"

The combination of 'branding=Chromium' and 'enable_widevine=1' causes
'widevinecdm' to be a 'shared_library' build of the CDM stub.
Additionally combined with 'mac_strip_release=1', this triggers
'strip_save_dsym', which fails, because it doesn't support
'product_dir'.

This fix does to 'widevinecdm' what has already been done to
'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
and strips the stub binary, and 'widevinecdm' which just copies the
binary.

This CL relands https://codereview.chromium.org/2117343005/ with the
following change:

The new 'widevinecdm_binary' target is now defined conditionally for the
case when it is really needed, to fix the ninja error "multiple rules
generate WidevineCdm/_platform_specific/win_x86/widevinecdm.dll".

BUG= 622282 

TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful

Review-Url: https://codereview.chromium.org/2149233003
Cr-Commit-Position: refs/heads/master@{#405635}
(cherry picked from commit 117144d7ad598ec731f258f5272142708274d635)

Review URL: https://codereview.chromium.org/2155253002 .

Cr-Commit-Position: refs/branch-heads/2785@{#185}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[modify] https://crrev.com/1f1182f3cbfccc487ffa7eae74adc61c3b48c8fa/third_party/widevine/cdm/widevine_cdm.gyp

Thank you ddorwin@!

Sign in to add a comment