Boost logo

Boost-Build :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-05-03 07:33:05


----- Original Message -----
From: "Vladimir Prus" <ghost_at_[hidden]>

> They should not keep track of anything. There's one function which
operates
> on native path names: os.path.make. All the other require normalized
paths.

Yes, but there are places where native paths are needed as output
(LOCATE, actions, include, etc.) and accepted as input (Jamfiles,
command-line, etc.), so programmers have to convert back and forth,
which, as shown by the bugs I uncovered in project.jam, is error-prone.
I don't see how you can argue with this: you yourself provided
os.path.make and os.path.native. You wouldn't have done so if they
weren't needed.

> I believe this is right -- the whole purpose of os.path is to get away
from
> paths that can have a dozen different spellings. For example:
>
> path1 = foo ;
> path2 = ../bar ;
>
> $(path1:D) gives empty string

This one is nasty

> $(path2:R=/home/ghost) gives /home/ghost/../bar

What's wrong with that? AFAICT that's the expected result.

The easy solution for this (which is how I envisioned os.path when I
started it) is to eschew the obscure :D :R, etc. syntax and use rules
defined in os.path such as root_relative_path. If os.path always gives
back valid native paths, there is no problem and its users don't have to
think about whether a path is normalized or not.

-Dave

 


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