Programming Orion for newcommers

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
mileser
Space Squid
Posts: 57
Joined: Thu May 15, 2014 2:32 pm

Re: Programming Orion for newcommers

#16 Post by mileser »

Geoff the Medio wrote:
mileser wrote:Building takes maybe between 5 and 10 minutes...

I have a 3 1/2 year old 15" laptop w/ Quad Core 2 GHz i7 w/ 4GB of 1333 MHz DDR3.
To build from a clean project / from scratch? I find that very hard to believe.
Well, I just did it to see exactly how long it took.

I opened up FreeOrion.xcodeproj. Once the project loaded into XCode, I updated the project starting at 20:27:00 . Once the changed files were updated, I chose "Build For..." "Running" (I already had run "Clean" yesterday since I found if I didn't do that before building, it wouldn't compile propery). It finished building (compiling and copying files to FreeOrion.app at about 20:37: 35 - so from starting the update to finishing the build took just over 10 1/2 minutes.

I don't know if I can say it was from scratch though since I think much of the work is already done by the SDK. I also think I changed a couple of items in the build settings and that I have it set to "build active architecture only" and make the OS X deployment target 10.7, rather than 10.6 - but I don't know if that makes any difference.
OS: OS X 10.10 Yosemite, XCode 6.01
Also: If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Programming Orion for newcommers

#17 Post by adrian_broher »

Mitten.O wrote:@adrian_broher: How would deeper dependence on cmake eliminate the need for an SDK? I am not aware of any library downloading capabilities in cmake.
You're not up to date then: http://www.kitware.com/media/html/Build ... ke2.8.html Add an external project cmake macro to your project which tells cmake how to build the dependency and it will do everything to reliable reproduce a build environment with fitting dependencies rendering the SDK useless.
Geoff the Medio wrote:??? I have no idea what you're talking about here... If there were no MSVC or XCode project files, the situation for Eclipse would be exactly the same as you describe... (?)
I said:
2) on the contributor side to create working build environments that work with all the required settings. This prevents potential developers from contributing.
You asked:
I don't see how providing more and simpler to use build environments would prevent developers from contributing...
I replied:
There is no Eclipse build environment on Windows, so people who want to use Eclipse on Windows and don't want to use MSVC they MUST BUILD the project file and the dependencies FROM SCRATCH. Building the project file and the dependencies from scratch is HARD, VERY HARD and just a very few people have the knowledge, determination and time to create a WORKING project file and dependencies instead of doing the actual contribution. People will say "Screw it, I'm not wasting my time with that." instead of adding something to the project. Now how does this NOT prevent developers from contributing?
How do you even come to the response quoted?
This is a relatively infrequent situation; exceptions don't invalidate the basic point.
The point is that this situation can be prevented entirely if we wouldn't maintain multiple build environments.
Aside from the "right folder" part being moot, the SDK also includes all the dependencies precompiled. But yes, I do say knowing how to use the CMake GUI, selecting the correct build system, source, and working directories, building a build system, then opening that build system is more work / harder than just opening the premade project file / solution.
See the response to Mitten.O. The precompiled dependencies are useless because the fit only for exactly one build environment per platform. The SDK needs to be versioned to fit to a specific range of commits. When dependencies change you need to rebuild the SDK and users need to download it after finding the right SDK for the project version the want to play with or develop for. This is harder than just download the code, run cmake and compile the project.
The point of the SDK is so that most developers don't need to do this. If there wasn't an SDK, every dev would have to find the right new dependency versions, download and figure out how to build them, and then make sure CMake and its derived build systems can find them. Having the SDK doesn't prevent someone from doing this if they want, but the extra work this would require would prevent many devs from contributing.
[…]
So that most devs don't have to collect and build all those dependencies.
Again: the whole point of my suggestion is to remove ALL these burdens from the the contributors/users and us developers, not shifting them from us developers to the contributors/users.
Sure... but then they'd have to do all the work that the SDK has done for them. (The point of the SDK is not to save my or Vezzra's time...)
What work are you talking about here?
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Programming Orion for newcommers

#18 Post by Geoff the Medio »

