Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


TheComet

Member Since 02 Oct 2013
Offline Last Active Today, 04:34 PM

Topics I've Started

Buildbot - "no changes detected"

Today, 04:37 AM

I'm using Buildbot for integration testing and deployment for my project and I'm having trouble with a specific case.

 

I've configured it to run all unit tests when pushing to branch "devel", and I've configured it to cross compile and deploy to all platforms when pushing to branch "master".

 

Here's an excerpt from my config file:

# schedulers for push events to devel and master branches
c['schedulers'].append(basic.SingleBranchScheduler(name="checkin-devel",
        change_filter=filter.ChangeFilter(branch="devel"),
        treeStableTimer=2,
        builderNames=["test-gameserver", "test-applebloom"]))


c['schedulers'].append(basic.SingleBranchScheduler(name="checkin-master",
        change_filter=filter.ChangeFilter(branch="master"),
        treeStableTimer=2,
        builderNames=["deploy-gameserver", "deploy-applebloom"]))






# when pushing to master, checkout, cross compile for all platforms, test, and upload to /www/game/lightship
# gameserver ###################
factory = util.BuildFactory()
factory.addStep(step_checkout_master)
factory.addStep(step_test_build_linux)
factory.addStep(step_test_linux)
factory.addStep(step_compile_x86_64_linux)
factory.addStep(step_cross_x86_64_windows)
factory.addStep(step_cross_i686_windows)
factory.addStep(step_upload_dist)
factory.addStep(step_clean_dist)
c['builders'].append(util.BuilderConfig(
        name="deploy-gameserver",
        slavenames=["slave-lightship-gameserver"],
        factory=factory))
# applebloom ###################
factory = util.BuildFactory()
factory.addStep(step_checkout_master)
factory.addStep(step_test_build_macosx)
factory.addStep(step_test_macosx)
factory.addStep(step_compile_x86_64_macosx)
factory.addStep(step_upload_dist)
factory.addStep(step_clean_dist)
c['builders'].append(util.BuilderConfig(
        name="deploy-applebloom",
        slavenames=["slave-lightship-applebloom"],
        factory=factory))


# when pushing to devel, checkout and test
# gameserver ###################
factory = util.BuildFactory()
factory.addStep(step_checkout_devel)
factory.addStep(step_test_build_linux)
factory.addStep(step_test_linux)
c['builders'].append(util.BuilderConfig(
        name="test-gameserver",
        slavenames=["slave-lightship-gameserver"],
        factory=factory))
# applebloom ###################
factory = util.BuildFactory()
factory.addStep(step_checkout_devel)
factory.addStep(step_test_build_macosx)
factory.addStep(step_test_macosx)
c['builders'].append(util.BuilderConfig(
        name="test-applebloom",
        slavenames=["slave-lightship-applebloom"],
        factory=factory))

The problem occurs when merging branch "devel" into "master" and pushing master. Because the HEAD of both branches have the same commit hash at this point, Buildbot decides to not build master even though I want it to. Here's the log file for this exact case:

2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] X-GitHub-Event: 'push'
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] Commit `7ce18ba601b0ee69973a64b73e25bcf5fe8ff0c6` is a non-distinct commit, ignoring...
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] Commit `3db1b8da4997c9cf1389acfe394b73d3ddc21072` is a non-distinct commit, ignoring...
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] Commit `af4ddab0b4db92ca3b40bc4a0df7ea7598ae490b` is a non-distinct commit, ignoring...
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] Received 0 changes from github
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] Got the following changes []
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] Payload: {}
2015-06-01 12:40:34+0200 [HTTPChannel,0,127.0.0.1] No changes found

 

How can I force Buildbot to build every push that goes to master?


Doge Indirection

19 March 2015 - 12:42 PM

Hackers have been around for too long, usually associated with dark themes and “the evil side” they represent the minority of IT Gurus that just have too much time on their hands, and a touch of evilness. Usually represented with a skull or “horrifically” they are iconic in a never ending battle against internet crime.
For this reason, I encourage all of us to start utilising the technique of indirection for storing all primitive datatypes in our programs. Not only will this make it impossible for hackers to track our variables, it will also allow us programmers to taste the sweet taste of having stopped said hackers with a doge meme.
#include <iostream>


template <class T, int N>
struct Indirection
{
    typedef typename Indirection<T, N-1>::type* type;
    typedef typename Indirection<T, N-1>::type  child_type;
    
