Issue 542 in webp: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':

97 views
Skip to first unread message

jz… via monorail

unread,
Oct 19, 2021, 9:23:36 PM10/19/21
to webp-d...@webmproject.org
Status: Accepted
Owner: jz...@google.com
CC: liam....@gmail.com
Labels: Type-Defect Priority-Medium

New issue 542 by jz...@google.com: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':
https://bugs.chromium.org/p/webp/issues/detail?id=542

from https://groups.google.com/a/webmproject.org/g/webp-discuss/c/LwWaVfKbJGc/m/IRrJi6tBAwAJ:

The issue that i hit was similar to what is described in this thread: https://developer.apple.com/forums/thread/651043

When I include both WebP.xcframework and WebPDemux.xcframework in a project and add link it to a target, i get errors like the following:

error: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':

1) Command: ProcessXCFramework .../ios-twitter-image-pipeline/Extended/WebP.xcframework .../Build/Products/Debug-iphoneos/include/decode.h ios

2) Command: ProcessXCFramework .../ios-twitter-image-pipeline/Extended/WebPDemux.xcframework .../Build/Products/Debug-iphoneos/include/decode.h ios



The problem comes because the Headers directory in the xcframework for each version of the library includes files with the same name. When Xcode copies them into the includes directory, they conflict and the build fails. The suggested fix in the thread was to nest the headers in uniquely named directories within the Headers directory and after doing that, it works.

So in the WebP.xcframework, I move the headers from WebP.xcframework/{platform-archs}/Headers/decode.h to WebP.xcframework/{platform-archs}/Headers/WebP/decode.h and then I am able to import them in Objective C using #import <WebP/decode.h> just like we were doing with WebP.framework in the past.



Now I must admit that I'm not too familiar with xcframeworks and I have no idea if this is the approach that we must take, but I do know that its required in order to use multiple xcframeworks with headers that are named the same. Do you have any thoughts on this?



There is a bit more context here: https://github.com/twitter/ios-twitter-image-pipeline/pull/66

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

jz… via monorail

unread,
Oct 19, 2021, 9:25:00 PM10/19/21
to webp-d...@webmproject.org

Comment #1 on issue 542 by jz...@google.com: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':
https://bugs.chromium.org/p/webp/issues/detail?id=542#c1

The proposed solution of adding the headers to Headers/<xcframework_name>/ seems reasonable if there isn't any additional configuration needed to handle the import in the Xcode project.

jz… via monorail

unread,
Dec 10, 2021, 10:48:20 PM12/10/21
to webp-d...@webmproject.org

Comment #3 on issue 542 by jz...@google.com: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':
https://bugs.chromium.org/p/webp/issues/detail?id=542#c3

Sorry for the delay on this one. I have a change that should work if you'd like to test it out:
https://chromium-review.googlesource.com/c/webm/libwebp/+/3331926

liam.… via monorail

unread,
Dec 11, 2021, 4:03:05 PM12/11/21
to webp-d...@webmproject.org

Comment #4 on issue 542 by liam....@gmail.com: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':
https://bugs.chromium.org/p/webp/issues/detail?id=542#c4

No worries, thanks for working on it! I checked out your patch and confirmed that it builds the frameworks as required and they work well in the Twitter Image Pipeline project so it looks good from my side

Git Watcher via monorail

unread,
Dec 14, 2021, 5:23:12 PM12/14/21
to webp-d...@webmproject.org

Comment #5 on issue 542 by Git Watcher: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':
https://bugs.chromium.org/p/webp/issues/detail?id=542#c5

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/e94716e27c852053b7baa843b52a62e54c978d9e

commit e94716e27c852053b7baa843b52a62e54c978d9e
Author: James Zern <jz...@google.com>
Date: Sat Dec 11 03:44:36 2021

xcframeworkbuild.sh: place headers in a subdir

Headers/<framework> rather than Headers/ to avoid a Xcode error when
using multiple frameworks:
error: Multiple commands produce
'.../Build/Products/Debug-iphoneos/include/types.h'

WebPMux.xcframework/ios-arm64_i386_x86_64-simulator/Headers/WebPMux
WebPMux.xcframework/ios-arm64_armv7_armv7s/Headers/WebPMux
WebPMux.xcframework/macos-arm64_x86_64/Headers/WebPMux
WebPMux.xcframework/ios-arm64_x86_64-maccatalyst/Headers/WebPMux
WebPDecoder.xcframework/ios-arm64_i386_x86_64-simulator/Headers/WebPDecoder
WebPDecoder.xcframework/ios-arm64_armv7_armv7s/Headers/WebPDecoder
WebPDecoder.xcframework/macos-arm64_x86_64/Headers/WebPDecoder
WebPDecoder.xcframework/ios-arm64_x86_64-maccatalyst/Headers/WebPDecoder
WebPDemux.xcframework/ios-arm64_i386_x86_64-simulator/Headers/WebPDemux
WebPDemux.xcframework/ios-arm64_armv7_armv7s/Headers/WebPDemux
WebPDemux.xcframework/macos-arm64_x86_64/Headers/WebPDemux
WebPDemux.xcframework/ios-arm64_x86_64-maccatalyst/Headers/WebPDemux
WebP.xcframework/ios-arm64_i386_x86_64-simulator/Headers/WebP
WebP.xcframework/ios-arm64_armv7_armv7s/Headers/WebP
WebP.xcframework/macos-arm64_x86_64/Headers/WebP
WebP.xcframework/ios-arm64_x86_64-maccatalyst/Headers/WebP

Bug: webp:542
Change-Id: Ic7e03d85d2119597e422b9cf68b3ac5a892d494d

[modify] https://crrev.com/e94716e27c852053b7baa843b52a62e54c978d9e/xcframeworkbuild.sh

jz… via monorail

unread,
Dec 14, 2021, 5:24:58 PM12/14/21
to webp-d...@webmproject.org
Updates:
Labels: v1.2.2
Status: Fixed

Comment #6 on issue 542 by jz...@google.com: xcframework: Multiple commands produce '.../Build/Products/Debug-iphoneos/include/demux.h':
https://bugs.chromium.org/p/webp/issues/detail?id=542#c6

Thanks again for the report, the suggested fix and testing it out. This will be included in the 1.2.2 release.
Reply all
Reply to author
Forward
0 new messages