Mark Gritter (markgritter) wrote,
Mark Gritter

Building in a Separate Tree

The software practice at Kealia (and, I hope, at the new company) is to perform builds in a separate directory structure from the source tree. This makes it fairly easy to have separate release and debug builds coexisting, try out different optimization options in parallel, or be really sure that you're doing a clean build. It also makes it a little easier to manage the source tree, although it is not hard to get svn and cvs to ignore the output binaries.

SCons (a python-based build tool) supports this but by default it copies source files over into the build tree and performs the compilation using the copy. The rationale in the manual is that some tools don't support anything but building in the same directory as the source file. (Is python the most common example of this? What else?)

I think this is completely backwards. The common case should be not to make a copy. Compilation errors will be reported with respect to the copy when they ought to refer to the original (because that's the one that needs to get fixed.) A similar issue occurs with debugging information, although that's not quite as inconvenient.

(Side note: some teams put all the build tools into the source repository as well to ensure everybody is using a toolchain that matches the source tree. I'm not a huge fan of this, although I can see the point... what do y'all think?)
Tags: programming, python, scons, software
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.