Cannot start OpenTTD after successfully building from source on OSX

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
bence23
Engineer
Engineer
Posts: 5
Joined: 19 Mar 2020 22:04

Cannot start OpenTTD after successfully building from source on OSX

Post by bence23 »

Hi,

I just cloned the project from git and built it based on https://wiki.openttd.org/Compiling_on_Mac_OS_X. Everything compiled fine, I only have a couple deprecation or unused variable warnings. When I start the application the process doesn't seem to do anything, just hangs there. I tried to start by using the "make run" command, going straight to the build folder and running the openttd executable and creating a bundle file and starting that, the result is always the same: nothing. It doesn't stop nor provide any output. I let it run for an hour, just in case it would be processing something, but no. OSX's activity monitor shows that it uses some CPU, very little (7MB) memory and no I/O operations. I suspected that it has something to do with OSX's new security restrictions, but I couldn't find any evidence for that.

The published version that can be downloaded from www.openttd.org works fine.

I use OSX 10.15
Does anyone had this issue before? Any idea why this can happen?

User avatar
jfs
Tycoon
Tycoon
Posts: 1103
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Cannot start OpenTTD after successfully building from source on OSX

Post by jfs »

Try running the bundled build from the terminal. As far as I remember:

Code: Select all

make bundle
./bundle/OpenTTD.app/Content/MacOS/openttd
You should get errors and logging written to the terminal then.

bence23
Engineer
Engineer
Posts: 5
Joined: 19 Mar 2020 22:04

Re: Cannot start OpenTTD after successfully building from source on OSX

Post by bence23 »

Thanks for the super quick response! :bow:

Unfortunately, it doesn't help it behaves the same way :cry:

Code: Select all

~/dev/OpenTTD $ make bundle
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
[BUNDLE] Constructing bundle
23:29:16
~/dev/OpenTTD $ ./bundle/OpenTTD.app/Contents/MacOS/openttd

... and no ouput

User avatar
jfs
Tycoon
Tycoon
Posts: 1103
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Cannot start OpenTTD after successfully building from source on OSX

Post by jfs »

Okay try enabling driver debug then.

Code: Select all

./bundle/OpenTTD.app/Contents/MacOS/openttd -d driver=2


bence23
Engineer
Engineer
Posts: 5
Joined: 19 Mar 2020 22:04

Re: Cannot start OpenTTD after successfully building from source on OSX

Post by bence23 »

Thanks for all the help, the debug and driver flags unfortunately don't seem to help. :?

I keep googling around the OSX security features, maybe someone else experienced the same problem with other C projects, I suspect it might be due to the fact that the process will read the user home directory, which requires new permissions to be granted. If I find something, I'll update this thread for future reference

bence23
Engineer
Engineer
Posts: 5
Joined: 19 Mar 2020 22:04

Re: Cannot start OpenTTD after successfully building from source on OSX

Post by bence23 »

I granted all permissions to the compiled executable, no luck.

I started adding console traces to the code and I found something interesting (or it is just my complete lack of knowledge of the c++ ecosystem): In src/os/unix/unix.cpp I put an fprintf call to line 260, right before the openttd_main function call, the output was printed to the console, but if I put an fprintf call to the first line of the openttd_main function in src/openttd.cpp, that output is never printed. Does this clue rings a bell to anyone?


bence23
Engineer
Engineer
Posts: 5
Joined: 19 Mar 2020 22:04

Re: Cannot start OpenTTD after successfully building from source on OSX

Post by bence23 »

Thanks for the update, I tried a couple things in the meantime but it didn't help. I guess I'll end up playing around with the source code in a virtual box.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 4 guests