Building system enhancement

Bug #687864 reported by Yu Feng on 2009-07-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nicolas Joseph

Bug Description

What steps will reproduce the problem?
1. modify a small local portion of code in libvalide, eg, add a debug
message in a function)
2. ./waf build
3. all generated c code are rebuilt

What is the expected output?
only the relavent ccode are rebuilt.

I guess it is a problem with the waf valac support. donno a fix.

Nicolas Joseph (gege2061) wrote :

Yes, it's a problem with waf.

I will post on the mailing list for try to fix this problem.

Yu Feng (rainwoodman) wrote :

What about a migration to autotools? The techniques for building vala packages with
autotools is already mature and stable. valac is also using autotools, maybe we
should also take this into account.

If needed I can add the autotools building facilites in parallel with the current waf
support. Two building chains will add maintainance overheads for adding/refactoring
modules though.

Nicolas Joseph (gege2061) wrote :

Sorry, I hate the autotools...

I have never understood the M4 macro language. You can view the oldest build system
(with autotools) here:

Waf is more easy to understand and use.

Why you need the autotools?

Nicolas Joseph (gege2061) wrote :

I had forgotten this feature of waf: the cache

You can define a cache directory:
$ export WAFCACHE=/tmp/wafcache; mkdir $WAFCACHE

Reconfigure the project:
$ ./waf configure

Modified one file and rebuild the project (twice: the first, the cache doesn't work :/)

Yu Feng (rainwoodman) wrote :

I don't NEED autotools. Autotools worked for me. If waf (with cache) works then waf
is also cool.

BTW: your looks painful and full of struggling, like the old ones I was
writing. Using data in the source tree is not a good idea with autotools. :-)

Apparently with waf we also have to install the package to somewhere first. Did I get
it wrongly?

I always do this:
./waf configure --prefix=$PWD/_inst_
./waf install

Nicolas Joseph (gege2061) wrote :

> Apparently with waf we also have to install the package to somewhere first. Did I get
it wrongly?

> I always do this:
> ./waf configure --prefix=$PWD/_inst_
> ./waf install

I don't understand, what is your goal?

For prepare a package, you can use the desdir option (like DESTDIR with autotools:

./waf configure --prefix=/usr --desdir=$PWD/_inst_

Yu Feng (rainwoodman) wrote :

I don't want to test the installation, neither creating a package. I want to
run/debug valide without installing to a system-wide directory(which needs root

What is your dev environment setup?

Nicolas Joseph (gege2061) wrote :

Ok, to change the installation directory, it must use --prefix:

$ ./waf --prefix=$HOME/.applications

And define the environments variables:

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.applications/lib


$ export PATH=$PATH:$HOME/.applications/bin
$ export PKG_CONFIG_DIR=$PKG_CONFIG_DIR:$HOME/.applications/lib/pkgconfig

It would be interesting to create a debug variant:

Nicolas Joseph (gege2061) wrote :

The debug mode is added!

$ ./waf configure
$ ./waf --debug
$ ./waf install --debug

default compilation options:
  ccflags: -O2

debug compilation options:
  ccflags: -O0 -g3
  valaflags: -g

Yu Feng (rainwoodman) wrote :

What about a --maintainer-mode that by default set the prefix to $PWD/_maintainer_
(and perhaps also does more in the future?)

Nicolas Joseph (gege2061) wrote :

I don't know this mode. It's very simple to add an option.

What is the feature of this mode?

 * The default prefix is set to $PWD/_maintainer_
 * Active the debug mode?

How do you define LD_LIBRARY_PATH?

Yu Feng (rainwoodman) wrote :

Yes, plus the debug mode. I have a local script that sets the LD_LIBRARY_PATH and
invokes gdb. Maybe we can also produce a libtool-like script with waf for the
maintainer mode?

I tried to change the prefix for --maintainer but apparently there were some problems
with WAF. the headers and the vapi files are still installed to the default location
/usr/local. If I substitute(with conf.define) DATADIR(the internal one used by waf,
not DATA_DIR defined by us) there will be a misterious python exception, saying
cannot concat a str with a list or something alike.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers