XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

Xcode 16 warning on framework with unsandboxed preBuildScripts

Open shuguenot opened this issue 1 year ago • 3 comments

From Xcode 16, a warning appears for all our framework targets:

tasks in 'Copy Headers' are delayed by unsandboxed script phases; set ENABLE_USER_SCRIPT_SANDBOXING=YES to enable sandboxing

When moving the run script (added with "preBuildScripts") AFTER the Headers phase, the warning disappears.

Capture d’écran 2024-09-25 à 19 16 15

shuguenot avatar Sep 25 '24 17:09 shuguenot

Hey @shuguenot , did you find any other solution than that? I am also getting the same warning on my project

jawidan avatar Oct 09 '24 12:10 jawidan

@jawidan It seems to be the only (and right) way to solve this warning. Note that the warning message is pretty explicit, right?

I am convinced that this is an issue that should be addressed by XcodeGen, specifically in how it manages the build phase order as described.

shuguenot avatar Oct 09 '24 12:10 shuguenot

It seems easy change technically as code is quite straightforward on how the order is determined: https://github.com/yonaskolb/XcodeGen/blob/2cf88e8088b6c1531080b10d2bfb169e2dc22379/Sources/XcodeGenKit/PBXProjGenerator.swift#L1126

But there is additional phase between prebuild scripts and headers: copyFilesBuildPhasesFiles. Does anyone know if that could also go after headersBuildPhaseFiles?

alvar-bolt avatar Oct 09 '24 12:10 alvar-bolt