[Scons-users] Is there a way to ensure that actions have SConscript-relative paths ?

Zarko Berberski (Aditi Staffing LLC) v-zaberb at microsoft.com
Tue May 30 23:20:16 EDT 2017


Say a /foo/src/place_1/SConscript 

Registers env.Command('FStar_Parser_Parse.ml', File('parse.mly'), generate_fstar_parser_parse_ml)

The paths used for registration are SConscript-relative but when the action (meaning a Python function in this context) runs it "sees" SConstuct-relative path, say  /foo/src/.

Is there a systematic way keep such action (and transitively everything registered by a given SConscript) in the folder where that SConscript is?

I know that an action could do something like target[0].get_path() but then it has to parse which is error prone.

Would adding ... ,chdir=1) be the way to achieve that? Would the same hold for env.Builder ? Some other builders/pseudo-builders ? Some other command-arg that would be for SConscript-relativ path (if chdir=1 means target-relative path) ? 

Is there something like a list of additional args that are actually commands? Is there a way to pass additional key=val args that would reach the action at the time of its running?




More information about the Scons-users mailing list