Opened 15 years ago

Last modified 15 years ago

#217 new defect

Can't pass rooted paths as feature value through indirect conditional

Reported by: r.johan.nilsson@… Owned by: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

Description

[copy from mailing list posting]

I'm working on a rule for using prebuilt libraries (not only boost libraries) and have hit upon something. I'm using features to pass the "base" name and the containing directory of the library to a conditional, which generates the needed "<file>" property.

This seems to mostly work fine as long as I'm using relative paths for my feature, but when using an absolute path the feature "disappears" and is not passed along to the conditional rule. Please see attached Jamroot for a demo.

Another thing is that I need to declare the feature as "incidental" in order to have it passed, even when using relative paths. Why is this?

Results from a couple of runs with the sample Jamroot below.


C:\users\jni\scratch\tests\boost.build\conditional>bjam CONFIG: Using incidental in feature definition CONFIG: Using path: sub/dir ...found 2 targets...

C:\users\jni\scratch\tests\boost.build\conditional>bjam --no-incidental CONFIG: Not using incidental in feature definition CONFIG: Using path: sub/dir Jamroot:37: in Jamfile</C:/users/jni/scratch/tests/boost.build/conditional>.bar from module Jamfile</C:/users/jni/scratch/tests/boos error: ERROR: bar-path is REALLY needed!!! C:/users/jni/prj/dedsdk/deps/src/bbv2/kernel\modules.jam:66: in modules.call-in from module Jamfile</C:/users/jni/scratch/tests/boos [ ... snip ... ] C:\users\jni\prj\dedsdk\deps\src\bbv2\boost-build.jam:8: in module scope from module

C:\users\jni\scratch\tests\boost.build\conditional>bjam --path=.\ CONFIG: Using incidental in feature definition CONFIG: Using path: .\ ...found 2 targets...

C:\users\jni\scratch\tests\boost.build\conditional>bjam --path=C:\ CONFIG: Using incidental in feature definition CONFIG: Using path: C:\ Jamroot:37: in Jamfile</C:/users/jni/scratch/tests/boost.build/conditional>.bar from module Jamfile</C:/users/jni/scratch/tests/boos error: ERROR: bar-path is REALLY needed!!! C:/users/jni/prj/dedsdk/deps/src/bbv2/kernel\modules.jam:66: in modules.call-in from module Jamfile</C:/users/jni/scratch/tests/boos [ ... snip ... ] C:\users\jni\prj\dedsdk\deps\src\bbv2\boost-build.jam:8: in module scope from module

Attachments (1)

Jamroot (865 bytes ) - added by r.johan.nilsson@… 15 years ago.
Sample Jamroot for issue (referenced in ticket)

Download all attachments as: .zip

Change History (2)

by r.johan.nilsson@…, 15 years ago

Attachment: Jamroot added

Sample Jamroot for issue (referenced in ticket)

comment:1 by r.johan.nilsson@…, 15 years ago

[Copy of mailing list follow-up]

Johan Nilsson wrote:

Hi,

I'm working on a rule for using prebuilt libraries (not only boost libraries) and have hit upon something. I'm using features to pass the "base" name and the containing directory of the library to a conditional, which generates the needed "<file>" property.

This seems to mostly work fine as long as I'm using relative paths for my feature, but when using an absolute path the feature "disappears" and is not passed along to the conditional rule. Please see attached Jamroot for a demo.

I've been doing some further investigation, and it seems like the "absolute-/rootedness" itself of the path is not the culprit here. The problem seems to be the colon (":") in the rooted path under Windows.

I've managed to workaround this by encoding the colons in paths before passing them to the conditional (as values of my custom features). I can then decode the path in the conditional and work out the exact path for the dependency and then return e.g. "<file>/C:/path/to/my/prebuilt-lib-with-tags" from the conditional. Interestingly enough, it is no problem to return the absolute paths from the conditional - that works just fine.

I'd say that this is probably a bug somewhere in the handling of indirect conditionals.

Another thing is that I need to declare the feature as "incidental" in order to have it passed, even when using relative paths. Why is this?

Still wondering.

Note: See TracTickets for help on using tickets.