bblanchon / pdfium-binaries

📰 Binary distribution of PDFium
904 stars 194 forks source link

iOS V8: framework not found for -framework BrowserEngineKit #164

Closed bblanchon closed 6 months ago

bblanchon commented 7 months ago

The iOS V8 build is currently failing with the following error:

FAILED: libpdfium.dylib libpdfium.dylib.TOC 
if [ ! -e "./libpdfium.dylib" -o ! -e "./libpdfium.dylib.TOC" ] || ../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool -l "./libpdfium.dylib" | grep -q LC_REEXPORT_DYLIB ; then TOOL_VERSION=1713155290 ../build/toolchain/apple/linker_driver.py -Wcrl,driver,../third_party/llvm-build/Release+Asserts/bin/clang++ -Wcrl,strippath,../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -Wcrl,installnametoolpath,../third_party/llvm-build/Release+Asserts/bin/llvm-install-name-tool -shared -fuse-ld=lld -Wl,-fatal_warnings -Wl,--icf=all -Wl,--color-diagnostics -Wl,--strict-auto-link -Wl,--no-call-graph-profile-sort -target arm64-apple-ios17.4 -Wl,-fixup_chains -Wl,-mllvm,-enable-machine-outliner=never -no-canonical-prefixes -Wl,-dead_strip -nostdlib++ -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk -Wl,-ObjC -Wl,-rpath,@executable_path/Frameworks -Wl,-rpath,@loader_path/Frameworks -L/Applications/Xcode_14.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/usr/lib/swift -L/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -o "./libpdfium.dylib" "@./libpdfium.dylib.rsp"  && { ../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool -l "./libpdfium.dylib" | grep LC_ID_DYLIB -A 5; ../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm -gPp "./libpdfium.dylib" | cut -f1-2 -d' ' | grep -v U$$; true; } > "./libpdfium.dylib.TOC"; else TOOL_VERSION=1713155290 ../build/toolchain/apple/linker_driver.py -Wcrl,driver,../third_party/llvm-build/Release+Asserts/bin/clang++ -Wcrl,strippath,../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -Wcrl,installnametoolpath,../third_party/llvm-build/Release+Asserts/bin/llvm-install-name-tool -shared -fuse-ld=lld -Wl,-fatal_warnings -Wl,--icf=all -Wl,--color-diagnostics -Wl,--strict-auto-link -Wl,--no-call-graph-profile-sort -target arm64-apple-ios17.4 -Wl,-fixup_chains -Wl,-mllvm,-enable-machine-outliner=never -no-canonical-prefixes -Wl,-dead_strip -nostdlib++ -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk -Wl,-ObjC -Wl,-rpath,@executable_path/Frameworks -Wl,-rpath,@loader_path/Frameworks -L/Applications/Xcode_14.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/usr/lib/swift -L/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -o "./libpdfium.dylib" "@./libpdfium.dylib.rsp"  && { ../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool -l "./libpdfium.dylib" | grep LC_ID_DYLIB -A 5; ../../../../../../../Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm -gPp "./libpdfium.dylib" | cut -f1-2 -d' ' | grep -v U$$; true; } > "./libpdfium.dylib.tmp" && if ! cmp -s "./libpdfium.dylib.tmp" "./libpdfium.dylib.TOC"; then mv "./libpdfium.dylib.tmp" "./libpdfium.dylib.TOC" ; fi; fi
ld64.lld: error: framework not found for -framework BrowserEngineKit

The command is defined in build/toolchain/apple/toolchain.gni line 508: https://chromium.googlesource.com/chromium/src/build/+/bbc1efa4ce09a306328744c508d208407d5978a6/toolchain/apple/toolchain.gni#508

Here are all the changes in the build repo since the last successful build: https://chromium.googlesource.com/chromium/src/build/+log/e5ff2eff3ba548792433766073b4399d506ec8db..bbc1efa4ce09a306328744c508d208407d5978a6

Only the following commits affected the Apple toolchain:

I don't see how these changes could cause the build error we see.

@TcT2k, @mara004, any idea what this could be?

mara004 commented 7 months ago

I'm afraid I don't know about the iOS build. I agree the two linked commits seem to be unsuspicious, but perhaps you could confirm by trying a build with these reverted? Or you could raise this on pdfium's mailing list or bug tracker.

BTW, I don't think this will be related here, but it's slightly unfortunate that pdfium-binaries is using out rather than out/Default. This can sometimes lead to issues when assumptions about relativeness are made, e.g. I don't think you'd be able to run the test suite like this.

mara004 commented 7 months ago

Hmm, this has now inhibited two releases. @bblanchon How about commenting out the iOS V8 builds for the meantime?

bblanchon commented 7 months ago

We agreed that each build would be a full build because:

  1. it's much easier for projects that repackage the binaries
  2. it allows building apps with the same version of PDFium on each platform

There must be a way to fix this build.

bblanchon commented 7 months ago

I just opened a new thread on the PDFium group: https://groups.google.com/g/pdfium/c/kNdVgV698Qc

mara004 commented 7 months ago

Yeah, of course it would be better to get it fixed, just wondering what we would do if the issue persists for a longer time.

bblanchon commented 7 months ago

I noticed that the version of the runner image changed from 20240329.1 in the last successful build to 20240406.2 in the first failing build. I started a new build for PDFium 6406, and it succeeded. Conclusion: the error is not due to a change in the runner image.

mara004 commented 6 months ago

Thanks! Glad you found a fix after all.