Jump to content
Sign in to follow this  
Yves

Build environment and deployment on the Mac

Recommended Posts

Allright then. Indeed, it's more logical that way.

To do some "idiotic stuff", I've tried renaming the app bundle... Still works.

Atlas starts, but I get a wxWidgets error when I try to move around :"../src/osx/cocoa/combobox.mm(114): assert "item >= 0 && item < [m_comboBox numberOfItems]" failed in SetSelectedItem(): Inavlid item index."

Share this post


Link to post
Share on other sites

To do some "idiotic stuff", I've tried renaming the app bundle... Still works.

Excellent, it's good to test these things :)

Atlas starts, but I get a wxWidgets error when I try to move around :"../src/osx/cocoa/combobox.mm(114): assert "item >= 0 && item < [m_comboBox numberOfItems]" failed in SetSelectedItem(): Inavlid item index."

Oh, that's not good. What action causes the error? I tried opening different maps and using various tabs/controls but couldn't reproduce it. If you have gdb, can you try something like this to capture the call stack:


$ gdb 0ad.app/Contents/MacOS/pyrogenesis

(gdb) run -editor

*crash*

(gdb) bt full

Share this post


Link to post
Share on other sites

Atlas starts, but I get a wxWidgets error when I try to move around :"../src/osx/cocoa/combobox.mm(114): assert "item >= 0 && item < [m_comboBox numberOfItems]" failed in SetSelectedItem(): Inavlid item index."

OK this is reproducible even without an app bundle, I believe the cause has been found and will be fixed in SVN.

Share this post


Link to post
Share on other sites

@Ben, don't worry about Mountain Lion just yet. Save that for summer :P

I couldn't help it, I "peeked" and here's what I found out :P

  • Mountain Lion won't be including X11, if an app requires X11 to run, the user is prompted to visit Apple's website with instructions on how to install XQuartz
  • Apple is deprecating more unspecified parts of Carbon (C/C++ API for OS X, also primarily 32-bit), obviously pushing people into the Objective-C/C++ 64-bit Cocoa API
  • There's a new feature called Gatekeeper, it blocks apps from running if they don't have a special signature from Apple, you have to be an approved Mac developer to acquire one, assuming that means paying at least $99/yr. Modifying a trusted app makes it untrusted and the OS X firewall will block it.

:(

Share this post


Link to post
Share on other sites

I'm really not sure that the third feature is compulsory.

Apple promise that it is not:

http://www.apple.com/macosx/mountain-lion/security.html :

You control what you install.

<...>Gatekeeper brings you even more security options<...> Or you can install all apps from anywhere, just as you can today. You can even temporarily override your setting by Control-clicking, and install any app at any time.<...>

Share this post


Link to post
Share on other sites

Was doing a bit more digging and discovered this list of where App Store apps are allowed to write files. Note even ~/Documents is not listed, if we "manage" pictures we should use ~/Pictures, but we really don't so even that could be debated. Clearly saved games would have to go somewhere in ~/Library. It's very restrictive and I think it would be a good idea to follow those guidelines as general rules even if we don't plan to be on the App Store (for those curious, there are potential licensing conflicts between GPL and Apple's App Store policies).

------

Some people may have noticed you can't build 0 A.D. anymore even if you install Xcode and MacPorts. The reason is that GCC is no longer included with Xcode and the command line build tools have been removed by default from Xcode 4.3. If you installed an earlier version, as I did, it should work even if you upgraded. This annoyed a lot of people and caused some havoc among developers.

Just recently Apple has released a standalone package called "Command Line Tools for Xcode", which includes LLVM-GCC (it pretends to be GCC) and all the libraries needed. It's a free ~160MB download from the Apple Developer Downloads site. You need a free Apple ID to access it. Or if you have Xcode 4.3+, you can download the same package through Xcode Preferences.

I've tested, and it's possible to build the game and all its dependencies with only that package, in place of Xcode. However, because no SDKs are provided for backward compatibility, it's not possible to build a practical bundle without Xcode. Anyway I'm modifying the build scripts to handle either situation.

Share this post


Link to post
Share on other sites

Somebody made something similar for 10.6 (I read that "Command Line Tools for Xcode" is only for 10.7): http://kennethreitz.com/xcode-gcc-and-homebrew.html & the package itself https://github.com/kennethreitz/osx-gcc-installer/

Quite right and apparently that was the inspiration for Apple releasing their own package, but as 10.6 is older than 1-2 years, they obviously feel no need to support it :P Of course if someone is on 10.6, they can install an older Xcode and get the command line tools installed.

Share this post


Link to post
Share on other sites

will your script work with 10.6? Also, I always had the impression that the difference between 10.5 and 10.6 was less, if because nothing more than because "leopard" and "snow leopard". Is that at all true?

Share this post


Link to post
Share on other sites

Yeah, it should work fine on 10.6. I think we could support 10.5 with some hassle, but it's not something I'm pursuing, maybe once all the dust settles someone in the community will work on that :)

Share this post


Link to post
Share on other sites

There are only slight compatibility issues between Leopard and Snow Leopard, which was a 20$ minor "major update" of the system, mainly to streamline everything. It was massively adopted, so supporting 10.5 has no reason to be a priority.

Share this post


Link to post
Share on other sites

historic_bruno, any updates on the Mac build scripts? I'd love to give it a try out, and it would help my development on 0ad to have a consistent way to roll binaries.

Share this post


Link to post
Share on other sites

Well yes, they've been updated. It's not easy to share though, since it involves moving and renaming things (maybe easier if I used Git?) Anyway that stuff will have to wait until after Alpha 9, I'll probably be helping review existing patches in the meantime. I would like to upload an official OS X bundle for Alpha 9 on LatestReleaseMac.

Share this post


Link to post
Share on other sites

Yes! getting an official, stable binary out will be a HUGE step forward. And of course, using this method will also help reach the ultimate goal of "easy" mac compilation.

Share this post


Link to post
Share on other sites

I "upgraded" to Xcode 4.3, it's nice because unlike earlier versions (I was using 4.1) there's no need to install it, you just run the app bundle directly. Apparently updates are deltas now instead of requiring massive 2GB+ downloads. Want to uninstall? Drag the app to the trash. This means that all the Xcode required files are bundled, including SDKs. Unfortunately this causes problems if scripts are looking for SDKs in the old /Developer/SDKs location. Prime example: Boost build scripts. They try to be clever and provide a simple "macosx-version" option that automatically searches directories in /Developer/SDKs for a match. So it works great with Xcode 4.2 and earlier, but suddenly breaks on Xcode 4.3 with an unintuitive error:


error: "10.6" is not a known value of feature <macosx-version>
error: legal values:

See any mention of /Developer/SDKs or anything else remotely useful? :) I was shocked that a package like Boost misbehaved this way. Hope they've fixed it for 1.49, but either way my script has to set CFLAGS and LDFLAGS manually for Boost.

I also had to update my build scripts, SDKs are now located in... wait for it... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs.

After that it works fine. Xcode detected that I had installed the "Command Line Tools for Xcode" package and didn't ask me to download them again. I did have to fix one Premake-related build error (11259) that only occurred with the new command line tools.

Share this post


Link to post
Share on other sites

You can download the "Command Line Tools for Xcode" either in Xcode preferences, or separately as mentioned above, but it's the exact same package. As far as I know the scripts will continue working since the errors and most of the deprecation warnings have been fixed.

Share this post


Link to post
Share on other sites

OS X package for Alpha 9 is now available at http://trac.wildfire...atestReleaseMac (y)

Game works fine on my MBP 4,1 from 2008 with Snow Leopard 10.6.8 and 4Gb of RAM. 80% of CPU used during game execution.

Game runs fluently, no sound (normal i know developers are changing the sound system to put it right with OpenAL), no apuses and the games menu runs smoothly and right.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...