Xcode 14.3中的构建脚本错误 [CP] 嵌入Pods框架

huangapple go评论54阅读模式
英文:

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.

Xcode 14.3中的构建脚本错误 [CP] 嵌入Pods框架

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.

Xcode 14.3中的构建脚本错误 [CP] 嵌入Pods框架

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

huangapple
  • 本文由 发表于 2023年4月20日 04:13:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76058465.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定