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

Bill Deegan bill at baddogconsulting.com
Wed Jun 21 18:49:39 EDT 2017


Why do you need to do that?
(Perhaps there's another way to do what you want)
-Bill

On Wed, Jun 21, 2017 at 2:52 PM, Paweł Tomulik <ptomulik at meil.pw.edu.pl>
wrote:

> W dniu 31.05.2017 o 05:20, Zarko Berberski (Aditi Staffing LLC) via
> Scons-users pisze:
> > 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?
> >
>
> I remember, I was struggling with similar problems in one of my tools.
> Maybe looking through the following code will help?
>
> https://github.com/ptomulik/scons-tool-gnuplot/blob/
> master/gnuplot/__init__.py
>
> Just look for _GplotRelTo (how it's implemented and used).
>
> Regards!
>
>
> --
> Pawel Tomulik
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170621/c73b4bfa/attachment.html>


More information about the Scons-users mailing list