This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Todd.Rovito
Recipients Alex.Willmer, Lukasa, Luke Taylor, Todd.Rovito, bkabrda, cvrebert, doko, freakboy3742, mpaolini, ncoghlan, ned.deily, r.david.murray, rkuska, ronaldoussoren
Date 2017-01-02.02:41:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483324907.66.0.433311552495.issue23670@psf.upfronthosting.co.za>
In-reply-to
Content
Russell, this is excellent work!!!!  I am truly amazed that within a couple of hours I had Python built and running for the iOS simulator this is a feat I didn't think was possible.  Perspective on me I am very familiar with Linux, C, and Python but know very little about iOS and XCode keep that in mind when reviewing my comments.

MacOS: 10.12.2
Xcode: 8.2.1 (8C1002)
iOS: 10.2 (14C89)
Python source code: 3.5.1

I applied your last patch file name 20160217.diff.  The first issue I ran into was clock_settime() is unavailable in iOS so I went into timemodule.c line 164 and commented out the line:
ret = clock_settime((clocked_t)clk_id, &tp);
then added this line
ret = 0;

Next I think a more serious problem was with Python/random.c line 92 "Python/random.c:92:19: error: implicit declaration of function 'getentropy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]"

So I did the same thing as above commented out the lines with the getentropy function and added a line of res = 0.  Who needs entropy anyway?  I wonder if this problem is related to issue 29057 (http://bugs.python.org/issue29057).

Next in your README file you list a file called main.c when the actual code is main.m.

Next main.m was not compiling with Xcode so I replaced with this line after looking at your Python-iOS-template project on GitHub, as I am not qualified to make these types of changes:

-line 31 was not compiling so I replaced:
wpython_home = Py_DecodeLocale([python_home UTF8String], NULL);

-line 54 had a similar error so I replaced:
python_argv[0] = Py_DecodeLocale(main_script, NULL);

-line 56 had a similar error so I replaced with this line:
python_argv[i] = Py_DecodeLocale(argv[i], NULL);

-line 89 comment it out to remove the assertion failure, I am not sure what
this line is supposed to do but no assertion failure seems like a better result.

I didn't want to blindly attach a diff as I don't understand the Apple lingo but I wanted to provide feedback in the hope that it helps get this patch committed so iOS becomes a target for CPython in the near future.  Thanks!
History
Date User Action Args
2017-01-02 02:41:47Todd.Rovitosetrecipients: + Todd.Rovito, doko, ronaldoussoren, ncoghlan, ned.deily, r.david.murray, cvrebert, freakboy3742, bkabrda, Lukasa, rkuska, mpaolini, Alex.Willmer, Luke Taylor
2017-01-02 02:41:47Todd.Rovitosetmessageid: <1483324907.66.0.433311552495.issue23670@psf.upfronthosting.co.za>
2017-01-02 02:41:47Todd.Rovitolinkissue23670 messages
2017-01-02 02:41:44Todd.Rovitocreate