mrichards42 / xword

Cross-platform crossword solving
https://mrichards42.github.io/xword/
GNU General Public License v3.0
42 stars 13 forks source link

Failing to initialize LuaJIT on builds in MacOS 10.15 #120

Closed jpd236 closed 2 years ago

jpd236 commented 4 years ago

In trying to resurrect my local Mac builds once again, I'm not able to get a build w/ Lua working correctly. It's still working fine with --disable-lua passed to premake. The first time I tried to launch Xcode, I had to take an update to the developer tools. Since then, I found that:

I tried updating Premake5 to alpha 15 and fixing the TODO to set the deployment target there using the systemversion config, so that I can use the 10.7 deployment target, but that didn't seem to do it.

Not sure I have many more ideas off the top of my head... I can of course still run the 0.7.0 build just fine, but not sure how to run a fresh local build.

mrichards42 commented 4 years ago

I had a heck of a time getting a build to work on my Mac, but it sounds like we might have had different problems (I was mostly running into linker issues which turned out to be a problem with my PATH). I'm on 10.14.16 and Xcode 10.1, so it sounds like my experience might not match yours if it started failing after a build tools upgrade. I also never tried building for a 10.7 deployment target, only 10.14 -- are you saying that in your build XWord targets 10.7 but LuaJIT targets 10.14?

Getting things to build took enough time that once it I got it working I saved the the relevant env vars to a file and have been sourcing it before every build:

export CONFIGURATION=Debug
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
export XWORD_VERSION=0.7.0-SNAPSHOT
export LUAJIT_VERSION=2.0.5
export WX_VERSION=3.1.3
export MACOSX_DEPLOYMENT_TARGET=10.14
# I expect everything below here is unnecessary, but I just snagged everything
# except DEPLOYMENT_TARGET from the travis logs and didn't try to pare it down
export CXX=g++
export CXX_FOR_BUILD=g++
export CC=gcc
export CC_FOR_BUILD=gcc

Other than that I've been pretty much following the commands you wrote in the travis file to a tee:

source the-above-env
bash build-luajit.sh $LUAJIT_VERSION
./build-wxwidgets.sh $WX_VERSION $CONFIGURATION
xcodebuild -project build/xcode4/XWord.xcodeproj -configuration "$CONFIGURATION" build
jpd236 commented 4 years ago

I retested from scratch with MACOSX_DEPLOYMENT_TARGET=10.14, but still no luck. Note that in Xcode, this does nothing (AFAICT), and it picks up the deployment target from your current SDK version by default. For you that should be 10.14 since that's what you're running, I imagine; for me it's 10.15. But even when I change all the Xcode projects to target 10.14 manually, I have the same problem.

I'm on Xcode 11.2.1 and macOS 10.15.3. Sadly it seems like something breaks on virtually every major macOS update. The good thing about Travis is that it offers some stability there, at least for continuous builds.

My understanding is that the continuous builds run on macOS 10.11; wxWidgets and XWord are built targeting 10.7 (using a legacy flag that is ignored w/ newer Xcode versions). We don't specify a MACOSX_DEPLOYMENT_TARGET when building LuaJIT; I think on older versions of LuaJIT, it infers 10.4.

jpd236 commented 4 years ago

I downgraded to Xcode 10.1 and reinstalled the 10.1 developer tools but still have exactly the same problem. I think I'll need to dig further into what LuaJIT is doing under the covers to track this one down :/

mrichards42 commented 3 years ago

@jpd236 did you ever get a build working on your mac? I spent a while wrestling with it over the last couple weeks (I'm on 11 now), and eventually got it to build. I ended up upgrading wxWidgets to 3.1.5 and changing everything that mentions an earlier mac version to 11.0. That also meant pulling a new version of wxLua (hence the wxlua3 branch).

jpd236 commented 3 years ago

Just checked - my local build with wxWidgets 3.1.3 seems to run once compiled, but fails to start when launched via XCode. I'm guessing because I'm using XCode 10.1 which is old at this point. Didn't need a newer wxWidgets or changes to Mac version references, but I'm not sure if those would be necessary to (a) use a newer XCode, (b) use a newer MacOS (I'm on Big Sur, but haven't run an update in a few months), or (c) run XWord from XCode directly.

jpd236 commented 3 years ago

OK - now that I've updated to the latest version of Big Sur, I'm seeing a crash (https://trac.wxwidgets.org/ticket/19100) that I think is fixed in 3.1.5, so I'll give that a spin.

jpd236 commented 3 years ago

Confirmed that with https://github.com/mrichards42/xword/pull/150, everything seems to be working fine with my Mac. Pretty much what you described, though I was able to get things working with 10.10 instead of 10.11 (if that's what you meant).

mrichards42 commented 3 years ago

Nope, I meant 11.0, I didn't bother trying to find an earliest version that would work, so glad you did. I'm on Big Sur as well, and looks like I'm also running XCode 12.4.