    static void init(type& p)
    {
        p = new child_type;
        Indirection<T, N-1>::init(*p);
    }
    
    static void cleanup(type& p)
    {
        Indirection<T, N-1>::cleanup(*p);
        delete p;
    }
};


template <class T>
struct Indirection<T, 0>
{
    typedef T type;
    
    static void init(type& p) {}
    static void cleanup(type& p) {}
};


int main()
{

    /* there happen to be 272 stars in the doge below */
    Indirection<int, 272>::type cpu_cache_will_enjoy_this;
    Indirection<int, 272>::init(cpu_cache_will_enjoy_this);
    
    /*
     * set the value of our variable using the power of the shibe
     */


         *              *    
        * *           ** *     *         *     ****     *         *
        *  *        **   *     *         *   *      *   *         *
       ***  ********     *      *       *   *        *   *       *
     ***           *  ** *      *   *   *   *        *   *   *   *
   **               **** *       * * * *     *      *     * * * *
  *   **              **  *       *   *        ****        *   *
  *  ***     ****       * *  
 *           ****        *** 
 *  ****                   * 
* ******** *               * 
*  ****  ** *               *          **              *
*   ****   *               *          *                *
 *      ***                *           **   *  *   **  * **
 *                     *  *              *  *  *  *    **  *
  **                 *    *            **    **    **  *   *
    **          ****    **   
      **********     ***                     *            *  *                *   *
                   **                                     *                  ***
                                             *  * **   ** *  *  ***  **   **  *   *   **   * **
                                             *  *   * *  **  *  *   * ** *    *   *  *  *  *   *
                                             *  *   *  ** *  *  *    **   **   *  *   **   *   *


    cpu_cache_will_enjoy_this = 20;
    
    /*
     * now output the value to stdout
     */
    
    std::cout << " the value is: " << ****************************************** // make absolutely sure not to go over the 80 character per line limit, as to not enrage The Powers That Be (Linus Torvalds) in the mailing list
    ****************************************************************************
    ****************************************************************************
    ********************* ******************************************************
    ***cpu_cache_will_enjoy_this << std::endl;
    
    /*
     * clean up like good programmers - no memory leaks, check it with valgraind
     * if you don't believe
     */
    
    Indirection<int, 272>::cleanup(cpu_cache_will_enjoy_this);
    
    return 0;
}
Granted, the error messages can become a little bit confusing, but all you have to do is write a batch script to parse the error output in order to understand how many stars you forgot:
 
/home/thecomet/documents/programming/test/main.cpp: In function ‘int main()’:
/home/thecomet/documents/programming/test/main.cpp:81:61: error: no matching function for call to ‘Indirection<int, 273>::cleanup(Indirection<int, 0>::type********************************************************************************************************************************************************************************************************************************************************************************&)’
     Indirection<int, 273>::cleanup(cpu_cache_will_enjoy_this);
                                                             ^
/home/thecomet/documents/programming/test/main.cpp:81:61: note: candidate is:
/home/thecomet/documents/programming/test/main.cpp:15:17: note: static void Indirection<T, N>::cleanup(typename Indirection<T, (N - 1)>::type*&) [with T = int; int N = 273; Indirection<T, N>::type = int*********************************************************************************************************************************************************************************************************************************************************************************; typename Indirection<T, (N - 1)>::type = int********************************************************************************************************************************************************************************************************************************************************************************]
     static void cleanup(type& p)
                 ^
/home/thecomet/documents/programming/test/main.cpp:15:17: note:   no known conversion for argument 1 from ‘Indirection<int, 272>::type {aka int********************************************************************************************************************************************************************************************************************************************************************************}’ to ‘Indirection<int, 0>::type*********************************************************************************************************************************************************************************************************************************************************************************& {aka int*********************************************************************************************************************************************************************************************************************************************************************************&}’
CMakeFiles/indirection.dir/build.make:54: recipe for target 'CMakeFiles/indirection.dir/main.cpp.o' failed

Best programming paradigm for noobs?

10 March 2015 - 04:53 PM

If a noob, who knows nothing about computer programming, wishes to embark on the painful journey of developing software, what is the best paradigm to start with and why? Procedural? OO? Functional?
 
 
I've been thinking about this lately because at college Java is the first thing to be taught and I noticed there to be a lot of confusion among the students. Those who have never been close to computer code are having an extremely hard time grasping the concepts. Those who have programmed before are having less of a hard time, but are still utterly confused (try explaining to them what the "this" keyword does, for instance).
 
