Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scons, add Travis, qmake build and tests, fix #2 #6

Closed
wants to merge 19 commits into from

Conversation

richelbilderbeek
Copy link

Hi Globulation 2 maintainers,

As per this Issue I submit this Pull Request.

Changes:

  • scons now uses makeVariable and Variable instead of the deprecated makeOptions and Options
  • This is checked by a Travis CI script: upon a commit, the build process is started on a virtual machine, so one can see if a commit breaks a build
  • The build is also re-done by a Qt Creator project file, src/globulation2.pro
  • The build is also re-done by a Qt Creator project file, src/globulation2_test.pro that runs the cpptests in the test folder. Although these tests seem rather trivial, my new addition may upon up the path to write more tests in the future

I volunteer to maintain the .travis.yml and .pro(and .pri) files.

Enjoy 馃憤

@richelbilderbeek
Copy link
Author

I've also added a Build badge in README.md.

The GitHub user with the name Globulation2 does need to activate Travis CI here (you can log in from GitHub), as it is not activated yet.

Copy link
Contributor

@stephanemagnenat stephanemagnenat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions!

Your PR currently has a lot of commits, some of them fixing things of previous commits, would it be ok for you to rebase them into a small sets of commits (e.g. one that fixes scons, one that adds Travis, one that adds Qt build, etc.)?

scripts/update Outdated
#

cd glob2
hg pull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why hg, as we transitioned to git?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, It's an old update script ...