I still don't understand your point about Eclipse. Removing the MSVC and XCode projects would not magically create one for Eclipse. Creating Eclipse projects or a means to generate them would not require the MSVC and XCode projects to disappear. I said the SDK structure can change as you suggested earlier to make using other build environments / methods easier to support.

Requiring a user to download (even automatically) and build ~15 dependencies would make setting up and building FreeOrion dramatically more difficult than using an SDK. All my issues with expecting (Windows and OSX) users to navigate CMake are multiplied. And for creating such a build system, setting up all the build / download rules for all the dependencies seems ridiculously complicated and failure prone, particularly since many don't have CMake build rules, so you'd have to set them up yourself, and then maintain them, and some of the dependencies have their own dependencies. I'm not going to attempt to deal with all that, when making an SDK is substantially simpler for myself and for the person using it.

Limitations (particular SVN versions, particular OS and compiler) on how one can use an SDK bundle of prebuilt dependencies does not make them "useless". They have a specific purpose they serve simply and well, and are not intended to fix all of everyone's build problems.

That said, if you want to set all that up and can get it working reliably, it sounds potentially good for building on Linux (where using CMake is already unavoidable and I assume / require users know how to use it...).

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Programming Orion for newcommers

#19 Post by adrian_broher »

Geoff the Medio wrote:I still don't understand your point about Eclipse. Removing the MSVC and XCode projects would not magically create one for Eclipse. Creating Eclipse projects or a means to generate them would not require the MSVC and XCode projects to disappear. I said the SDK structure can change as you suggested earlier to make using other build environments / methods easier to support.
You're swapping cause and effect here. You ask 'how does removing MSVC and XCode create support for an arbitrary build system?' but I say 'If we could support any arbitrary build system with cmake why should we maintain the MSVC and XCode build systems manually?'
Geoff the Medio wrote:Requiring a user to download (even automatically) and build ~15 dependencies would make setting up and building FreeOrion dramatically more difficult than using an SDK. All my issues with expecting (Windows and OSX) users to navigate CMake are multiplied.
How does any automatic way of doing something increase difficulty? Also what issues are you talking about?
Geoff the Medio wrote:And for creating such a build system, setting up all the build / download rules for all the dependencies seems ridiculously complicated and failure prone, particularly since many don't have CMake build rules, so you'd have to set them up yourself, and then maintain them, and some of the dependencies have their own dependencies. I'm not going to attempt to deal with all that, when making an SDK is substantially simpler for myself and for the person using it.
This 'ridiculously complicated' task needs to be done every time the SDK needs to be build. The difference is that the current way isn't documented and done in a 'hit it with a hammer until it works' fashion. Setting up build rules however documents what exact dependencies are required and the way how to build the dependencies properly to work with the project.
Geoff the Medio wrote:That said, if you want to set all that up and can get it working reliably, it sounds potentially good for building on Linux (where using CMake is already unavoidable and I assume / require users know how to use it...).
I don't see why this should be needed. All Linux distributions have working package management systems; Windows and MacOSX don't.
Last edited by adrian_broher on Thu Sep 04, 2014 11:49 am, edited 1 time in total.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Programming Orion for newcommers

#20 Post by Geoff the Medio »

