Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-11-18 03:39:20


Hello,
I have a proposal for a small V2 semantics cleanup. Currently, we use
project-root.jam file to indicate the project root. That's OK, but the
problem is that rules for project-root.jam and Jamfile are different, which
is potentially confusing. I propose to use the same sematics for
project-root.jam and Jamfile. Essentially, project-root.jam will become just
another allowed name of Jamfile, with a single additional tweak: we won't try
to load parents of project-root.jam.

Here's more detailed discussion.

== Motivation ==

Currently, the set of rules that can be used in Jamfile and project-root.jam
are different. Targets can be defined in Jamfile, but not in project-root.jam.
Constants can be defined in project-root.jam, but not in Jamfile. Top-level
directory of a project typically contain both project-root.jam and Jamfile.

It would be desirable to have only one kind of file, with single set of
allowed rules.

== Proposed user-visible changes ==

It will be possible to use the same rules in project-root.jam and Jamfile. In
particular, declaring targets in project-root.jam and using the 'constant'
rule in every Jamfile.

The rules and constants defined in any Jamfile will be available in every
child Jamfile.

If project-root.jam and Jamfile are in the same directory, both files will be
in the same module scope.

== Discussion ==

The primary reason for project-root.jam is to decide if a project is top-level
and should not inherit properties from any Jamfiles up in the directory
tree. We need to use special filename -- it's not possible to use some "I'm
top-level" call in Jamfile, because we need to load parent Jamfile before
loading this Jamfile, to make constants visible.

It's quite possible to use project-root.jam just as different name of
Jamfile. When trying to load project, we look both for Jamfile and for
project-root.jam. If we found Jamfile, we first lookup/load parent project and
then load Jamfile. If we found project-root.jam, we just load it, without
looking up the parent. The loading process for Jamfile and project-root.jam
will be exactly the same, and the set of rule which can be used in Jamfile and
project-root.jam will be the same.

For backward compatibility, if a directory contains both project-root.jam and
Jamfile, we'll load both.

Opinions?

- Volodya

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk