Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Mac builds don't run #1113

Closed
rversteegen opened this issue Apr 18, 2020 · 7 comments
Closed

All Mac builds don't run #1113

rversteegen opened this issue Apr 18, 2020 · 7 comments
Labels
bug Yeah... that's broken build process To do with compiling the OHRRPGCE os: mac Specific to Macs packaging Packaging/installing the engine or games (Distribute Game) rel: fufluns Present in fufluns 2020-01-12 rel: New in ... Introduced in the tagged "rel:" release/nightlies release-blocker For any bug that is currently blocking the next stable release

Comments

@rversteegen
Copy link
Contributor

kylekrack reports that the nightly gfx_sdl2 Mac build (both Game and Custom) doesn't run:

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
  Referenced from: /private/var/folders/*/OHRRPGCE-Game.app/Contents/MacOS/ohrrpgce-game
  Reason: image not found

However, the OHRRPGCE-Game.app/Contents/Frameworks/SDL2.framework/Versions/A/SDL2 file does exist. Maybe the problem is rpath. I don't have the ability to check or fix this until later (need a Mac).

Marking as a Fufluns bug since the gfx_sdl2 build was introduced then.

@rversteegen rversteegen added os: mac Specific to Macs gfx_sdl2 Specific to the SDL 2 graphics/IO backend build process To do with compiling the OHRRPGCE rel: fufluns Present in fufluns 2020-01-12 rel: New in ... Introduced in the tagged "rel:" release/nightlies labels Apr 18, 2020
@rversteegen rversteegen added the bug Yeah... that's broken label Aug 22, 2020
@rversteegen rversteegen changed the title Mac gfx_sdl2 build doesn't run All Mac builds don't run Aug 25, 2020
@rversteegen rversteegen added release-blocker For any bug that is currently blocking the next stable release packaging Packaging/installing the engine or games (Distribute Game) and removed gfx_sdl2 Specific to the SDL 2 graphics/IO backend labels Aug 25, 2020
@rversteegen
Copy link
Contributor Author

rversteegen commented Aug 25, 2020

Uh oh. Ravancloak reports that 32-bit gfx_sdl and 64-bit gfx_sdl builds are now broken too, not just 64-bit gfx_sdl2. Same error as before, but SDL instead of SDL2.

Ravancloak: can't open the newest 64-bit mac nightly build of custom or player
Ravancloak: sdl 2 build too...
Ravancloak: and the 32 bit version won't open either
Ravancloak: it looks like 2020-07-31 is the newest one I can open. none of the sdl-2 builds open in the index of old nightlies. None of the mac builds after 2020-07-31 will open.

James upgraded/reinstalled SDL.framework (1.2.15) and SDL2.framework (2.0.12) (in /Library/Frameworks/ on the build machine, removing copies in ~/Library/Frameworks/) on 2020-08-02, and SDL_mixer.framework (1.2.12) on 2020-08-20.

Ravancloak confirmed the 64-bit SDL2 build was working on approx 2020-08-09 (the fix for #1138). So I think he must have tested just the sdl2 build back to 2020-07-31. I also know from a process sampling report from kylekrack (for #1147) that the 20200809 64-bit gfx_sdl Mac nightly worked... but surprisingly it shows the SDL version is 1.2.14 although 1.2.15 was installed at that point. Maybe this means the SDL devs compiled it with the wrong version number embedded in the dylib. [EDIT: turns out it was using obsolete frameworks in /Library/Frameworks on kylekrack's machine]

So it appears it was the upgrade to SDL_mixer.framework that was the problem, not SDL.framework. So I guess the problem is that SDL_mixer can't find SDL, even though the error says that ohrrpgce_game/custom can't find it.

@rversteegen
Copy link
Contributor Author

rversteegen commented Aug 25, 2020

Ravancloak told me he tried all three builds back to 2020-07-31. I guess something must have changed to cause the builds that previously worked to break now. And I guess @knemeth (kylekrack) has a copy of SDL.framework (but not SDL2.framework) installed for some reason, so didn't see the error.

Can't say I want to spend any more time figuring out who can or can't run which builds, as long as I'm able to reproduce it myself when I have access to a Mac (which is probably at least a week or two away)

@bob-the-hamster
Copy link
Collaborator

I tested the 64 bit SDL1.2 build on the Mac nightly build VM, and of course it worked, presumably because the frameworks are installed directly there.

Then it occured to me that maybe the breakage had something to do with removing the frameworks from ~/Library/Frameworks/ like maybe something was only checking there, and failing to check /Library/Frameworks

So I copied all the frameworks to ~/Library/Frameworks/ so now they exist in both places.
I forced an early nightly, and I notice that the filesize of OHRRPGCE-wip-x86_64.dmg did increase noticeably (12913931 bytes instead of 11427333 bytes) so maybe that helped?

@rversteegen
Copy link
Contributor Author

Yes, bundle-apps.sh prefers ~/Library/Frameworks.

I forced an early nightly, and I notice that the filesize of OHRRPGCE-wip-x86_64.dmg did increase noticeably (12913931 bytes instead of 11427333 bytes) so maybe that helped?

Ah! I downloaded and compared ohrrpgce-mac-minimal-x86_64.tar.gz from 20200821 and 20200826 and discovered that 20200826 contains 3 copies of SDL! The duplicate copies of SDL is a separate bug. It might happen that it allows the x86_64 20200826 build to run, but isn't a real solution.

mac_x86_64_sdl_20200826/OHRRPGCE-Game.app/Contents/Frameworks/SDL.framework/SDL
mac_x86_64_sdl_20200826/OHRRPGCE-Game.app/Contents/Frameworks/SDL.framework/Versions/A/SDL
mac_x86_64_sdl_20200826/OHRRPGCE-Game.app/Contents/Frameworks/SDL.framework/Versions/Current/SDL

And one of these has been trimmed by bundle-apps.sh to just x86_64 while the other contains both x86 and x86_64.
Normally, two of these are symlinks to the actual file. bundle-apps.sh removes the symlinks from OHRRPGCE-Game.app but not OHRRPGCE-Custom.app, because those symlinks would get expanded to copies when distributing on Windows.
The fact that we now have three copies but didn't before makes me think that the symlinks got messed up when you copied the framework. I suggest you delete the ~/Library/Frameworks/* because it didn't fix the problem (see below).
SDL_mixer.framework, SDL2.framework and SDL2_mixer.framework don't have any duplication. They just have SDL*.framework/Versions/A/SDL*.

Back to the real problem.
I compared 20200731, 20200821, 20200826 builds of ohrrpgce-mac-minimal-x86.tar.gz and found no differences between the frameworks in them, as expected. Then I grepped ohrrpgce-game and discovered the cause of the problem:

20200731 @executable_path/../Frameworks/SDL.framework/Versions/A/SDL
20200821 @rpath/SDL.framework/Versions/A/SDL
20200826 @rpath/SDL.framework/Versions/A/SDL

The x86_64 and x86_64-sdl2 builds all point to @rpath/SDL.framework/Versions/A/SDL or @rpath/SDL2.framework/Versions/A/SDL2

It's not wrong for these paths to contain @rpath. The problem is that the rpath apparently isn't being set correctly, we need to pass something to ld.

rversteegen added a commit that referenced this issue Aug 26, 2020
@rversteegen
Copy link
Contributor Author

OK, I've made an attempted fix for this based on this that I'm fairly confident will work.

@rversteegen
Copy link
Contributor Author

Currently, 32-bit mac nightlies don't build because of the rpath change, and 64-bit ones don't run because FLAC.framework is missing (because build-apps.sh deletes it - I thought it was runtime loaded by SDL_mixer). Fixing.

This is trivia, but I discovered why our builds broke. While browsing the SDL hg repo I found the following change for SDL 1.2.15:
"Switched to @rpath for the install path and switched minimum OS to 10.5"

-                               INSTALL_PATH = "@executable_path/../Frameworks";
+                               INSTALL_PATH = "@rpath";

rversteegen added a commit that referenced this issue Aug 28, 2020
@rversteegen
Copy link
Contributor Author

At last, the Mac builds seem to work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Yeah... that's broken build process To do with compiling the OHRRPGCE os: mac Specific to Macs packaging Packaging/installing the engine or games (Distribute Game) rel: fufluns Present in fufluns 2020-01-12 rel: New in ... Introduced in the tagged "rel:" release/nightlies release-blocker For any bug that is currently blocking the next stable release
Projects
None yet
Development

No branches or pull requests

2 participants