CEF.swift icon indicating copy to clipboard operation
CEF.swift copied to clipboard

Building fails using Carthage on macOS 10.15 and 11.0

Open axelboberg opened this issue 3 years ago β€’ 16 comments

I'm unable to build CEF.swift using Cartridge as it fails compiling at the steps below. This is true for environments on both macOS 10.15 (Xcode 11.6) and macOS 11.0 (Xcode 12.0 beta 5).

The following build commands failed: CompileC /Users/[user]/Library/Caches/org.carthage.CarthageKit/DerivedData/11.6_11E708/CEF.swift/[id]/Build/Intermediates.noindex/ArchiveIntermediates/CEF.swift/IntermediateBuildFilesPath/CEF.swift.build/Release/CEFSandbox.build/Objects-normal/x86_64/cef_library_loader_mac.o /Users/[user]/[project]/Carthage/Checkouts/CEF.swift/External/cef_binary/libcef_dll/wrapper/cef_library_loader_mac.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/[user]/Library/Caches/org.carthage.CarthageKit/DerivedData/11.6_11E708/CEF.swift/[id]/Build/Intermediates.noindex/ArchiveIntermediates/CEF.swift/IntermediateBuildFilesPath/CEF.swift.build/Release/CEFSandbox.build/Objects-normal/x86_64/libcef_dll_dylib.o /Users/[user]/[project]/Carthage/Checkouts/CEF.swift/External/cef_binary/libcef_dll/wrapper/libcef_dll_dylib.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (2 failures)

axelboberg avatar Aug 28 '20 23:08 axelboberg

could you also share what the actual errors are?

lvsti avatar Aug 29 '20 09:08 lvsti

Sorry, it's been a long day. Judging by the logs it seems like it's the following two:

error: Build input file cannot be found: '/Users/[user]/[project]/Carthage/Checkouts/CEF.swift/External/cef_binary/libcef_dll/wrapper/cef_library_loader_mac.mm' (in target 'CEFSandbox' from project 'CEF.swift')

error: Build input file cannot be found: '/Users/[user]/[project]/Carthage/Checkouts/CEF.swift/External/cef_binary/libcef_dll/wrapper/libcef_dll_dylib.cc' (in target 'CEFSandbox' from project 'CEF.swift')

axelboberg avatar Aug 29 '20 19:08 axelboberg

I'm running into the same thing. OS 10.15 and Xcode 10.3

awmcclain avatar Sep 16 '20 21:09 awmcclain

Unfortunately I cannot test this setup because my MBP tops at 10.14 πŸ™ˆ Can you check whether the cef_binary folder actually exists? It should be created by the setup.sh after downloading the CEF bundle.

lvsti avatar Sep 17 '20 19:09 lvsti

Nope, the whole Externals directory isn't there. Let me see if I can wrangle the log

Carthage/Checkouts/CEF.swift virtual-camera βœ— 1d3h β—’

β–Ά ls

CEF.swift LICENSE.txt README.md requirements.txt

CEF.swift.xcodeproj Modules Samples scripts

On Thu, Sep 17, 2020 at 12:46 PM Tamas Lustyik [email protected] wrote:

Unfortunately I cannot test this setup because my MBP tops at 10.14 πŸ™ˆ Can you check whether the cef_binary folder actually exists? It should be created by the setup.sh after downloading the CEF bundle.

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lvsti/CEF.swift/issues/44#issuecomment-694460676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RR6TG7X5TO3XH3HOWS3SGJRR3ANCNFSM4QOTLT6Q .

awmcclain avatar Sep 20 '20 00:09 awmcclain

which branch are you guys on?

lvsti avatar Sep 20 '20 11:09 lvsti

cef_4103

On Sun, Sep 20, 2020 at 4:19 AM Tamas Lustyik [email protected] wrote:

which branch are you guys on?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lvsti/CEF.swift/issues/44#issuecomment-695775424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RR7ORFGPJZD5M4RERW3SGXQKLANCNFSM4QOTLT6Q .

-- Sent from a phone

awmcclain avatar Sep 20 '20 16:09 awmcclain

I've narrowed down the problem. I think the issue is that the CEFSandbox gets built first (because it's a dependency) but it doesn't have the external resources build step, so setup.sh never gets run. I fixed that, but since I'm using Carthage to incorporate CEF into another project it gets confused about the git branch that I'm on.

I can fix that by grabbing the cef branch name from the Cartfile (whenever $CARTHAGE=YES). I'm happy to put all this in a PR unless there's another approach you'd prefer.

On Sun, Sep 20, 2020 at 9:09 AM Andrew McClain [email protected] wrote:

cef_4103

On Sun, Sep 20, 2020 at 4:19 AM Tamas Lustyik [email protected] wrote:

which branch are you guys on?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lvsti/CEF.swift/issues/44#issuecomment-695775424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3RR7ORFGPJZD5M4RERW3SGXQKLANCNFSM4QOTLT6Q .

-- Sent from a phone

awmcclain avatar Sep 21 '20 04:09 awmcclain

Instead of depending on the Cartfile, I'd rather use a branch.txt which contains the name of the branch. I'll submit a fix soon for the 4103 branch.

lvsti avatar Sep 22 '20 20:09 lvsti

BTW I added the setup build phase to the CEFSandbox target as well, thanks for noticing it. There is one weirdness though, the Carthage build now succeeds but only for the second time onward, in the first run it fails to find the same files. Let me know if you have a hunch why.

lvsti avatar Sep 22 '20 20:09 lvsti

I noticed the same thing!

I think it’s because it pre-caches the headers before running the script (at least looking at the logs, there’s a bunch of stuff that happens before the script the second time).

Maybe set up a new dummy target as a dependency of both projects that only runs the setup script?

awmcclain avatar Sep 22 '20 20:09 awmcclain

Maybe set up a new dummy target as a dependency of both projects that only runs the setup script?

That worked for me:

image

johnboiles avatar Sep 17 '21 04:09 johnboiles

@lvsti πŸ‘‹ want me to make a PR for this?

johnboiles avatar Sep 17 '21 04:09 johnboiles

Hmm this fixed the issue for me when building in Xcode but not building an archive with xcodebuild. Hmm

johnboiles avatar Sep 17 '21 05:09 johnboiles

My final solution was to tell Xcode about these output files: image BUT! Xcode goes ahead and creates the External/cef_binary... directory structure if I do that so I also had to add a rm -rf External/cef_binary || true right before creating the symlink in setup.sh.

Kinda messy, but it's working now at least

johnboiles avatar Sep 17 '21 07:09 johnboiles