| Summary: | Copy PDF.js in WebCore.framework bundle at build-time | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tim Nguyen (:ntim) <ntim> | ||||||
| Component: | Assignee: | Elliott Williams <emw> | |||||||
| Status: | RESOLVED DUPLICATE | ||||||||
| Severity: | Normal | CC: | ap, emw, thorton, webkit-bug-importer, youennf | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | 242263, 237844, 241117 | ||||||||
| Bug Blocks: | 235969 | ||||||||
| Attachments: |
|
||||||||
|
Description
Tim Nguyen (:ntim)
2022-02-01 15:36:30 PST
Created attachment 451664 [details]
Patch
Committed r289616 (247127@main): <https://commits.webkit.org/247127@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 451664 [details]. Reverted this in r289637 since this broke production builds: ``` /bin/sh -c /System/Volumes/Data/otmp/od.xLjbWx/lw.JIlSYt/sandbox-0/OBJROOT/WebCore.build/WebCore.build/Script-49AA6B1727B6755F000B0F64.sh rsync: link_stat "/System/Volumes/Data/otmp/od.xLjbWx/lw.JIlSYt/sandbox-0/WebCore/Source/WebCore/../ThirdParty/pdfjs/." failed: No such file or directory (2) rsync error: some files could not be transferred (code 23) at /System/Volumes/Data/SWE/macOS/BuildRoots/6b362bc7f6/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(996) [sender=2.6.9] /System/Volumes/Data/otmp/od.xLjbWx/lw.JIlSYt/sandbox-0/OBJROOT/WebCore.build/WebCore.build/Script-49AA6B1727B6755F000B0F64.sh: line 9: cd: /System/Volumes/Data/otmp/od.xLjbWx/lw.JIlSYt/sandbox-0/WebCore/Source/WebCore/../ThirdParty/pdfjs: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code ``` Comment on attachment 451664 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451664&action=review > Source/WebCore/WebCore.xcodeproj/project.pbxproj:38406 > + 49AA6B1727B6755F000B0F64 /* Copy PDF.js Resources */ = { > + isa = PBXShellScriptBuildPhase; > + buildActionMask = 2147483647; > + files = ( > + ); > + inputFileListPaths = ( > + ); > + inputPaths = ( > + ); > + name = "Copy PDF.js Resources"; > + outputFileListPaths = ( > + ); > + outputPaths = ( > + ); > + runOnlyForDeploymentPostprocessing = 0; > + shellPath = /bin/sh; > + shellScript = "SRC_DIR=\"$SRCROOT/../ThirdParty/pdfjs\"\nDST_DIR=\"$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/pdfjs\"\n\nmkdir -p \"$DST_DIR\"\n\nrsync -aq --exclude \".svn\" --exclude \".DS_Store\" \"$SRC_DIR/\" \"$DST_DIR/\"\n\ncd \"$SRC_DIR\"\n"; > + }; I think it would be preferable to add `pdfjs/` to the xcodeproj as a folder reference, and use a Copy Files phase to copy it over. This gives Xcode's build system more dependency information about what's being copied, is marginally faster, and might help with the production build problems you're seeing. Created attachment 452064 [details]
Patch
Comment on attachment 452064 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=452064&action=review > Source/WebCore/Makefile:5 > + mkdir -p $@ Do we need to quote this, or anything else, in case of spaces in the path? Committed r289850 (247292@main): <https://commits.webkit.org/247292@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452064 [details]. We're reverting this in bug 237844, since this causes a significant size increase in the bundle. This patch can be re-landed once work on PDF.js resumes along with bundle size optimization. (This needs a rebase fwiw) To replicate the changes in Source/WebCore/WebCore.xcodeproj/project.pbxproj, add a folder reference to Source/ThirdParty/pdfjs in the WebCore/Resources folder in the file tree. Worth noting that Igalia added a build option in bug 238023, probably worth using that for file size concerns. *** This bug has been marked as a duplicate of bug 241117 *** |