Repository navigation
Description
This issue was originally created at: 2010-06-21 12:28:36.
This issue was reported by: gregnoel.
gregnoel said at 2010-06-21 12:28:36
Steven promised to do unto Alias() what he hath already done unto Depends() (see issue #2647). This issue is just to nag him to do it.
Oh, and while you've got Alias() open, you might try to figure out why the optional action doesn't ever seem to be executed.
gregnoel said at 2010-06-24 14:27:26
Ignore the bit about the optional action. It turns out that's issue #2443, which is a regression in 1.3 that's not been resolved.
stevenknight said at 2010-07-06 11:12:42
Looks like this was never a problem with Alias(). I tried to reproduce it in r5030 (the revision before the fix for Depends()) with a parallel test case and couldn't. This makes sense given the nature of the fix, which was to change the Executor.Null class so it would get all of the children of the node, not just the sources. Because an Alias() walks its dependencies as sources, it didn't have the same failure mode.
Upshot: I was being overly cautious in suggesting that Alias() might have had the same problem as this case for Depends(). If there is a broken use case with Alias() in this vicinity, then that should be characterized and we can open a new issue for it.
Thanks for opening this to make sure the issue got investigated.
gregnoel said at 2010-07-06 16:03:33
This does it for me:
ret = Command('sub1/a.dll', 'sub1/a.cpp', 'cp sub1/a.cpp sub1/a.dll; cp sub1/a.cpp sub1/a.lib')
Install("test","sub1/a.lib")
Alias("sub1/a.lib",ret)
Default('test')Yes, more than a bit weird to use Alias() this way, but it's exactly the failure that Depends() had.
For more fun, try this one:
ret = Command('sub1/a.dll', 'sub1/a.cpp', 'cp sub1/a.cpp sub1/a.dll; cp sub1/a.cpp sub1/a.lib')
Alias("sub1/a.lib",ret)
Install("test","sub1/a.lib")
Default('test')Again, more than a bit weird...
stevenknight said at 2010-07-06 16:09:19
Great! Thanks for the test case. Much more, um, creative than what I tried... :-) I'll work it.
gregnoel said at 2010-07-06 16:30:57
It's just s/Depends/Alias/ from the test case in issue #2647.
stevenknight said at 2010-07-06 16:37:55
Heh. No wonder, I was actually trying to craft a configuration that makes sense.
I just tried out this one, and I don't think it does make sense, unfortunately. Yeah, it generates an error that's nominally the same, but it's because the dependency graph isn't connected properly:
+-.
+-SConstruct
+-sub1
| +-sub1/a.cpp
| +-sub1/a.dll
| | +-sub1/a.cpp
| +-sub1/a.lib
+-test
+-test/a.lib
+-sub1/a.libThe sub1/a.lib that's a dependency of test/a.lib is actually an Alias(), not a file, so it has no way to hook it up to the actual file sub1/a.lib that's underneath the sub1 subdirectory. Since the Alias and File live in separate namespaces, I think this is "correct."
Do you have a suggestion as to how that first configuration would work in a way that's intuitively correct for the user without violating the Alias / File namespace separation?
gregnoel said at 2010-07-18 07:46:24
I have one other example. Going back to the automake GSoC project, it depends on things like this working:
files = []
for f in ['a', 'b']:
files.append(Command(Dir('dist').File(f), [], 'touch $TARGET'))
#
tar = Command('dist.tar', 'dist', 'cat >$TARGET dist/*')
Alias('dist', tar)
#
zip = Command('dist.zip', 'dist', 'cat >$TARGET dist/*')
Alias('dist', zip)The idea is that it creates the distribution tree in 'dist' (where automake puts it by default) and then creates archive commands for each distribution type. If you try it with only one distribution type (that is, cut the last three lines) it works just fine. If you include both, it fails.
This particular example is easy to cure (just wrap a Dir() around the cases where 'dist' is used as a source) but it's a case where the two namespaces should be kept separate and aren't. This specific case is narrow enough that it's probably not worth chasing, but I suspect it's the basis of other cases that show up in the mailing lists from time to time, with other symptoms and errors. It might be worth chasing on those grounds to see if there's a fix that's as simple as the fix to Depends(). (If not, the right solution is probably a FAQ entry.)
gregnoel said at 2010-07-18 07:49:19
Oh, if nothing else, I think the idea of marking aliases in dependency graphs (as was discussed at the last bug party) is a good one, and we should do at least that much).
gregnoel said at 2010-07-21 17:27:11
Bug party triage.
gregnoel said at 2010-11-14 18:41:56
Promote issue so it will be reviewed at next bug party.
Activity