Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS build issue with SDK 12.4 via osxcross #42584

Closed
akien-mga opened this issue Oct 5, 2020 · 12 comments
Closed

iOS build issue with SDK 12.4 via osxcross #42584

akien-mga opened this issue Oct 5, 2020 · 12 comments

Comments

@akien-mga
Copy link
Member

Godot version:
3.2 (b2897f1)

OS/device including version:
Build container based on Fedora 31, cross-compiling with osxcross for iOS (iPhoneOS 12.4)
(Official buildsystem.)

Issue description:
When building on the offiical build container for iOS (see above), with the following build script, I get a build error in the ARKit module:

/root/ioscross/arm64//usr/bin/arm-apple-darwin11-clang++ -o modules/arkit/register_types.iphone.opt.debug.arm64.o -c -std=gnu++14 -O2 -ftree-vectorize -fomit-frame-pointer -fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=10.0 -isysroot /root/ioscross/arm64/SDK/iPhoneOS12.4.sdk -fno-exceptions -w -Werror=return-type -fmodules -fcxx-modules -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DGAME_CENTER_ENABLED -DSTOREKIT_ENABLED -DICLOUD_ENABLED -DIPHONE_ENABLED -DUNIX_ENABLED -DGLES_ENABLED -DCOREAUDIO_ENABLED -DPTRCALL_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DZSTD_STATIC_LINKING_ONLY -DMODULE_ARKIT_ENABLED -Ithirdparty/libpng -Ithirdparty/zstd -Ithirdparty/zlib -Iplatform/iphone -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/usr/include -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/System/Library/Frameworks/AudioUnit.framework/Headers -I. modules/arkit/register_types.cpp
/root/ioscross/arm64//usr/bin/arm-apple-darwin11-clang++ -o modules/arkit/arkit_interface.iphone.opt.debug.arm64.o -c -std=gnu++14 -O2 -ftree-vectorize -fomit-frame-pointer -fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=10.0 -isysroot /root/ioscross/arm64/SDK/iPhoneOS12.4.sdk -fno-exceptions -w -Werror=return-type -fmodules -fcxx-modules -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DGAME_CENTER_ENABLED -DSTOREKIT_ENABLED -DICLOUD_ENABLED -DIPHONE_ENABLED -DUNIX_ENABLED -DGLES_ENABLED -DCOREAUDIO_ENABLED -DPTRCALL_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DZSTD_STATIC_LINKING_ONLY -DMODULE_ARKIT_ENABLED -Ithirdparty/libpng -Ithirdparty/zstd -Ithirdparty/zlib -Iplatform/iphone -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/usr/include -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/System/Library/Frameworks/AudioUnit.framework/Headers -I. modules/arkit/arkit_interface.mm
/root/ioscross/arm64//usr/bin/arm-apple-darwin11-clang++ -o modules/arkit/arkit_session_delegate.iphone.opt.debug.arm64.o -c -std=gnu++14 -O2 -ftree-vectorize -fomit-frame-pointer -fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=10.0 -isysroot /root/ioscross/arm64/SDK/iPhoneOS12.4.sdk -fno-exceptions -w -Werror=return-type -fmodules -fcxx-modules -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DGAME_CENTER_ENABLED -DSTOREKIT_ENABLED -DICLOUD_ENABLED -DIPHONE_ENABLED -DUNIX_ENABLED -DGLES_ENABLED -DCOREAUDIO_ENABLED -DPTRCALL_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DZSTD_STATIC_LINKING_ONLY -DMODULE_ARKIT_ENABLED -Ithirdparty/libpng -Ithirdparty/zstd -Ithirdparty/zlib -Iplatform/iphone -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/usr/include -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers -I/root/ioscross/arm64/SDK/iPhoneOS12.4.sdk/System/Library/Frameworks/AudioUnit.framework/Headers -I. modules/arkit/arkit_session_delegate.mm

<snip>