I suggest to even delete the script: I used it to sync my repo (https://github.com/richelbilderbeek/globulation2) to use a newer version of this repo. As the code I submitted is part of the repo it works on, this script is obsolete.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, can you do the deletion, so that I do not delete the wrong thing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 馃憤

@@ -0,0 +1,10 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we somehow name this script in relation with the type of system it installs deps on, such as install_deb_deps?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the reasoning. Go ahead and rename, you're the boss here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, I'll rename 馃憤

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename it please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 馃憤

@stephanemagnenat
Copy link
Contributor

I am curious, what is the rationale for the qmake-based build parallel to the scons one?

@richelbilderbeek
Copy link
Author

I am curious, what is the rationale for the qmake-based build parallel to the scons one?

To show that a scons and qmake build are equally fine.

@richelbilderbeek
Copy link
Author

Your PR currently has a lot of commits, some of them fixing things of previous commits, would it be ok for you to rebase them into a small sets of commits (e.g. one that fixes scons, one that adds Travis, one that adds Qt build, etc.)?

I would be open to do so, but I have no experience with rebasing (I feel it's not worth it). Due to this, I'd worry I'd mess up things.

If you'd insist, I can just redo all the steps by hand (of course, I prefer to leave things as they are). If so, let me know, and I'll do 馃憤

Thanks for your review!

@stephanemagnenat
Copy link
Contributor

I can do the rebase if you want. Note that it is actually not that spooky, there are a lot of introductions online.

That's great if you maintain the travis and the pro files.

@@ -29,6 +29,10 @@
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/XmlOutputter.h>

//Globulation2 has one global
#include "GlobalContainer.h"
GlobalContainer *globalContainer = new GlobalContainer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to create the GlobalContainer here? To see whether it fails? A comment would be helpful!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It resolves an unresolved external error.

I felt a comment like // make it link a bit unhelpful. The comment I did write was a left-over from // Globulation2 has one global :-( (I prefer my locals), which I think is unhelpful as well. Go ahead and remove it 馃憤

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(of course, I'd be happy to remove it myself)

@richelbilderbeek
Copy link
Author

That's great if you maintain the travis and the pro files.

Just to re-iterate: I'll happily do so 馃憤

@stephanemagnenat
Copy link
Contributor

@randomvoids for me this PR looks ok, if it is ok for you I can rebase to cleanup its messy history and merge.

@kylelutze
Copy link
Contributor

I am curious, what is the rationale for the qmake-based build parallel to the scons one?

To show that a scons and qmake build are equally fine.

Is there a reason why we need both though? I would prefer to not have to maintain 2 build systems if we can avoid it. Is qmake better than scons or ?

@richelbilderbeek
Copy link
Author

@randomvoids:

Is there a reason why we need both though? I would prefer to not have to maintain 2 build systems if we can avoid it. Is qmake better than scons or ?

AFAICS, qmake is just as fine as scons. I used qmake because I am comfortable with it (unlike scons). Thanks to qmake, I could also setup a qmake project to run the tests in the tests folder (something the scons build does not (?) do). Additionally, I can open up the project in my favorite IDE called Qt Creator.

I can imagine the writer of the scons setup prefers scons and volunteers to maintain it, like I would enjoy maintaining the qmake project files.

There are some options that may be considered (and I volunteer to implement each any decision):

  • I can setup the Travis CI file to either scons or qmake depending on the branch name.
  • Or perhaps more fun: I can setup the Travis CI file to use two compilers (GCC and clang) and use scons for the first and qmake for the second compiler.

&TLDR; both are equally fine, I am just more comfortable with qmake

@stephanemagnenat
Copy link
Contributor

stephanemagnenat commented Dec 30, 2019

A "problem" with qmake is that it adds a dependency on Qt, which feels a bit wrong just to use its build system. If it is in addition to scons, why not, if it is the main one, I would be careful before changing.

As I said on the ml, I am worried about remorking the build system without a need as that is bikeshedding and there are more important issues to tackle to let the project progress. Changing the build system would also imply redoing documentation, which currently exists in several languages, so getting to where we are now is a lot of work, for no clear added benefits. I am not against having another build system on the side (maybe in a branch?) if it helps people, or switching if there is a good rationale for, but otherwise, I am not fully convinced to switch. Also, switching the build system pushes work on distro packagers which might reduce Glob2's visibility for a while if we switch.

@richelbilderbeek
Copy link
Author

[...] qmake is that it adds a dependency on Qt, which feels a bit wrong just to use its build system. If it is in addition to scons, why not.

Cool!

You may overlook some benefits though:

  • Adding a Qt Creator project file (those .pro files) allows people to use the Qt Creator IDE to develop on Globulation 2
  • As I am comfortable with qmake, there will be more Pull Requests filled with goodies. For example, adding cppcheck to the Travis build. Note that @randomvoids already made an Issue due to an error spotted by cppcheck.

Again: I agree to keep scons the primary build system and I do volunteer to maintain the Travis and .pro/.pri files.

@richelbilderbeek
Copy link
Author

@stephanemagnenat: how is the rebase going?

@stephanemagnenat
Copy link
Contributor

stephanemagnenat commented Jan 3, 2020

I split this PR into two, the SCons fix is in master, the rest in that branch.

While doing it, I encountered several questions:

  • What is the purpose of the scripts you added, as if I'm not mistaken they are not used?
  • There seems to be duplications, for example cppunit is built by autoconf both in .travis.yml and in scripts/install_cppunit, but also by Qt in src/cppunit.pri, I do not understand why. They make the whole system hard to understand because one does not know what is necessary or not.

I would like to address these questions before merging the rest of the PR, because otherwise we import hard-to-maintain stuff that would confuse people entering the project, as they confuse me.

@richelbilderbeek
Copy link
Author

richelbilderbeek commented Jan 8, 2020

What is the purpose of the scripts you added, as if I'm not mistaken they are not used?

  • check_dead_links: checks for dead links within a repo
  • install_cppunit: installs CppUnit
  • install_deb_deps: installs the dependencies (the Debian packages, that is)

There seems to be duplications, for example cppunit is built by autoconf both in .travis.yml and in scripts/install_cppunit

This is a temporary duplication: I supplied a stand-alone .travis.yml file. I naively thought that that would give me the path of least resistance getting my Pull Request accepted. Ideally, all three scripts are called from the .travis.yml file, which will help shorten it.

There seems to be duplications, for example cppunit is built [...] in .travis.yml [...], but also by Qt in src/cppunit.pri

Here, there is no duplication: install_cppunit installs CppUnit, cppunit.pri adds the files to the C+ project.

@richelbilderbeek
Copy link
Author

@stephanemagnenat: what is the status of this PR?

1 similar comment
@richelbilderbeek
Copy link
Author

@stephanemagnenat: what is the status of this PR?

@stephanemagnenat
Copy link
Contributor

stephanemagnenat commented Feb 22, 2020

I think it is up to the maintainer (which is not me) to take the decision on whether to accept an additional build system. I did apply the part fixing Scons in 51ebae2.

@richelbilderbeek
Copy link
Author

I'll take my loss then, submitting a Pull Request usually is a more fun experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants