Closed markghayden closed 5 months ago
Same issue here. Any solution yet?
Soon!
Here's my quick-fix change to byterun/caml/misc.h
(didn't try asmrun):
#if __APPLE__
#include "TargetConditionals.h"
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
// system() is not supported on iOS
#define CAML_SYS_SYSTEM(command) (-1)
#else
// macOS is OK
#define CAML_SYS_SYSTEM(command) system_os(command)
#endif
#else // Other operating systems (Android?)
#define CAML_SYS_SYSTEM(command) system_os(command)
#endif
asmrun/caml/misc.h
is the same as byterun/caml/misc.h
, it is copied (IIRC).
I was going to try using pasmomusic/reason-react by @wokalski, and his instructions refer to set this up to get reason-react
going, but I am having the same issue.
Due to my environment, I set the SDK and VER to what is on my machine, instead of what you have in the README.md, as I don't have SDK of 9.2 on my system, and I have XCode 9.2.
The settings I used can be seen below:
ARCH=amd64 SUBARCH=x86_64 PLATFORM=iPhoneSimulator SDK=11.2 VER=9.2 opam install conf-ios
which breaks with the error note: 'system' has been explicitly marked unavailable
:
### stderr ###
# [...]
# ./caml/misc.h:142:34: note: expanded from macro 'CAML_SYS_SYSTEM'
# #define CAML_SYS_SYSTEM(command) system(command)
# ^
# /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/stdlib.h:195:6: note: 'system' has been explicitly marked unavailable here
# int system(const char *) __DARWIN_ALIAS_C(system);
# ^
# 1 error generated.
# make[2]: *** [sys.o] Error 1
# make[1]: *** [coldstart] Error 2
# make: *** [world] Error 2
These projects sound really interesting, so I am looking forward to playing with them some. 😄
Currently my workaround is sourcing and pinning ocaml-ios locally (i.e. using opam source ocaml-ios
). And then I tweak the macros referring to system
.
I've gone with bytecode meanwhile. The bytecode runtime works everywhere!
Closing as no longer relevant.
See output below for build with ios32.
The definition in stdlib.h for system is as follows:
swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable") __API_AVAILABLE(macos(10.0)) IOS_PROHIBITED WATCHOS_PROHIBITED __TVOS_PROHIBITED int system(const char *) DARWIN_ALIAS_C(system);
clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk -miphoneos-version-min=9.0 -O2 -DCAML_NAME_SPACE -Wall -c -o sys.o sys.c
stderr
[...]
./caml/misc.h:142:34: note: expanded from macro 'CAML_SYS_SYSTEM'
define CAML_SYS_SYSTEM(command) system(command)
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/include/stdlib.h:195:6: note: 'system' has been explicitly marked unavailable here
int system(const char *) __DARWIN_ALIAS_C(system);
^
1 error generated.
make[2]: *** [sys.o] Error 1
make[1]: *** [coldstart] Error 2
make: *** [world] Error 2