MacOS debug version does not work with external console

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

MacOS debug version does not work with external console

Post by maik »

See this post over in the Oolite Mac forum. You might want to move it here after all.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 678
Joined: Sat Aug 09, 2014 4:16 pm

Re: MacOS debug version does not work with external console

Post by Commander_X »

Not sure about your MacOS version, and/or python setup.

On a Slackware Linux, for "oolite-debug-console-1.5", under "Python 2.7.17", I had to install the following to have it up and running (sorry, no pip, not sure to what extent it deals with dependencies):
attrs-19.3.0
constantly-15.1.0
incremental-17.5.0
twisted-twisted-20.3.0
zope.interface-5.1.0

I've downloaded them, dropped them in the oolite-debug-console-1.5 folder, did "python ./setup.py build" on each of them, renamed the folders to the non-versioned name (i.e. attr, constantly, incremental, twisted, zope) and launch either DebugConsole.py or pySimpleConsole.py with, e.g.:

Code: Select all

PYTHONPATH=$PYTHONPATH:. python ./DebugConsole.py
without problems. I'm not doing too much OX[PZ] dev/debugging, just like to player.ship.awardEquipment sometimes.

So, don't know about "service_identity" dependency/requirement (I don't have it, and it doesn't seem to be required), but it seems that some more packages would be needed for your setup to be able to run the debug console (the Tk version my Python is using is 8.6.9).

For the record, the order they seem to had popped out as dependencies should be:
1. twisted
2. incremental
3. zope
4. constantly
5. attr
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: MacOS debug version does not work with external console

Post by maik »

Hi Commander_X, thanks for looking into that.

I’m on MacOS 11.2. Python is stock Python That comes with MacOS. I only tried the simple debug console, so didn’t need most of the extra libraries.

However, I am quite sure that the problem lies in the Oolite MacOS implementation of handling the debug channel. I implemented the protocol based on node.js and experience the same symptoms as with the Python simple debug console. When I use my implementation with Oolite on Windows there are no problems.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 678
Joined: Sat Aug 09, 2014 4:16 pm

Re: MacOS debug version does not work with external console

Post by Commander_X »

Following hiran's reports here and here, and remembering of my remark on this, I repeated the debug console attempt on a BigSur VM I have floating around.
Here are some remarks:
- the dependency list for python is raised by 3 more (mainly needed for a warning raised by twisted):
service-identity-21.1.0
pyasn1-0.4.8
pyasn1-modules-0.2.8
- DebugConsole.py won't start with Mac's out-of-the-box python, due to some Tkinter issues (reported across the web) ("idle" fails too -- it seems that tcl/tk are broken)
- pySimpleConsole.py starts and opens the port correctly
- I could connect a local (Linux, self-built) version of Oolite to the Mac pySimpleConsole.py, and award myself a missile
- Mac Oolite 1.90 TestRelease version, hung for almost a minute and a half, finally disconnected, and started the game (in disconnected status)
Relevant entries in the log:

Code: Select all

12:18:45.226 [shipData.load.begin]: Loading ship data.
12:18:45.941 [debugSupport.load.success]: Debug Bundle loaded successfully.
12:18:45.942 [system]: Warning: +[NSStream getStreamsToHost:port:inputStream:outputStream:] is deprecated since OS X 10.10. Please use +[NSStream getStreamsToHostWithName:port:inputStream:outputStream] instead.
12:18:46.005 [startup.complete]: ========== Loading complete in 1.09 seconds. ==========
12:18:46.139 [debugTCP.connected]: Connected to debug console "pySimpleConsole".
12:20:01.164 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'The operation couldn’t be completed. Operation timed out' (outStream status: 7, inStream status: 7)."
12:20:27.443 [shipData.load.begin]: Loading ship data.
Console (pySimpleConsole.py) messages:

Code: Select all

Waiting for connection...

Opened connection to Oolite version 1.90
Connection closed with no message.
The warning in the log seems to suggest (my 0.02 Cr) that someone with a Mac build environment at hand should attempt a "#if OOLITE_MAC_OS_X" replacement of the deprecated getStreamsToHost with getStreamsToHostWithName (which, unfortunately, is not part of the GNUstep, so is OS specific) in Core/Debug/OODebugTCPConsoleClient.m file, re-compile, and check if this helps.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: MacOS debug version does not work with external console

Post by hiran »

Commander_X wrote: Tue Jan 04, 2022 6:13 pm
- pySimpleConsole.py starts and opens the port correctly
- I could connect a local (Linux, self-built) version of Oolite to the Mac pySimpleConsole.py, and award myself a missile
- Mac Oolite 1.90 TestRelease version, hung for almost a minute and a half, finally disconnected, and started the game (in disconnected status)
Relevant entries in the log:
Interesting. This proves that the python simple debug console is working correctly while Mac Oolite causes the issue.
And it is repeatable.
Commander_X wrote: Tue Jan 04, 2022 6:13 pm
The warning in the log seems to suggest (my 0.02 Cr) that someone with a Mac build environment at hand should attempt a "#if OOLITE_MAC_OS_X" replacement of the deprecated getStreamsToHost with getStreamsToHostWithName (which, unfortunately, is not part of the GNUstep, so is OS specific) in Core/Debug/OODebugTCPConsoleClient.m file, re-compile, and check if this helps.
Sounds like a good first shot. :-)
Remains the question who has a Mac build environment. I am based on Linux solely.
Sunshine - Moonlight - Good Times - Oolite
Post Reply