adrian_broher wrote:...I say 'If we could support any arbitrary build system with cmake why should we maintain the MSVC and XCode build systems manually?'
Because CMake is substantially more difficult to use than premade projects. (And annoying, in my opinion... I'm much happier to see a premade MSVC project I can open than when I have to figure out how to set one up from CMake stuff when building something.)
How does any automatic way of doing something increase difficulty?
Setting up the automated system is much more complicated, and the "automatic" way would still require using CMake instead of just opening ready-to-use projects.
Also what issues are you talking about?
I've discussed issues with CMake and the advantages of an SDK with prebuilt dependencies in previous posts. Not sure what else to add...
This 'ridiculously complicated' task needs to be done every time the SDK needs to be build.
Building the SDK is much less complicated than would be setting up an automated system to build all the equivalent binaries, and the SDKs are changed infrequently.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: Programming Orion for newcommers

#21 Post by Mitten.O »

You're not up to date then: http://www.kitware.com/media/html/Build ... ke2.8.html Add an external project cmake macro to your project which tells cmake how to build the dependency and it will do everything to reliable reproduce a build environment with fitting dependencies rendering the SDK useless.
I must say I'm impressed with cmake for that. Maybe you could use that to generate the sdk, giving the people outside sdk-land an easy way
to wire themselves up using cmake without making life harder for those inside? Not generating it manually does not force you not to make it available.
Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Programming Orion for newcommers

#22 Post by Geoff the Medio »

Mitten.O wrote:...use [CMake] to generate the sdk, giving the people outside sdk-land an easy way
to wire themselves up using cmake without making life harder for those inside?
If someone (else) gets it all set up, I'd give it a try.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Programming Orion for newcommers

#23 Post by Dilvish »

Well, as is so common, since I got distracted with other things while I was writing this there have been more posts that may make this one moot, but I think it may still have some bit of value, and so...

Adrian, in English we have a saying, "Don't fix what ain't broke." (Which is largely a reference to the risks of unexpected complications from tinkering with things.) Now, to you the SDK may seem broken, but to Geoff it doesn't seem that way, and he's familiar with it and so he's not particulary interested in 'fixing' it. You have a number of good points, including your understandable frustration in waiting on one or more library updates for the SDKs, but it seems the issue is still partially subject to personal preference and I don't think you really have a dispositive argument available.

If setting up the cmake system to automatically download/build all the required dependencies for an MSVC or Xcode project is within the scope of your knowledge and interest, it looks to me like Geoff has invited you to set it up (fairly clearly so after his last post). If it is as easy to use as you believe, then its existence will be far more persuasive than any arguments by themselves, and manual maintenance of an SDK would likely come to seem pointless.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Programming Orion for newcommers

#24 Post by Geoff the Medio »

Dilvish wrote:...manual maintenance of an SDK would likely come to seem pointless.
Indeed, automatically generating the SDKs would be nice once it's working, and once generated, they could still be uploaded for users who want to avoid CMake as can be done now, as Mitten.O suggests.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Programming Orion for newcommers

#25 Post by adrian_broher »

Dilvish wrote:Adrian, in English we have a saying, "Don't fix what ain't broke." (Which is largely a reference to the risks of unexpected complications from tinkering with things.) Now, to you the SDK may seem broken, but to Geoff it doesn't seem that way, and he's familiar with it and so he's not particulary interested in 'fixing' it. You have a number of good points, including your understandable frustration in waiting on one or more library updates for the SDKs, but it seems the issue is still partially subject to personal preference and I don't think you really have a dispositive argument available.
You're right with your saying and the whole disagreement is mainly about the personal different weighting between improvements and drawbacks/potential issues of both approaches to handle the issue of 'how to provide dependencies to contributors?'.
Dilvish wrote:If setting up the cmake system to automatically download/build all the required dependencies for an MSVC or Xcode project is within the scope of your knowledge and interest, it looks to me like Geoff has invited you to set it up (fairly clearly so after his last post). If it is as easy to use as you believe, then its existence will be far more persuasive than any arguments by themselves, and manual maintenance of an SDK would likely come to seem pointless.
That's where the point where I am back on level one: I would need an fixed SDK for this to create proper build files that work with the SDK and after that I would incremental replace the required SDK dependencies to build the project even if the result is a (now automatic generated) SDK. I promoted this change quite a while ago but till now it didn't happen yet [1]. I know Vezzra does a lot for the project and certainly has some other hobbies and life in general beside FreeOrion so this won't be fixed soon.

[1] viewtopic.php?f=9&t=8532
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Programming Orion for newcommers

#26 Post by Geoff the Medio »

adrian_broher wrote:I promoted [SDK updates] quite a while ago but till now it didn't happen yet [1]. I know ... this won't be fixed soon.
[1] viewtopic.php?f=9&t=8532
SDK updates are something I plan to do quite soon actually, and have briefly discussed doing with Vezzra. It's needed for potential SDL replacement of Ogre3D, and to update boost to a version that includes Boost.Log that might replace log4cpp. And as I wrote a few times above, the layout can be changed as you've requested.

Post Reply