scalanative-cocoa
scalanative-cocoa copied to clipboard
Support iOS (arm64)
Blocking issues:
- https://github.com/scala-native/scala-native/issues/1312
Open topics:
- [ ] support message dispatch on arm64 this depends on scala-native/scala-native#396 to be solved
- [ ] most important bindings for UIKit
Message dispatch with objc_msgSend
has been modified for arm64 in https://github.com/jokade/scalanative-cocoa/commit/325337ab321593f89c8ea7dcf80ef5fb51dba398
@jokade I was thinking on create libraries for iOS and Android to build apps with scala native and I just discovered your library. I am seeing that you did not make commits for a long time.
I would like to know if is just because you do not have time or was related to some blocker like something needed on Scala native core that are you waiting for.
I am asking this to see if what I have in mind is doable now or not. If is just a time constraint I would like to know how I can help you to improve this library to support iOS
@frossi85 a bit of both... I've put a hold to my Cocoa bindings, since there are still some issues (especially for iOS). One is the issue mentioned above; another is the improved interop support I wanted to wait for (scala-native/scala-native#897, especially structs), since it's currently quite awkward to define ObjC classes. But I don't think that's going to happen soon, since the current focus for the core scala-native developers seems to be optimization and Java libs.
So, what's your intention? Do you want to use this lib for UIKit access on iOS? Or do you want to build your own interop layer? The next step I planned for this lib was to extract the ObjC interop layer into a separate project. If your interested in using that layer or the cocoa bindings, I probably could dust it off this weekend, and check the latest updates to scala-native.
@jokade I have to make a final project for my University, and I should justify 400 hours of work. I was thinking on dedicate that or more to the scala native community by creating a library with a common interface to create Scala native apps for both iOS and Android with same code. Like for example has as part of its framework NativeScript.
For that I need:
- Access to iOS frameworks (ObjC interop utilities + library bindings)
- Android provides a C framework so here is only creation the library bindings)
- Create the common interface
So I started looking about ObjC interop and found you library and I though, I can help to here so we sum forces and I can dedicate more time to the other parts.
For now, I am evaluating/estimating if is doable and the time needed. So I can make a decision on if I would make this as the final project of my University or pick another stuff and make this just in my free time when Scala native is more prepared.
Regarding to make it a separate project I was thinking the same. I think cos is not a good idea to force download a big library with things that the user may not use. For example, if I am building iOS apps I may not want macOs stuff.
I think a good idea would be have is split the more as you can.
@frossi85 sounds like an interesting (and ambitious) project :) Let me check the status of scala-native over the weekend, then I'll come back to you
@frossi85 I have a minimal seed project that works with the iPhone simulator; but that doesn't really proof anything, since it's still x86 code. Unfortunately I currently can't test it on a device since my Xcode is too old for iOS11... so you'll have to wait a few days (or you can give it a try yourself).
Great I will check it and see if I can run it. But also if u can try it later or if I fail would be better because u are more versed in scala native. But even if is working on a simulator is good because perhaps I can describe the current limitation on the platform and tell that will be tested on emulators and I can state that when the ecosystem is prepared for ARM it will just work.
@jokade I tried to build and run the app on a simulator using the template that you created (https://github.com/jokade/scalanative-ios-seed.g8) but I am not able to do make it work.
Here is what I get when I try to build:
MacBook-Pro-de-Facundo:scalanative-ios-app facundo$ sbt sim/build
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from /Users/facundo/.sbt/0.13/plugins
[info] Loading project definition from /Users/facundo/Facultad/tp-profesional/scalanative-ios-app/project
[info] Set current project to scalanative-ios-app (in build file:/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/)
[info] Linking (1655 ms)
[info] Discovered 818 classes and 4766 methods
[info] Optimizing (debug mode) (2117 ms)
[info] Generating intermediate code (494 ms)
[info] Produced 40 files
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[error] 1 warning generated.
[error] warning: overriding the module target triple with x86_64-apple-ios10.2.0-simulator [-Woverride-module]
[error] 1 warning generated.
[info] Compiling to native code (2106 ms)
[error] clang-6.0: warning: overriding '-mios-simulator-version-min=10.2' option with '--target=x86_64-apple-macosx10.13.0' [-Woverriding-t-option]
[error] clang-6.0: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX' [-Wincompatible-sysroot]
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.scalanative.nio.fs.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__trait_has_trait.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__main.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.scalanative.native.objc.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__object_array_id.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.reflect.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/cocoa.foundation.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.util.hashing.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.nio.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.collection.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.collection.immutable.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/cocoa.uikit.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__dispatch.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__extern.ll.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.collection.mutable.ll.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.io.ll.o) built for iOS. Note: This will be an error in the future.
[error]
[error] ld: warning: ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__empty.ll.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.util.control.ll.o) built for iOS. Note: This will be an error in the future.
[error]
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.util.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.compat.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__modules_size.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.concurrent.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.collection.script.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.nio.file.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/niocharset.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.scalanative.posix.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__modules.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.scalanative.native.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.runtime.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning: ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.math.ll.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__stack_bottom.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning:
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.lang.ll.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.nio.charset.ll.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.util.concurrent.ll.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.collection.convert.ll.o) built for iOS. Note: This will be an error in the future.
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/__class_has_trait.ll.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.collection.generic.ll.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning:
[error]
[error] ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.lang.reflect.ll.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/scala.scalanative.runtime.ll.o) built for iOS. Note: This will be an error in the future.
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/utime.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/stat.c.o) built for iOS. Note: This will be an error in the future.
[error] ld: warning:
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/cpio.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/arpa/inet.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/syslog.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/termios.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/netinet/tcp.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/netinet/in.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/sys/select.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/sys/socket.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/sys/socket_conversions.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/sys/uio.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/sys/ioctl.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/sys/uname.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix/netdb.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/process_monitor.cpp.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/eh.cpp.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/dirent.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/grp.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/posix.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/shutdown.cpp.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/statvfs.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/limits.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/pthread.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/unwind.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/wrap.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/pwd.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/dyndispatch.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/platform.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/time.cpp.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/unistd.c.o) built for iOS. Note: This will be an error in the future.ld: warning: ld: warning: ld: warning:
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/fcntl.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/complex.c.o) built for iOS. Note: This will be an error in the future.URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/gc/none/gc.c.o) built for iOS. Note: This will be an error in the future.ld: warning:
[error]
[error]
[error] URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/lib/time.c.o) built for iOS. Note: This will be an error in the future.
[error] ld: building for OSX, but linking against dylib built for iOS (/Applications/Xcode.app//Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libobjc.tbd). file '/Applications/Xcode.app//Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libobjc.tbd' for architecture x86_64
[error] clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
[info] Linking native code (none gc) (647 ms)
[success] Total time: 10 s, completed Aug 11, 2018 11:13:55 PM
Not sure if was done right because I see a lot of warning marked as errors, then linking seems to have problems: clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
but at the end It says [success] Total time: 10 s, completed Aug 11, 2018 11:13:55 PM
I am using LLVM 6.0.1 (Installed with brew install llvm) and XCode 9.4.1.
Not sure if I should pay attention to this message:
warning: URGENT: building for OSX, but linking in object file (/Users/facundo/Facultad/tp-profesional/scalanative-ios-app/sim/target/scala-2.11/native/java.lang.reflect.ll.o) built for iOS. Note: This will be an error in the future.
I am seeing this while try to run it on a simulator on XCode, but I think the problem is before this.
.../scalanative-ios-app/xcode/scalanative-ios-app/Base.lproj/LaunchScreen.storyboard: Interface Builder could not open the document LaunchScreen.storyboard" because it does not exist.
Any idea what could be the problem? Should I publish scala native locally using some special branch, or stock 0.3.8 version should work?
@frossi85 I can confirm the problem with Xcode 9 + system clang (it worked with Xcode 8 + SN 0.3.8 release). I'll have to check what has changed.
@jokade at least I feel better that is not a newbie error on my side lol Please let me know if u find something or I can help u.
@frossi85 I've fixed the linking problem, the g8 template now works for me with Xcode 9 command line tools + simulator. However, the app no longer works on an actual device, due to a memory access error in scalanative_alloc_small...
Edit: the reason for which probably could be the call to mmap()
? Further investigation needed
Edit 2:: yes I ran into this problem previously. The initial chunk allocated by the none
GC implementation is too large:
https://github.com/scala-native/scala-native/blob/28a6d64525ef3ff640fffd26057921101975d68d/nativelib/src/main/resources/gc/none/gc.c#L12
Reducing to it to 256MB should work. However, it's not clear why GC immix
fails.
@jokade Sorry I did not commented this before. I am having the same issues as before, not seeing commits on the g8 template repo https://github.com/jokade/scalanative-ios-seed.g8 related to the fix. Are u sure u had published the changes to GitHub? Last commit that I see in the template is from August 6th. I am also not seeing any new version published for this project.
@jokade I think one of the issues was solved and merged on master: https://github.com/scala-native/scala-native/commit/3b8c1dcd59e2b2ca6f1c6fb2eaa69bd8306e50ed
Is the heap issue
@frossi85 yes the GC issue seems to be resolved. No I've encountered a problem with passing CStrings in messages on iOS.
@jokade Hey man, I hope you are doing great. I tried to run the demo app that u created but I had a really bad time to make it work, sure is something in my side. Do u have another place were I can chat with u if you don't mind?
You have my email in my Github profile, so u can be in touch with me pretty easy.
@frossi85 I'm happy to help where I can, but I put Cocoa/iOS on hold, until SN 0.4.0 has made progress (Denys is apparently working on some major interop revamp / solving long open issues).
Just write me on Gitter if you have questions.
The blocking issues you mention in the post are solved with last big PR in Scala Native. I tried to port scalanative-obj-interop to 0.4.0-SNAPSHOT but it needs deep knowledge of the macros I don't have. They plan to release Scala Native 0.4.0-M1 very soon. Can you do the update to see if with new Interop IOS support can be achieved?
From scala-native gitter channel:
@lolgab I'm currently working on migrating the CObj interop to 0.4-M2; when that's complete, I will move on to reworking the ObjC interop. The biggest issue w.r.t. ObjC is currently the handling of objc_msgSend
, but @densh gave me a tip that should work for iOS64 support.
Just curious if you have circled around to any of your Scala Native projects lately? I think the 2 issues here have been fixed and we have basic cross compilation support as well. There is active development now too.