Anyone know of a Multiplatform library that is sim...
# multiplatform
m
Anyone know of a Multiplatform library that is similar to
java.lang.Process
but for native?
b
How about
Process
in Swift? I think, the core functionality is similar. https://developer.apple.com/documentation/foundation/process
m
That's
macos
only unfortunately. Need something that utilizes
posix_spawn
for
iOS
tvOS
watchOS
l
What's your use case?
a
If you need to start a process, https://github.com/kgit2/kommand/ might help.
j
If I'm not mistaken, apps on iOS / tvOS / watchOS are sandboxed, so you cannot do an equivalent of java.lang.Process. What you are actually trying to achieve?
m
If you need to start a process, https://github.com/kgit2/kommand/ might help.
That is perfect @Alex Dmitriev!!! Unfortunately they do not have a License on their code. Unsure how anyone is using is w/o them having that sad panda
👾 1
l
@Matt Nelson It's Apache 2.0
m
Yeah that's what it says, but the
LICENSE
is blanked
l
I don't expect you to end up in court for that mistake 😄
😂 1
m
Also, unfortunately for they are compiling the static lib against a newer version of
glibc
, so odds of it working on older linux machines is nill since kotlin uses
2.19
(well, maybe
2.23
for kotlin
1.9.21
?) 😢
t
You can always check the published POM for license info too: https://repo1.maven.org/maven2/com/kgit2/kommand-jvm/2.0.1/kommand-jvm-2.0.1.pom
Looks like they added it back though
a
@Matt Nelson, from what I see,
Kommand
should be a self-contained library since its dependency
libkommand_core.a
is also a self-contained lib with its dependencies incorporated inside the
.a
file (configured to be static library in
Cargo.toml
). Unless I’m missing something, I don’t see a runtime dependency on
glibc
and guess it should be able to run on older linux boxes?
j
> Yes you can spawn processes on those platforms. Technically yes, but I'm reasonably sure that it won't work on real device, unless it is jailbroken; or at least that was the case some 5 years ago or so when we needed to spawn on iOS & had to find out a different solution in the end... Even the code you pointed me to has `// FIXME:
target_os = "ios"
?` for
fn posix_spawn()
...
m
> from what I see,
Kommand
should be a self-contained library since its dependency
libkommand_core.a
is also a self-contained lib with its dependencies incorporated inside the
.a
file (configured to be static library in
Cargo.toml
). Unless I’m missing something, I don’t see a runtime dependency on
glibc
and guess it should be able to run on older linux boxes? Yes it is non-intuitive but the self-hosted runner for macos is using latest brew install of cross compilers, and then the rust build files do not specify compiler flag
-static-libgcc
. So, any
libc
calls will use whatever is currently on the host. This is exactly why I built out https://github.com/05nelsonm/build-env , to ensure that at least native linux code was compiled against older versions of
libc
(and for reproducible builds, ofc).
Technically yes, but I'm reasonably sure that it won't work on real device, unless it is jailbroken; or at least that was the case some 5 years ago or so when we needed to spawn on iOS & had to find out a different solution in the end... Even the code you pointed me to has `// FIXME:
target_os = "ios"
?` for
fn posix_spawn()
Will have to look into it again, but I remember reading that Apple "eased" that constraint a bit ago b/c they wanted people to be able to develop via
iPad
. Will let ya know my results for sure.
👍 1
Successful process execution of an executable program which was extracted to the simulator filesystem from resources via
posix_spawn
for
iOS
(and `Linux`/`macOS` too). Need to put together a working
iOS
application and try it out on an actual device, but things are a working. NOTE: executables for darwin must be codesigned (which they are).