I personally started out with BASIC when I was 14, and much much later I decided to learn about OO. I think it's a lot easier to learn a procedural language before learning OO.
 
What do you think?


dllimport/dllexport with multiple depending shared libs

18 February 2015 - 06:45 AM

Most people will tell you that every DLL will have to #include an export.h header file with something like the following in it:

#ifdef LIBRARY_BUILDING
#   define LIBRARY_API __declspec(dllexport)
#else
#   define LIBRARY_API __declspec(dllimport)
#endif
 
Then, when you build the library, simply globally define LIBRARY_BUILDING, and when you're linking against the library, don't define it.
 
My questions are: 
1) What happens when you have multiple DLLs that depend on each other and include each other's header files? Do I need to create two export.h header files, one for each DLL?
2) If one global export.h file is sufficient for all DLLs, can you please explain to me in the example below why the linker doesn't throw any errors or warnings?
 
Here's an example demonstrating what I mean:
 
foo.DLL

#ifdef FOO_BUILDING
#   define FOO_API __declspec(dllexport)
#else
#   define FOO_API __declspec(dllimport)
#endif


FOO_API some_function_foo(void);
 
bar.DLL

#ifdef BAR_BUILDING
#   define BAR_API __declspec(dllexport)
#else
#   define BAR_API __declspec(dllimport)
#endif


#include "foo.h"


/* this function calls some_function_foo() from foo.DLL */
BAR_API some_function_bar(void);
 
application

#include "bar.h"


int main()
{
    some_function_bar();
    return 0;
}
 
When this project gets built, the following occurs:
1) foo.DLL: FOO_BUILDING gets defined, which means all of foo's functions are declared with dllexport.
2) bar.DLL: BAR_BUILDING gets defined, but FOO_BUILDING isn't defined. This means all of foo's functions are declared with dllimport, and all of bar's functions are declared with dllexport when bar includes foo's headers. I would assume this is the intended behaviour.
3) application: Neither FOO_BUILDING nor BAR_BUILDING is defined, therefore all of foo's and bar's functions are declared with dllimport.
 
If I had only one export.h header file, then step 2) would not be possible, because either everything gets declared with dllexport or everything gets declared with dllimport, ignoring the fact that one of the libraries is already built and the other one isn't. However, I'm not getting any link errors/warnings if I use only one global export.h header file, even though I expect them. Why?
 

Forum Broken?

10 February 2015 - 03:11 AM

Am I the only one who sees the forums like this?

http://i.imgur.com/ZE979Z5.jpg http://i.imgur.com/o82XDJr.jpg
http://i.imgur.com/LaqKKnT.jpg

It's been like this for the last 2 days for me. Every other website, every other forum, every other social platform, they all work for me. It's only GDNet that's doing this to me. Why?

Can someone explain this to me?

The homepage works, and browsing threads and boards works to some degree. By "some degree" I mean icons are missing, and weird stretching occurs, as can be seen here:

http://i.imgur.com/DRNtxPH.jpg

That last screenshot has always been the case for me, not only since the last 2 days. The forum has always stretched and missed icons like that.

$ uname -a
3.17.7-gentoo #1 SMP Sun Feb 1 05:45:15 CET 2015 x86_64 AMD Phenom™ II X6 1090T Processor AuthenticAMD GNU/Linux

$ eix google-chrome
[?] www-client/google-chrome
Available versions: ~40.0.2214.94_p1^msd {+plugins LINGUAS="+am +ar +bg +bn +ca +cs +da +de +el +en_GB +es +es_LA +et +fa +fi +fil +fr +gu +he +hi +hr +hu +id +it +ja +kn +ko +lt +lv +ml +mr +ms +nb +nl +pl +pt_BR +pt_PT +ro +ru +sk +sl +sr +sv +sw +ta +te +th +tr +uk +vi +zh_CN +zh_TW"}
Installed versions: 39.0.2171.95_p1^msd(18:24:17 19/12/14)(plugins LINGUAS="en_GB -am -ar -bg -bn -ca -cs -da -de -el -es -es_LA -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt_BR -pt_PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -vi -zh_CN -zh_TW")

PARTNERS