As it was written before the rule had 'random' behavior in some borderline cases such as: not passing it a parameter, passing it a folder whose path starts with one or two backslashes (as opposed to slashes) or passing it an invalid rooted path with enough '..' path elements to take it 'before the root path'. In those cases it would cause an access violation, 'incorrectly' un-root the path (i.e. remove the leading slash) or simply remove a 'random' path modification respectively. Also the rule is now more tiny bit more efficient and much better documented.
Invalid rooted paths with enough '..' path elements to take them 'before the root path' are now recognized and an empty list is returned.
Due to this rule having such 'messy' behavior the path.join rule and its user make-NT rule had some twisted logic in them to work around all the problems this caused. This patch invalidates the logic in question and replaces it with a much simpler one (detailed comments added).
Other NORMALIZE_PATH callers should not be affected since both the old and the new version work the same on 'regular' paths (i.e. those not mentioned above).
The new functionality for recognizing Boost Jam versions has been used to make Boost Build scripts use the old path functionality when using Boost Jam older than 3.1.17 and use the new functionality otherwise. As consequence, now anyone using the trunk version of Boost Build and an older 3.1.17 version of Boost.Jam will need to recompile their Boost Jam executable.
The patch does not cause any Boost Build or Boost Jam tests to fail.
Added a related NORMALIZE_PATH Boost Jam test. Note that this test causes Boost Jam versions built prior to this patch to crash (access violation).
Added additional internal Boost Build tests for the path.jam module testing how it handles some invalid Windows paths.
[SVN r45158]
* bjam; bump to version 3.1.12
* bjam; make it possible to build in MinGW/MSYS shell
* bjam; move profile code to debug.h/c to make it available for use everywhere
* bjam; cache all filesystem query operations, Unix and Windows only, include PWD and scanning
* bjam; add memory profile info, and sprinkle throught code
* bbv2; rewrite some while() loops into for() loops to reduce time and memory
* bbv2; keep a single instance counter instead of one per type to reduce memory use
* bjam+bbv2; change NORMALIZE_PATH builtin to join path parts to reduce memory use
[SVN r31177]
That was an old hack which was only needed in one context -- when we
passed both Jamroot and jamroot as patterns, got back Jamroot and jamroot
(because windows is case-insensitive and reports that both exist), and get
confused.
Calling 'unique' does not harm in most cases, but in Boost Jamfiles we glob
for all headers, and O(n^2) algorithm used by unique considerably slows us.
[SVN r29187]
The problem with the previous implementation is that it would iterate
over all elements in a dir even if 'pattern' had no metacharacters. First,
that was slow -- if you handed
/cygdrive/w/My Documents/boost/test/a.cpp
to it, it would crawl all the way to the top, listing each directory and
checking each file. Second, it would fail, because Cygwin is broken and
does not show 'cygdrive' is the list of directory elements of '/'.
Now we check if a pattern has metacharacters, and if not, just do
a simple 'timestamp' call.
The new glob is implemented as new 'GLOB-RECURSIVELY' builtin. I've decided
to use builtin since otherwise, we'd need 'does this name exist' builtin,
and if we need new builtin, why don't implement all globbing in core.
[SVN r29163]
It was completely broken with absolute windows paths because /cygdrive
is valid cygwin path, but 'cygdrive' is not shown when listing the '/'
directory.
[SVN r28508]
metacharacters, Boost.Build misbehaved.
* new/path.jam
(all-parents): Don't use regex to strip path prefix, use a more robust
approach.
* test/bad_dirname.py: New test.
[SVN r18576]
Consequently rolled back the workaround in make_rule.py
* Added new indirect rule invocation module for encoding the module to
invoke a rule from as well as the exact name to invoke it by, and
for subsequent invocation.
* Fixed module __test__ rules so they really do execute in a separate
module. Associated tweaks to __test__ in path.jam
[SVN r18427]
* new/path.jam
(make-NT, make-UNIX): Convert empty path into "."
* new/project.jam
(path-relative-to-project-location): New rule.
* new/stage.jam
(stage-target-class.construct): Use the above rule.
* new/symlink.jam
(symlink-targets.construct): Call 'set-path' on created
virtual targets.
(ln): Attempts at better handling creating symlinks in
directories.
* new/virtual-target.jam
(abstract-file-target.actual-name): If explicit path was
given, include it in grist.
* test/symlink.py: New test.
* test/test_all.py
Run new test.
[SVN r16889]
attribute which controls where generated targets are put,
much in the same was as ALL_LOCATE_TARGET.
* new/virtual-target.jam
(virtual-target.path): Respect build dir.
(virtual-target.actualize-location): Don't
compute path, but call call instead.
* new/project.jam
(initialize): Set default value for 'build-dir'.
(project-attributes.set): Handle 'build-dir'.
* new/path.jam
(relative): New rule.
* test/build_dir.py: New test.
[SVN r16589]
* new/path.jam (make-UNIX, make-NT): Call 'path.join' on elements,
so that paths are normilazed.
(join): Allow one element to be passed.
* new/project-root.jam: Use 'path.root' when declaring path constants.
[SVN r16096]