[Scons-users] [Scons-dev] Question regarding variant_dirs and custom builders
Bill Deegan
bill at baddogconsulting.com
Fri Jul 17 10:41:01 EDT 2020
This email belongs in scons-user, please respond there.
How are you using Variant dirs, via VariantDir() or via SConscript()'s
variant_dir?
Are you using duplicate=0 or duplicate=1
Please share whatever code you have so far.
In general the build shouldn't have to do anything at all.
It should be presented with the proper source files and targets, that it's
in a variant dir should be invisible.
On Fri, Jul 17, 2020 at 2:56 AM Bastian Reitemeier <lists at brtmr.de> wrote:
> Hi,
>
> I am trying to make a custom builder (with a custom emitter) that plays
> well when building in a variant_dir.
> I am having trouble understanding how a custom emitter deals with variant
> paths (or if it has to deal with it).
> Here is what I am trying to do: I have a source dir, and a separate
> variant_dir for building in.
> Let’s call them src/ and build/. I want to make a custom builder that
> given a source tarball at a path in src (lets say src/a/b/c.tar) extracts
> the archive to the same relative path in the variant_dir (build/a/b/).
> Currently I am simply using the tarfile.extractall standard library
> function.
> My questions are now:
> How do I make my builder “aware” of the variant dir? That is, how do I
> construct the path within the variant_dir to pass to extract_all(path=...)?
> How do the built-in Builders deal with this?
> When emitting the contents of the tarball as new_targets, what paths do I
> have to emit (relative to src. relative to build, absolute paths)?
> I managed to get a solution that extracts to the correct path (by
> (ab-)using the alter_targets method), but fails at deciding if the tarball
> needs re-extracting. Instead it just re-extracts it every time.
> Does the answer to these questions change when the variant dir is
> duplicate=0?
>
> Best Regards,
> Bastian
> _______________________________________________
> Scons-dev mailing list
> Scons-dev at scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200717/be0eb371/attachment.html>
More information about the Scons-users
mailing list