1

I am trying to download and run the source code of a previous version of the Apple macOS chess game (preferably in the 369-408 version range) using XCode 14.1.

The game is written in Objective-C and interfaces with a chess engine called "sjeng" that is written in C. (Correct me if I'm wrong).

I have already navigated some preliminary stumbling blocks (which you may want to follow to duplicate if you'd like to give this a try):

  1. Downloading the source code in the first place.

[ The next four steps come from here ]

  1. Commenting out the "#include..." line from the Chess.xcconfig file.

  2. Removing the com.apple.private.tcc.allow entitlement from the Chess.entitlements file.

  3. Getting my provisioning profile set up for the X-Code project (this is straight-forward as long as you already have a developer profile).

  4. Changing the bundle identifier from "com.apple..." to something random.

  5. Resolving "Implicit declaration of function is invalid in C99" compile-time errors related to the C code within the sjeng chess engine. This question helped with that.

But now I am stuck on the next and hopefully final step which is this is the build error:

./build-book normal nbook.pgn
+ test -z ''
+ SJENG=/Users/classified/Library/Developer/Xcode/DerivedData/MBChess-frynfmbcfskhcfdlqxxctvlldmnm/Build/Products/Development/sjeng.ChessEngine
+ cat
+ /Users/classified/Library/Developer/Xcode/DerivedData/MBChess-frynfmbcfskhcfdlqxxctvlldmnm/Build/Products/Development/sjeng.ChessEngine
./build-book: line 21: /Users/classified/Library/Developer/Xcode/DerivedData/MBChess-frynfmbcfskhcfdlqxxctvlldmnm/Build/Products/Development/sjeng.ChessEngine: No such file or directory
make: *** [nbook.db] Error 1
Command ExternalBuildToolExecution failed with a nonzero exit code

I have no clue what this stage of the build process pertains to.

I have verified in the Finder that the directory in the error message does indeed not exist.

I tried "Cleaning the Build Folder" in XCode and building again, but same result.

Can anyone get the game actually running (from source) on macOS and describe the steps required to get there?

Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100
  • 1
    The error concerns a missing file. I have no idea but I would **guess** that file was supposed to be generated in an earlier step of the build process which also failed. The path name element `DerivedData` is a bit of a clue there. – john Dec 02 '22 at 20:20

1 Answers1

2

Here is how it worked for me:

  1. Download the project from here (build tag 408);
  2. Unarchive the project and open MBChess.xcodeproj file with Xcode;
  3. Open MBChess target and do as follows:
    • Change Bundle Identifier to something more relevant to you
    • Enable "Automatically manage signing" flag
    • Choose your Apple Developer team OR choose any personal team
    • (Optional) If you chose a personal team, don't forget to remove incompatible entitlements from here (Game Center)

enter image description here

  1. Remove Chess.xcconfig file from Project Navigator: enter image description here

  2. Find Chess.entitelements file and remove com.apple.private.tcc.allow array from it: enter image description here

  3. Select sjeng target and build it first enter image description here

  4. Select MBChess target and build it for the same platform enter image description here

At this point the app should build successfully (I was using macOS Ventura 13.0.1 (22A400) as the target platform with Xcode Version 14.1 (14B47b))

The Dreams Wind
  • 8,416
  • 2
  • 19
  • 49
  • It worked!! Thank you! I think the main thing was compiling sjeng separately first. I think this will be very useful for others in the future, also. – Nerdy Bunz Dec 05 '22 at 02:01
  • 1
    @NerdyBunz In fact this dependency is set under `MBChess` target and theoretically `sjen` should have been compiled first automatically. However the same dependency exist for another target `Opening Books` which itself also depends on `sjen`. For some reason `Opening books` dependency was not satisfied for me in the given order either, and it started working for me only after i built `sjen` manually. For future reference - you can find which targets are expected to be built before an arbitrary target under `Target Dependencies` phase of `Build Phases` (provided the dependencies were specified) – The Dreams Wind Dec 05 '22 at 07:01