The SCons Java builder does not handle generated .java files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
scons (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I am trying to generate Java files and then compile those with the Java compiler.
Unfortunately, the Java compiler is never invoked on the first run of scons.
However, it works all good with a vanilla SCons.
I tracked it down to the patch java_ignore_
With this patch, nonexistent Java files are ignored. But the check is performed at a time where this is almost always true for generated files.
The simplest example I can come up with is just the following SConstruct file:
Command(
Java('classes', 'src')
And this is the scons output:
scons --tree=prune
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
touch src/a/Bar.java
+-.
+-classes
+-sconstruct
+-src
+-src/a
+
scons: done building targets.
As you can see, the javac compiler is never invoked and the dependency tree is all wrong.
I then just reversed the patch I mentioned before and ran scons again:
scons --tree=prune
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
touch src/a/Bar.java
javac -d classes -sourcepath src/a src/a/Bar.java
+-.
+-classes
| +-classes/Bar.class
| +-src/a/Bar.java
| +-/usr/bin/javac
+-sconstruct
+-src
+-src/a
+
scons: done building targets.
Here, the javac compiler is invoked and the dependencies are good.
So please do not apply the patch java_ignore_
Changed in scons (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Fix Committed |
This bug was fixed in the package scons - 2.3.0-2
---------------
scons (2.3.0-2) unstable; urgency=low
* Upload to unstable. patches/ java_ignore_ nonexistent_ files.patch: patches/ manpages. patch:
* debian/
- Do not check for symlink reference, check whether files can be
opened instead, and return a valid tuple anyway (LP: #1101094).
* debian/
- Fix spelling errors in the man pages.
* debian/control:
- Move VCS repository under collab-maint.
-- Luca Falavigna <email address hidden> Sun, 05 May 2013 11:42:32 +0200