[Scons-users] untar builder fails with error

Bill Deegan bill at baddogconsulting.com
Mon Nov 7 16:01:23 EST 2022


creating a python virtualenv isn't possible for you?
(I feel like I've asked you this before?)

On Sat, Nov 5, 2022 at 3:29 AM daggs <daggs at gmx.com> wrote:

> Greetings Bill,
>
> unfortunatly no, I'm bounded to distros with scons 3.1.2
>
> what strikes me strange is that the unpack works, the issue is with the
> emitter alone
>
> Dagg
>
> *Sent:* Friday, November 04, 2022 at 6:26 PM
> *From:* "Bill Deegan" <bill at baddogconsulting.com>
> *To:* "SCons users mailing list" <scons-users at scons.org>
> *Subject:* Re: [Scons-users] untar builder fails with error
> Dagg,
>
> Can you try with SCons 4.4.0?
>
> -Bill
>
> On Fri, Nov 4, 2022 at 10:42 AM Mats Wichmann <mats at wichmann.us> wrote:
>
>> On 11/4/22 08:33, daggs wrote:
>> > Greetings,
>> >
>> > I"m trying to implement the untar builder from
>> https://github.com/SCons/scons/wiki/UnTarBuilder on scons
>> v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691 (ubuntu 20.04)
>> > and I'm getting this error:
>> > AttributeError: 'TarInfo' object has no attribute 'target_peers':
>> >    File "/home/dagg/project/site_scons/build_utils.py", line 471:
>> >      env.Unpack(get_target(), deps_targets_list,
>> >    File "/usr/lib/scons/SCons/Environment.py", line 255:
>> >      return MethodWrapper.__call__(self, target, source, *args, **kw)
>> >    File "/usr/lib/scons/SCons/Environment.py", line 219:
>> >      return self.method(*nargs, **kwargs)
>> >    File "/usr/lib/scons/SCons/Builder.py", line 651:
>> >      return self._execute(env, target, source, OverrideWarner(kw), ekw)
>> >    File "/usr/lib/scons/SCons/Builder.py", line 570:
>> >      t.target_peers = tlist
>> > Compilation failed
>> >
>> > has anyone encountered this issue? I cannot seem to be able to find
>> target_peers in reference to python anywhere
>> >
>> > the builder looks like this:
>> > import tarfile, os
>> >
>> > def message(target, source, env):
>> >      return "Unpacking..."
>> >
>> > def builder(target, source, env):
>> >      tar_file = tarfile.open(env['path'])
>> >      tar_file.extractall(env['target'])
>> >      tar_file.close()
>> >
>> >      return None
>> >
>> > def content_emitter(target, source, env):
>> >      fn = os.path.basename(str(source[0]))
>> >      print("Reading content...")
>> >      tar_file = tarfile.open(str(source[0]), "r")
>> >      new_targets = [ ent for ent in tar_file.getmembers() if
>> ent.isfile() ]
>> >      tar_file.close()
>> >      print("Done")
>> >
>> >      return (new_targets, source)
>> >
>> > def generate(env, **kwargs):
>> >      unpacker = env.Builder(
>> >          action = env.Action(builder, message),
>> >          src_suffix = ".tar.bz2",
>> >          emitter = content_emitter,
>> >      )
>> >
>> >      env.Append(BUILDERS = { 'Unpack' : unpacker })
>> >
>> > def exists(env):
>> >      return True
>> >
>> > Thanks,
>> >
>> > dagg
>>
>> I've used (a fork of) that one, but it's not been for like six years.
>>
>> Current scons certainly has a target_peers in the node class, and it's
>> actively used by the ninja tool. Ninja support, of course, is much newer
>> than SCons 3.1.2 - can't really tell the history without more
>> prospecting, maybe someone else knows.
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
> _______________________________________________ Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
> _______________________________________________
> 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/20221107/bfbc71f1/attachment-0001.htm>


More information about the Scons-users mailing list