英文:
Xcode 14.3 Bug in Build Script [CP] Embed Pods Frameworks
问题
I've come across a bug that seems to have been introduced with Xcode 14.3, although it may have been caused by something else.
In my Build Phases, I have a phase called "[CP] Embed Pods Frameworks". That invokes a script called Pods-myapp-frameworks.sh. That script fails when one of the frameworks is in a symbolically-linked folder.
The highlighted text in the build log shows the problem. It's resolved the symbolic link with a path relative to the symbolic link, and an absolute path is needed.
The path is resolved in the following code in the script (lines 42 - 45 in my copy of the script):
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
The readlink is defaulting to a relative path. Adding -f makes its output an absolute path, and all is well:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
However, this script looks like it's been generated. I can edit it, and it isn't overwritten when I rebuild, but I suspect next time I add a Pod or similar I'll be back to where I was.
So: where does this script come from? If it's generated, how do I get it to generate the correct readlink code? And is this a bug in Xcode or something that I've somehow created myself?
英文:
I've come across a bug that seems to have been introduced with Xcode 14.3, although it may have been caused by something else.
In my Build Phases, I have a phase called "[CP] Embed Pods Frameworks". That invokes a script called Pods-myapp-frameworks.sh That script fails when one of the frameworks is in a symbolically-linked folder.
The highlighted text in the build log shows the problem. It's resolved the symbolic link with a path relative to the symbolic link, and an absolute path is needed.
The path is resolved in the following code in the script (lines 42 - 45 in my copy of the script):
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
The readlink is defaulting to a relative path. Adding -f makes its output an absolute path, and all is well:
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
However, this script looks like it's been generated. I can edit it and it isn't overwritten when I rebuild, but I suspect next time I add a Pod or similar I'll be back to where I was.
So: where does this script come from? If it's generated, how do I get it to generate the correct readlink code? And is this a bug in Xcode or something that I've somehow created myself?
答案1
得分: 4
升级到 CocoaPods 1.12.1 以获得修复。更多详情请查看 https://github.com/CocoaPods/CocoaPods/pull/11828
英文:
Update to CocoaPods 1.12.1 to get the fix. More details at https://github.com/CocoaPods/CocoaPods/pull/11828
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论