Repository navigation
Description
This issue was originally created at: 2009-11-10 20:07:43.
This issue was reported by: tmikov.
tmikov said at 2009-11-10 20:07:43
I don't understand this issue at all, but I am simply describing what I am seeing.
I have a Java project with JNI. I am using SConscript() with variant_dir. If the SConscript file uses the JavaH builder, the Java builder stops working after the first time.
Here is the setup, as you can see the files are very simple:
# SConstruct
SConscript('SConscript',variant_dir='out',duplicate=0)
# SConscript
classes = Java( 'classes', 'src' )
print classes
JavaH( 'src/', 'classes/Test.class', JAVACLASSDIR='classes' )When I run it the first time it behaves properly:
$ scons -Q
[<SCons.Node.FS.File instance at 0x88ee8ac>]
scons: building associated VariantDir targets: out
javac -d out/classes -sourcepath src src/Test.java
javah -d out/src -classpath out/classes TestThen I run it a second time:
scons -Q
[]
scons: building associated VariantDir targets: out
scons: `.' is up to date.From this moment on it no longer rebuilds the classes. As you can see above, the Java builder doesn't return any nodes at all. Removing the JavaH builder, or running without variant_dir , eliminates the problem.
I have node idea what is going on.
tmikov said at 2009-11-10 20:07:59
Created an attachment (id=653) A simple project demonstrating the problem
gregnoel said at 2009-12-16 16:53:25
Bug party triage. Like other build systems, SCons considers a directory target to be up-to-date as long as it exists. Unlike other build systems, SCons has a proposal (http://scons.org/wiki/Containers) that should allow us to deal with directory targets rationally. Mark this issue with the SEP keyword until the issue for SEP0001 is opened, then close this issue as a dup of that one.
BTW, you supplied an excellent example usage that should help us a lot when designing the feature. Thanks.
tmikov said at 2009-12-16 17:08:23
I still can't make sense of it, but does that mean that the Java builder is broken because it relies on directories, or that it is only broken when used in conjunction with the JavaH builder?
Is there a workaround? As it is, it seems to me either the JavaH builder or both tha JavaH and Java builders ought to be removed from SCons or marked as experimental because they are not very reliable. (I swear I spent hours trying to get this to work until I finally gave up and have SCons call an external script for the Java projects)
Thanks!
Tzvetan
gregnoel said at 2010-01-18 14:55:38
Bug party triage. This turns out to be another example of a directory as a target not being handled intuitively. The solution is to be able to handle a directory target as a 'container object' with its own semantics. This is the subject of SEP0001, so make this issue a dup of the SEP's controlling issue.
*** This issue has been marked as a duplicate of 2536 ***
tmikov attached bug2.zip at 2009-11-10 20:07:59.
A simple project demonstrating the problem
gregnoel said this issue is a duplicate of #2536 at 2010-01-18 14:55:38.
Activity
mwichmann commentedon Nov 18, 2026
As with a couple of others, I'm going to reopen this: it was administratively closed as a "duplicate" in favor of a kind of rollup bug that never got any traction. If it's a real issue, it's worth keeping it visible - though the reference to javah is somewhat obsolete - that's dead since Java 10, though we now have some support for producing the same result with javac. I'll investigate if it's got any wider impacts and then dispose of it in some way.