[lang]

Present Perfect

Personal
Projects
Packages
Patches
Presents
Linux

Picture Gallery
Present Perfect

SCons = Pain

Filed under: General — Thomas @ 15:53

2006-06-11
15:53

Being the forward-looking person I am, I decided it was high time I learned some SCons. A big manual, lots of Wiki notes, not much could go wrong, right ?

Wrong.

The first thing I wanted to do was to write a simple SConstruct file that would basically do the equivalent of this Makefile:

fail:
          exit 1

Can't be hard, right ?

Wrong again.

The manual doesn't mention anywhere I could find how to run a simple shell command *that does not take or generate files*. The manual is full of examples that explain how to build a program from source files, libraries from source files, everything. The Wiki mentions some things about how to make unit tests run (which is what I wanted to do next, since it should just run a shell command for the unit tests), but they all rely on some source being there to be turned into a program.

I tried various approaches, like using the Builder class (but it gets really upset if you don't have sources or results), using the Execute action (but that always executes *while parsing*, no matter what I do, confusing), using the Command action (failing in various ways if you don't have sources), ...

I spent three hours trying various approaches and I could get nothing to work.

If there's someone out there with a little more SCons knowledge, please translate the above simple Makefile into an SConstruct script that should do the same ...

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

picture