Repository navigation
Figure out compile requirements on MacOS Sequoia (15) #1281
Copy link
Copy link
Open
Description
I'm writing an ansible script that can install all the OHRRPGCE compile dependencies on a MacOS target, but I am having a hard time getting it all working, especially figuring out which clang/gcc versions actually work
I current have everything installed, but compiling with
ohrmacdev@OHRRPGCEs-MacBook-Pro wip % scons game
scons: Reading SConscript files ...
Using target: darwin arch: x86_64 fbc: fbc (1.06.0 (04-29-2016)) fbcc: gcc (clang 16.0.0) cc: gcc (clang 16.0.0) cctarget: x86_64-apple-darwin24.3.0
WARNING: due to bug in old fbc, dropping arg -Wc -Wno-incompatible-library-redeclaration
WARNING: due to bug in old fbc, dropping arg -Wc -Wno-builtin-requires-header
WARNING: due to bug in old fbc, dropping arg -Wc -Wno-missing-braces
WARNING: due to bug in old fbc, dropping arg -Wc -Wno-unused-but-set-variable
scons: done reading SConscript files.
scons: Building targets ...
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/achievements_runtime.rbas.bas -o build/achievements_runtime.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/bmod.rbas.bas -o build/bmod.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/menustuf.rbas.bas -o build/menustuf.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/moresubs.rbas.bas -o build/moresubs.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/savegame.rbas.bas -o build/savegame.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/purchase.rbas.bas -o build/purchase.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/achievements.rbas.bas -o build/game-achievements.rbas.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/animations.rbas.bas -o build/game-animations.rbas.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/game-achievements.rbas.o.c -o build/game-achievements.rbas.o
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/common.rbas.bas -o build/game-common.rbas.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/achievements_runtime.rbas.o.c -o build/achievements_runtime.rbas.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/game-animations.rbas.o.c -o build/game-animations.rbas.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/purchase.rbas.o.c -o build/purchase.rbas.o
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r build/loading.rbas.bas -o build/game-loading.rbas.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/moresubs.rbas.o.c -o build/moresubs.rbas.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/savegame.rbas.o.c -o build/savegame.rbas.o
Retrieved `build/os_sockets.o' from cache
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r networkutil.bas -o build/networkutil.o.c
Retrieved `build/os_unix.o' from cache
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r os_unix2.bas -o build/os_unix2.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/networkutil.o.c -o build/networkutil.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/menustuf.rbas.o.c -o build/menustuf.rbas.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/os_unix2.o.c -o build/os_unix2.o
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r util.bas -o build/util.o.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r base64.bas -o build/base64.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/base64.o.c -o build/base64.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/bmod.rbas.o.c -o build/bmod.rbas.o
Retrieved `build/unicode.o' from cache
Retrieved `build/array.o' from cache
Retrieved `build/miscc.o' from cache
Retrieved `build/fb/error.o' from cache
Retrieved `build/lib/sha1.o' from cache
Retrieved `build/lib/lodepng.o' from cache
Retrieved `build/lib/lodepng_gzip.o' from cache
Retrieved `build/filelayer.o' from cache
Generating version/backend info
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r build/globals.bas -o build/globals.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/globals.o.c -o build/globals.o
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r lumpfile.bas -o build/lumpfile.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/util.o.c -o build/util.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/lumpfile.o.c -o build/lumpfile.o
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -r vector.bas -o build/vector.o.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/vector.o.c -o build/vector.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/game-loading.rbas.o.c -o build/game-loading.rbas.o
gcc -o build/os_unix_wm.o -c -I. -Wall -Wno-deprecated-declarations -Wno-unused-but-set-variable -DFBCVERSION=1060 -g -fno-omit-frame-pointer -O3 -ffunction-sections -fdata-sections -mmacosx-version-min=10.6 -m64 -fwrapv -frounding-math --std=gnu11 -D_THREAD_SAFE -I/usr/local/include/SDL2 os_unix_wm.c
Retrieved `build/blit.o' from cache
Retrieved `build/matrixMath.o' from cache
Retrieved `build/rasterizer.o' from cache
Retrieved `build/rotozoom.o' from cache
Retrieved `build/surface.o' from cache
Retrieved `build/lib/gif.o' from cache
Retrieved `build/lib/jo_jpeg.o' from cache
Retrieved `build/lib/ujpeg.o' from cache
Generating datafiles.c
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r game.bas -o build/game.o.c
gcc -o build/datafiles.o -c -I. -Wall -Wno-deprecated-declarations -Wno-unused-but-set-variable -DFBCVERSION=1060 -g -fno-omit-frame-pointer -O3 -ffunction-sections -fdata-sections -mmacosx-version-min=10.6 -m64 -fwrapv -frounding-math --std=gnu11 -D_THREAD_SAFE -I/usr/local/include/SDL2 build/datafiles.c
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/game-common.rbas.o.c -o build/game-common.rbas.o
In file included from os_unix_wm.c:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h:28:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h:28:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:8:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:276:34: error: missing ')' after '__attribute__'
276 | # if __CG_HAS_COMPILER_ATTRIBUTE(pure)
| ^~~~
./fb/../config.h:211:29: note: expanded from macro 'pure'
211 | # define pure __attribute__ ((__pure__))
| ~~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:20:66: note: expanded from macro '__CG_HAS_COMPILER_ATTRIBUTE'
20 | # define __CG_HAS_COMPILER_ATTRIBUTE(attribute) __has_attribute(attribute)
| ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:276:6: note: to match this '('
276 | # if __CG_HAS_COMPILER_ATTRIBUTE(pure)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:20:65: note: expanded from macro '__CG_HAS_COMPILER_ATTRIBUTE'
20 | # define __CG_HAS_COMPILER_ATTRIBUTE(attribute) __has_attribute(attribute)
| ^
fbc -g -i /Users/ohrmacdev/src/ohr/wip/build/ -mt -target darwin -arch x86_64 -asm att -gen gcc -Wc -I.,-fno-omit-frame-pointer,-O3,-ffunction-sections,-fdata-sections,-mmacosx-version-min=10.6,-Wno-deprecated-declarations -d IS_GAME -m game -r bmodsubs.bas -o build/bmodsubs.o.c
1 error generated.
scons: *** [build/os_unix_wm.o] Error 1
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/bmodsubs.o.c -o build/bmodsubs.o
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -g -m64 -fwrapv -frounding-math --std=gnu11 -fdata-sections -fno-omit-frame-pointer -mmacosx-version-min=10.6 -Wno-unused-but-set-variable -Wno-deprecated-declarations -O3 -I. -DFBCVERSION=1060 -ffunction-sections -Wno-missing-braces -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration -c build/game.o.c -o build/game.o
scons: building terminated because of errors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
bob-the-hamster commentedon Mar 15, 2025
The docs here https://rpg.hamsterrepublic.com/ohrrpgce/Compiling_in_Mac_OS_X suggest using:
"XCode 4.2/Apple GCC 4.2.1, and GCC 4.9.3 from MacPorts are both known to work.)"
Apparently XCode 16 is current, so 4 is really old. I already have the Xcode command line tools installed and it seems to just have clang 16 (gcc seems to just be an alias for clang)
Macports still exists, but I am hoping to be able to get everything I need from Homebrew, as it is really the de-facto standard, and I would like to avoid requiring two different package managers if I can help it.
However, brew defaults to gcc version 14, and it looks like gcc 9 is the oldest they have in their default package repos
bob-the-hamster commentedon Mar 15, 2025
First draft of the ansible is here https://github.com/ohrrpgce/ohrrpgce/blob/wip/ansible/macdev/macdev.yml
rversteegen commentedon Mar 16, 2025
This is caused by our
#define pure ...in config.h. We should renamepuretopurefuncor similar.Also, I would not recommend using an old version of clang or gcc. Better to use the newest stable. That comment on the wiki page is ancient.
bob-the-hamster commentedon Mar 16, 2025
Renaming pure to purefunc did help. (By the way, is pure actually used anywhere? I was not able to spot any usage of it anywhere outside of config.h)
That fix did get me past the compiling stage, but it fails at linking
I guess the sdl2 that I installed with brew just isn't a framework build, so I'll have to figure out how to install a framework build, or to convert what brew installs into a framework (I found inconsistent information about whether or not that was even possible)
rversteegen commentedon Mar 17, 2025
I think that I added
purebecause I thought I would use it, but didn't, and I've since forgotten about it.It's probably best to download and link to the official SDL framework builds. SConscript contains
FRAMEWORKS_PATH, but it's not customisable yet. So it expects framesworks either in ~/Library/Frameworks or in /Library/Frameworks.) Additionally ifsdl2-configis installed,sdl2-config --cflagsis used instead for the-Iinclude path, so you'd have to uninstall SDL from homebrew if switching to frameworks.bob-the-hamster commentedon Apr 4, 2025
I removed the SDL2 frameworks from homebrew, and installed the frameworks into ~/Library/Frameworks instead.
compiling still fails, but with new and interesting error messages
rversteegen commentedon Apr 11, 2025
Notice that
-Iis missing before the (nonexistant) header path, and it's been moved elsewhere. I see the problem. This line:'$FBCC $FBC_CFLAGS ${list(set(CFLAGS).difference(FBC_CFLAGS))} $GENGCC_CFLAGS -c ${TARGET}.c -o $TARGET']I really shouldn't have tried to cram that into one line.
I'm gone for the next few days, if you want to fix it.
Also, all those syntax warnings in recent Python (which I haven't seen before) will turn into errors into a future version so need fixing.
bob-the-hamster commentedon Apr 12, 2025
I could not find a way to fix it in that line, but this did help:
With that fix, it gets further, to a different interesting error
rversteegen commentedon Apr 14, 2025
I sometimes see similar errors when trying linking 32-bit and 64-bit object files together, which happens because disappointingly SCons sometimes fails to rebuild objects when I interrupt a build and then switch arch. Try
file build/game-achievements.rbas.oto check whether it's 32-bit. If so try doing a clean build... but you probably are since this is with ansible?bob-the-hamster commentedon Apr 14, 2025
It does seem to be 64 bit
rversteegen commentedon Apr 15, 2025
I would try to figure out whether those symbols are not in the object files, in which case they were built incorrectly, or if they are then maybe the linker wasn't invoked correctly, e.g. because of an object file ordering issue and this code:
rversteegen commentedon Apr 15, 2025
Well, I don't think the
-( ... -)args should ever be needed for .o files, only for libraries. So that's probably not it. But it looks like it could be a similar problem.bob-the-hamster commentedon Apr 19, 2025
Well, it seems likely that file wasn't build correctly
rversteegen commentedon Apr 19, 2025
Are you sure this a clean build? An earlier log you posted showed an error while compiling
build/game-achievements.rbas.o. The list of missing symbols shows other objects are built normally. Otherwise, doesbuild/game-achievements.rbas.ccontain code?bob-the-hamster commentedon Apr 19, 2025
Definitely a clean build, because I get the same even when I
rm -R ./buildHowever, you are right,
build/game-achievements.rbas.o.cis almost empty.Furthermore,
build/achievements.rbas.basis completely empty.So the problem command seems to be:
I'm investigating that. It runs with no errors, and other reloadbasic invocations do seem to generate code just fine.
bob-the-hamster commentedon Apr 19, 2025
I ran that reloadbasic command with
--traceand it produced abundant output that looks like proper processing of the file, with nothing that seems to be an error message.rbtrace.txt
bob-the-hamster commentedon Apr 19, 2025
My current suspect is
DelayedFileWriterclassEven if I tell it to
.flush()and exit the program early after writing the first few lines, I still get an empty file.Also, I get empty output no matter which rbas file I compile, which is weird, because when I compiler with scons, all of them except
build/achievements.rbas.basare non-emptyEDIT: actually thats just with the early flush and exit, so I'm probably on to something there...
bob-the-hamster commentedon Apr 19, 2025
Hmmm... so in the process of trying to track down exactly where the write was failing to the reloadbasic output file, I happened to add a
print(self.file.tell())and suddenly the bug went away. Super weird! So my build compiles now, but the reloadbasic mystery remains unsolved.Now the build succeeds, with the following two warnings:
The custom binary fails with this message
That error speaks the truth,
/Users/ohrmacdev/src/ohr/Frameworks/SDL2.frameworkdoes not exist, but I am unsure why it is looking there instead of/Users/ohrmacdev/Library/Frameworks/SDL2.framework(passage of time...)
Oh! Okay.
./bundle-apps.sh x86_64 SDL2does actually give me working apps. Yay!So I now have a working dev environment on MacOS Sequoia
"Test Game" doesn't work from the bundled app, but maybe that is expected.
Also I don't know if it is possible to create a 32 bit build from this environment or not
rversteegen commentedon Apr 19, 2025
I'm still using Python 3.11. I had a look through the changes in 3.12 and notice that there are changes to the GC. I also notice that
DelayedFileWritercreatesFileMarkerreference loops. reloadbasic.py doesn't actually flush or close the output file but instead dodgily assumes that it will be closed/flushed to disk when the program exits, when all variables are finalised. It turns out that this worked in Python 2 but is not reliable in Python 3. The reason being the reference loops: in order to clean them up the GC has to break references between objects and it can break references inside the file object, destroying the buffer without flushing it. See python/cpython#62052 (comment) and python/cpython#23135 (comment). There is a warning in the documentation (which was fixed here: you have to close files, not just delete them).It's meant to work if
OHRRPGCE-Game.appis next toOHRRPGCE-Custom.app. Anything in c_debug?rversteegen commentedon Apr 20, 2025
I notice that the current Mac build machine doesn't print this and must have an older SDL version. It used to be the case that SDL2 was built to target 10.6+. Doing some (a lot of) searching I found it's changed as follows
(And it was 10.7 for a short while between 2.24 and 2.0.22).
It was (mainly?) changed to support newer XCode, and that's just the default target and it's likely SDL2 could still be custom-built to support older versions, but I don't want to bother with that.
I think it's worth using an older SDL version to support a few more years of MacOS releases anyway, until we actually want some newer feature or bugfix. 2.26.4 will be a good option too; that's almost right at the end of active SDL 2 development.
I also saw
But our 32-bit Mac apps use SDL 1.2 anyway, and support macOS 10.4+ (2005). But you'd also have to first get 32-bit builds working. Is the clang toolchain from XCode, or from homebrew? It would be nice to keep but not priority. The last 32-bit-only Macs were apparently from approximately 2011.
MacOS requirement of SDL_mixer and other optional libraries all seem to match the corresponding SDL release.
reloadbasic: Exorcise haunted code by correctly closing output file t…
rversteegen commentedon May 18, 2025
Related to my spelunking above, I've just discovered that Wohlstand (who else) patched SDL 2.26/27 to get it running on OSX 10.4 on a PPC. Mostly.
libsdl-org/SDL#6506
bob-the-hamster commentedon Jul 23, 2025
I did figure out why "Test Game" wasn't working on mac.
I was running
open OHRRPGCE-Custom.appout of the source where I built it. It was trying to runohrrpgce-gamefrom the same folder, which doesn't work for me.Copying both
OHRRPGCE-*.appfiles to a different folder works around the problem for me.bob-the-hamster commentedon Aug 6, 2025
I realized that
ohrrpgce-gameandohrrpgce-customwhere just looking for../Frameworkswhich makes perfect sense inside the app bundle, but did not make sense in my source folder. I fixed it with a simple symlink.Now I am noticing a really weird error with
scons autotest_rpgIt mostly works, but then the script fails in weird ways, like asserts failing where they don't fail on Linux builds.
If I comment out enough failing tests in autotest.hss I eventually get a script corruption error, so maybe hspeak on mac is writing corrupt output in some cases
rversteegen commentedon Aug 7, 2025
"scons test", runs ohrrpgce-game without bundling it, so I would want it to work without needing to set up a symlink. SConscript passes
-rpath,@executable_path/../Frameworks''-rpath,@executable_path/../Frameworksand we could make it look in ~/Library/Frameworks too.Likewise IIRC Test Game prefers to run ohrrpgce-game instead of OHRRPGCE-Game.app because if it exists it's likely because you've just recompiled ohrrpgce-game.
Considering that that is an error message that I recently touched, about an error condition in script trigger stuff that I recently rewrote, the most likely explanation is that my changes I broke it.
rversteegen commentedon Aug 7, 2025
You could even copy autotest.rpg to Linux and see whether running it there gives the same error to find out whether the problem is in compile/import or in Game.
That error message doesn't indicate a problem with hspeak, most likely lookup1.bin is written (or read) incorrectly. Probably to do with the way (inside
importscripts) the old lookup1.bin is loaded, a new temp file in a different format is written, and they are swapped. Could be Mac-specific file IO differences (e.grename(2)is infamously not atomic on Mac) or more likely just due to the sequence of script imports on that particular machine exposed a bug.bob-the-hamster commentedon Aug 7, 2025
I created #1284 specifically for this script corruption bug, since I want to get that fixed for kaleidophone+1