Open kyzmitch opened 2 years ago
Hey @kyzmitch, thanks for opening this issue. I didn't know we had this problem with the new build system, but I guess it was bound to happen someday.
I see you already started working on a fix, so let me give you some background that might help you out.
The only reason (as far as I remember) why Gryphon runs xcodebuild
is because it needs to know every argument that the Swift compiler needs for a successful compilation of the app. The xcodebuild
command compiles the whole app, which includes calling the Swift compiler, and prints those commands to the terminal, which means Gryphon can read that and get all the arguments it needs.
Because Gryphon only needs to know what the compilation command is (but doesn't need to actually run it) it tries to call xcodebuild
with the -dry-run
option to save time, which means forcing xcodebuild
to use the legacy system. That said, in a situation where the new build system is needed, I agree that it would be better to take longer but work correctly than to not work at all. I would, however, add a warning telling the user about the extra time it'll take, just so that they know what they're getting into.
I'll try to add a few comments to your PR to try to steer you in the right direction when I have time, but all in all it looks like a great start 😄
https://github.com/vinivendra/Gryphon/blob/5bf69a6d33839a7b9db3d82283b6c2bff878eeac/Sources/GryphonLib/Driver.swift#L786
It seems when Xcode project uses Swift Package Manager it must use New Build System, but this setting is hardcoded (see code above). UseModernBuildSystem should be possible to set to YES.
Tried to set it in console with bash variable but it shouldn't help, because it is hardcoded in your script. Also, wasn't possible to set it using:
Xcode project uses it, I checked in Workspace settings.
Full error: