Re: Value/Alias Nodes default to up-to-date
Bill Deegan <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CH+YLtTgZ_Oyr7eNp71NTj0ja2JS2X+GFyGf=VGDuP26A@mail.gmail.com> |
Still don't really understand what you're trying to do. What do you mean by this "allowing me to make Action()'s with dependency orderings"? On Sun, Jan 2, 2022 at 3:10 PM Brad Kraemer <[email protected]> wrote: > * Fixed subject line (the original line from the mailer daemon added JUNK, > as this one doesn't allow unconfirmed posters, i.e. I should have waited > for the mailing-list confirmation before sending the first e-mail off) > > > Currently, just experimenting with some SCons features. At this time I was > creating an Alias() because I wanted the Alias() object (which is > namespaced outside the regular FS namespace), allowing me to make > Action()'s with dependency orderings. While not having these actions kicked > off by running something like '$ scons /' (which something like Command() > would). > > > I realize this is outside the intended use of these functions. However, > the doc's don't forbid it so it's clean in my eyes. > > The Command() part is just for something to depend on (can replace it with > Program() or any other builder, my issue is with the Alias() lines). > > > Your reasoning makes sense, however, if my Alias is never out of date > (i.e. on creation it's meant to be considered already built), why can I run > AlwaysBuild() and thus force it to build (is this the equivalent of > rebuilding something already up-to-date)? > > Just looking at the sources, it seems these Node's are meant to be built > at least once (however, Value() in particular does seem to have a parameter > to be considered built on creation). Or am I off base with this? > > > On 2022-01-02 5:30 p.m., Bill Deegan wrote: > > Maybe you explain what you're trying to do, rather than how you're > currently trying to do it? > Because this looks like a mess of hard to understand code and there's very > likely a better way to do this. > > Those aliases would never be out of date with a static source. > Your command has no source listed, so it will also never be out of > date..(after the first time, if the file t1 was actually built). > > -Bill > > > On Sun, Jan 2, 2022 at 2:20 PM Bill Deegan <[email protected]> > wrote: > >> also why **JUNK** in subject? >> >> On Sun, Jan 2, 2022 at 2:20 PM Bill Deegan <[email protected]> >> wrote: >> >>> What output do you see when you run your example? >>> >>> >>> On Sun, Jan 2, 2022 at 7:56 AM Brad Kraemer <[email protected]> >>> wrote: >>> >>>> Hello, >>>> >>>> I filed a GitHub Issue <https://github.com/SCons/scons/issues/4079> >>>> and got bounced to this mailing list. So here we go again: >>>> >>>> Value/Alias nodes (as created by the Alias() and Value() >>>> functions/methods receptively) default to up-to-date. >>>> >>>> SCons 4.1.0 >>>> >>>> Python 3.9 >>>> >>>> Installed from nixpkgs (NixOS, $ nix-env -iA nixos.scons) >>>> >>>> Linux >>>> >>>> Reproduction (SConstruct): >>>> >>>> def print_target_1(target, source, env): >>>> print("Target 1 built") >>>> >>>> def print_alias_1(target, source, env): >>>> print("[I'm not getting called]") >>>> >>>> def print_alias_2(target, source, env): >>>> print("I'm getting called because of AlwaysBuild() workaround") >>>> >>>> t1 = Command("t1", [], Action(print_target_1, cmdstr=None)) >>>> Default(t1) >>>> >>>> v = Value("_") >>>> a1 = Alias("a1", v, Action(print_alias_1, cmdstr=None)) >>>> a2 = Alias("a2", v, Action(print_alias_2, cmdstr=None)) >>>> Depends(t1, a1) >>>> Depends(t1, a2) >>>> >>>> AlwaysBuild(a2) >>>> >>>> >>>> Invoke via executing '$ scons' from the directory where the above >>>> SConstruct file exists. >>>> >>>> >>>> Thanks, >>>> >>>> simplejack-src >>>> >>>> >>>> _______________________________________________ >>>> Scons-users mailing list >>>> [email protected] >>>> https://pairlist4.pair.net/mailman/listinfo/scons-users >>>> >>> > _______________________________________________ > Scons-users mailing [email protected]://pairlist4.pair.net/mailman/listinfo/scons-users > > _______________________________________________ > Scons-users mailing list > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users