Open jaydenmilne opened 5 years ago
So it seems OSX support is going to be a lot bigger of a pain than we thought.
The APIs around shared memory and semaphores is similar, but subtly different than Linux. Most of them we can work around, but the tricky one is the 30 character name size limit on semaphore/shared memory names.
Even without a GUID and shortening the prefix of the names considerably, we can still go over that limit with things like '/HLDK_MEM_uav0_RGBCamera_sensor_data'’
. To make matters worse, those names are user defined, so if a user gave a really long name like UnmannedAerialVehicle0
or gave a sensor a long name in a config file it would fall over and die on OSX, which doesn't make for a very good user experience.
We would either have to (in order of difficulty):
Use short names in config files and only allow one instance of Holodeck at once, and pray we never go over the limit
This would mean you couldn't use Holodeck for serious training on OSX, only for debugging or developing. This might be acceptable.
Rework the naming scheme
We could have some back and forth communication between the engine and the client to negotiate names, since 30 characters really is plenty of entropy. We would have to have a way for the client and engine to agree something like /H1924829_A953
corresponds to '/HLDK_MEM_uav0_RGBCamera_sensor_data'’
Use something other than POSIX shared memory and semaphores on MacOS
Apple encourages OSX developers to use something other than POSIX, we could look into that and see if we could make wrappers around those APIs
Thinking about it, I thin our best bet is to
/asdk3-zUUID-HLDK_MEM_uav0_RGBCamera_sensor_data
The chances of having a collision are very slim, would still allow users to use whatever names they wanted, and would allow multiple copies at once.
Josh did some initial investigations, and it wasn't hard to get Holodeck running on OSX. We should look into porting Holodeck to OSX and providing binaries for it.