/root/ioscross/arm64//usr/bin/arm-apple-darwin11-ar rc bin/libgodot_camera_module.iphone.opt.debug.arm64.a modules/camera/register_types.iphone.opt.debug.arm64.o modules/camera/camera_ios.iphone.opt.debug.arm64.o
/root/ioscross/arm64//usr/bin/arm-apple-darwin11-ranlib bin/libgodot_camera_module.iphone.opt.debug.arm64.a
�[1mmodules/arkit/arkit_interface.mm:471:70: �[0m�[0;1;31merror: �[0m�[1mproperty 'windowScene' not found on object of type 'UIWindow *' [2]�[0m
                                        orientation = [UIApplication sharedApplication].delegate.window.windowScene.interfaceOrientation;
�[0;1;32m                                                                                                         ^
�[0m1 error generated.
scons: *** [modules/arkit/arkit_interface.iphone.opt.debug.arm64.o] Error 1

It's a recent issue, likely from #42459, CC @naithar @bruvzg.

Steps to reproduce:

  • Build 3.2 branch against iPhoneOS12.4 and/or via osxcross configured for iOS cross-compilation.

Minimal reproduction project:
n/a

@bruvzg
Copy link
Member

bruvzg commented Oct 6, 2020

				if (@available(iOS 13, *)) {
					orientation = [UIApplication sharedApplication].delegate.window.windowScene.interfaceOrientation;

windowScene is a iOS 13.0+ property, there's a check but @available is runtime check, it will run on iOS 10+ but at least iOS 13.0 SDK is required to build.

Is there any reason to use old SDK? Current stable one is iOS 14 (18A390), Xcode 12.0.1 and it is supported by osxcross.

@naithar
Copy link
Contributor

naithar commented Oct 6, 2020

Increasing SDK version for osxcross to iOS 14 or iOS 13 should help.
AppStore would probably require new applications be built with most recent SDK anyway.

@akien-mga
Copy link
Member Author

Alright, I'll have a look at rebuilding the container for the latest SDK.

@akien-mga
Copy link
Member Author

akien-mga commented Oct 6, 2020

The iOS compilation docs need to be updated though: https://docs.godotengine.org/en/latest/development/compiling/compiling_for_ios.html

And ideally it would be good to validate the SDK version before attempting a build if we know we can't build with SDK < 13.

@bruvzg
Copy link
Member

bruvzg commented Oct 6, 2020

And ideally it would be good to validate the SDK version before attempting a build if we know we can't build with SDK < 13.

We can get SDK version with something like sdkver = float(subprocess.check_output(["xcrun", "--sdk", "iphoneos", "--show-sdk-version"]).strip().decode("utf-8")) and check as part of config.

@naithar
Copy link
Contributor

naithar commented Oct 6, 2020

@akien-mga godotengine/godot-docs#4207 made a docs PR.

I'll also try to look at container myself.

@bruvzg
Copy link
Member

bruvzg commented Oct 6, 2020

SDK version check #42593

@naithar
Copy link
Contributor

naithar commented Oct 6, 2020

Well, I've managed to extract iOS SDK 14.0 and MacOS SDK 10.15 from Xcode 12.0.1, which is the latest version. osxcross seems to also be building correctly with this versions. But I couldn't perform a godot build completely since build container doesn't have ios.py file.

@naithar
Copy link
Contributor

naithar commented Oct 7, 2020

This issue #32256 could be probably be fixed with SDK version increase.

@akien-mga
Copy link
Member Author

This issue #32256 could be probably be fixed with SDK version increase.

Indeed. Weird that nobody complained about that during 3.2.3 development...

I've done some work to upgrade the containers yesterday, though I've hit an issue when compiling Mono for iOS, which I'm still trying to workaround: godotengine/build-containers#56

@naithar
Copy link
Contributor

naithar commented Oct 7, 2020

Indeed. Weird that nobody complained about that during 3.2.3 development...

Well, that page does say that it requires an application be built with newest SDK, but doesn't say anything about dependencies. And since Godot is a static library dependency this could be the case that everything was okay on AppStore side.

@akien-mga
Copy link
Member Author

Fixed by #42593.

I upgraded my build containers to iOS 14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants