Lua source does not build for iOS since recent XCode Update

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua source does not build for iOS since recent XCode Update

Chip Burwell
We have been building the lua source code in our iOS project for about a
year now.  Last week (around Sept. 20th) XCode was updated and the
source code no longer builds.  When compiling loslib.c XCode generates
an error saying system() has been deprecated and is no longer supported.
(system() is called from os_execute) Is there any plan to correct this
issue for iOS? Does anyone have a suggestion as to how best address this?

I did find this thread in the archive when system() just generated
warnings instead of errors:

http://lua-users.org/lists/lua-l/2015-07/msg00493.html

If you follow the responses in the thread there are a couple of
suggestions but none of them seem to work or are appropriate as a
general fix from what I can see.  The simple solution seems to be to
comment out system() and always fail. But wondering if this is the best
solution.

Thanks,

Chip


Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Luiz Henrique de Figueiredo
> We have been building the lua source code in our iOS project for
> about a year now.  Last week (around Sept. 20th) XCode was updated
> and the source code no longer builds.  When compiling loslib.c XCode
> generates an error saying system() has been deprecated and is no
> longer supported. (system() is called from os_execute) Is there any
> plan to correct this issue for iOS? Does anyone have a suggestion as
> to how best address this?

See http://lua-users.org/lists/lua-l/2017-09/msg00217.html

Note that this is an iOS problem that no longer can claim to support
standard C or POSIX.

Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

KHMan
On 9/26/2017 1:05 AM, Luiz Henrique de Figueiredo wrote:

>> We have been building the lua source code in our iOS project for
>> about a year now.  Last week (around Sept. 20th) XCode was updated
>> and the source code no longer builds.  When compiling loslib.c XCode
>> generates an error saying system() has been deprecated and is no
>> longer supported. (system() is called from os_execute) Is there any
>> plan to correct this issue for iOS? Does anyone have a suggestion as
>> to how best address this?
>
> See http://lua-users.org/lists/lua-l/2017-09/msg00217.html
>
> Note that this is an iOS problem that no longer can claim to support
> standard C or POSIX.

Yep, it would be nice if there is guidance from Apple, but somehow
I don't think we'll get system() back.

Between iOS, Android and UWP, it's a great excuse to throw
standards like POSIX out of the window. The future is locked-down
appliances on the consumer side. The last thing they want is to
let you use system(). Developers, now please be obedient and jump
through all the hoops that is asked of you*. Look at all the
websites switching over to mobile layouts.

To preserve functionality, perhaps some kind of abstraction layer
would eventually be more practical.

*Already got bitten myself, the latest XCode didn't like some code
I wrote for Scintilla (warns about the use of comma operators) :-/

--
Cheers,
Kein-Hong Man (esq.)
Selangor, Malaysia


Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Luiz Henrique de Figueiredo
In reply to this post by Luiz Henrique de Figueiredo
A quick fix is to add this to luaconf.h:

#define system(s) ((s)==NULL ? 0 : -1)

If someone knows the correct defines that identify iOS then this should be
something like:

#if defined(__IOS__)
#define system(s) ((s)==NULL ? 0 : -1)
#endif

Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Roberto Ierusalimschy
In reply to this post by KHMan
> Between iOS, Android and UWP, it's a great excuse to throw standards
> like POSIX out of the window. The future is locked-down appliances
> on the consumer side. The last thing they want is to let you use
> system().

Just a reminder that 'system' is not POSIX; it is part of ISO C.
Because of that, it has official ways to do nothing, so one can remove
the functionality without removing the function from the library.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Eric Wing
In reply to this post by Luiz Henrique de Figueiredo
On 9/25/17, Luiz Henrique de Figueiredo <[hidden email]> wrote:

> A quick fix is to add this to luaconf.h:
>
> #define system(s) ((s)==NULL ? 0 : -1)
>
> If someone knows the correct defines that identify iOS then this should be
> something like:
>
> #if defined(__IOS__)
> #define system(s) ((s)==NULL ? 0 : -1)
> #endif
>
>


iOS has never actually allowed system() or any external process
creation. (Apple's own NSTask was always absent from the SDK.) Up
until now, system() could be linked, but nobody ever dared called it.
Many companies would already remove it to completely avoid the
possibility of Apple rejecting their apps.

And in fact, Android is pretty much the same way. Their engineers say,
"Don't ever do that." The Android process and life-cycle model is
completely alien to this model.


I recommend that both be disabled in luaconf.h by default. I believe
this is the incantation we need:


#if defined(__APPLE__)
    #include "TargetConditionals.h"
    #if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
        #define system(s) ((s)==NULL ? 0 : -1)
    #endif // end iOS
#elif defined(__ANDROID__)
    #define system(s) ((s)==NULL ? 0 : -1)

#endif



-Eric

Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Soni "They/Them" L.


On 2017-09-25 03:58 PM, Eric Wing wrote:

> On 9/25/17, Luiz Henrique de Figueiredo <[hidden email]> wrote:
>> A quick fix is to add this to luaconf.h:
>>
>> #define system(s) ((s)==NULL ? 0 : -1)
>>
>> If someone knows the correct defines that identify iOS then this should be
>> something like:
>>
>> #if defined(__IOS__)
>> #define system(s) ((s)==NULL ? 0 : -1)
>> #endif
>>
>>
>
> iOS has never actually allowed system() or any external process
> creation. (Apple's own NSTask was always absent from the SDK.) Up
> until now, system() could be linked, but nobody ever dared called it.
> Many companies would already remove it to completely avoid the
> possibility of Apple rejecting their apps.
>
> And in fact, Android is pretty much the same way. Their engineers say,
> "Don't ever do that." The Android process and life-cycle model is
> completely alien to this model.

sudo make me a mobile operating system where each app is a whole docker
container with even separate ipv6 addresses per app

>
>
> I recommend that both be disabled in luaconf.h by default. I believe
> this is the incantation we need:
>
>
> #if defined(__APPLE__)
>      #include "TargetConditionals.h"
>      #if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
>          #define system(s) ((s)==NULL ? 0 : -1)
>      #endif // end iOS
> #elif defined(__ANDROID__)
>      #define system(s) ((s)==NULL ? 0 : -1)
>
> #endif
>
>
>
> -Eric
>

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.


Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Coda Highland
On Mon, Sep 25, 2017 at 5:59 PM, Soni L. <[hidden email]> wrote:
> sudo make me a mobile operating system where each app is a whole docker
> container with even separate ipv6 addresses per app

This isn't an ENTIRELY ridiculous idea.

/s/ Adam

Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Soni "They/Them" L.


On 2017-09-25 08:26 PM, Coda Highland wrote:
> On Mon, Sep 25, 2017 at 5:59 PM, Soni L. <[hidden email]> wrote:
>> sudo make me a mobile operating system where each app is a whole docker
>> container with even separate ipv6 addresses per app
> This isn't an ENTIRELY ridiculous idea.

It isn't a ridiculous idea at all, *if* you can figure out some form of
mobile-oriented OS-level virtualization that's a bit more lightweight
than /docker containers/.

>
> /s/ Adam
>

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.


Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Russell Haley


Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
  Original Message  
From: Soni L.
Sent: Monday, September 25, 2017 4:40 PM
To: [hidden email]
Reply To: Lua mailing list
Subject: Re: Lua source does not build for iOS since recent XCode Update



On 2017-09-25 08:26 PM, Coda Highland wrote:
> On Mon, Sep 25, 2017 at 5:59 PM, Soni L. <[hidden email]> wrote:
>> sudo make me a mobile operating system where each app is a whole docker
>> container with even separate ipv6 addresses per app
> This isn't an ENTIRELY ridiculous idea.

It isn't a ridiculous idea at all, *if* you can figure out some form of
mobile-oriented OS-level virtualization that's a bit more lightweight
than /docker containers/.

Freebsd jails + zfs snapshots. Iocage is an example that can create a base image and then use snapshots to create lightweight copies.

Russ‎
>
> /s/ Adam
>

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.



Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Javier Guerra Giraldez
In reply to this post by Soni "They/Them" L.
On 26 September 2017 at 00:40, Soni L. <[hidden email]> wrote:
> It isn't a ridiculous idea at all, *if* you can figure out some form of
> mobile-oriented OS-level virtualization that's a bit more lightweight than
> /docker containers/.

a.k.a. processes.


seriously, the whole idea of time sharing OSs was about having
different users that don't trust each other.


--
Javier

Reply | Threaded
Open this post in threaded view
|

Re: Lua source does not build for iOS since recent XCode Update

Soni "They/Them" L.


On 2017-09-26 05:46 AM, Javier Guerra Giraldez wrote:

> On 26 September 2017 at 00:40, Soni L. <[hidden email]> wrote:
>> It isn't a ridiculous idea at all, *if* you can figure out some form of
>> mobile-oriented OS-level virtualization that's a bit more lightweight than
>> /docker containers/.
> a.k.a. processes.
>
>
> seriously, the whole idea of time sharing OSs was about having
> different users that don't trust each other.
>
>

No. I wanna be able to spawn Python and RPC it to Lua from within Java
(because good luck combining python and java in the same process).

This is a bit more useful:

- system() works fine for binaries within your own app.
- every app can have its own web interface, be it my media player app,
my file browser app, or any of my chat apps. (because they already do,
just not on port 80 yet.)
- and so on. an app could even be a whole OS if it wanted to, since they
would be fully isolated.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.