The SCons Java builder does not handle generated .java files

Bug #1101094 reported by Tanubi
6
This bug affects 1 person
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_nonexistent_files.patch, which is applied by Ubuntu.
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('src/a/Bar.java', '', 'touch $TARGET')
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
      +-src/a/Bar.java
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
      +-src/a/Bar.java
scons: done building targets.

Here, the javac compiler is invoked and the dependencies are good.

So please do not apply the patch java_ignore_nonexistent_files.patch anymore.

Changed in scons (Ubuntu):
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package scons - 2.3.0-2

---------------
scons (2.3.0-2) unstable; urgency=low

  * Upload to unstable.
  * debian/patches/java_ignore_nonexistent_files.patch:
    - Do not check for symlink reference, check whether files can be
      opened instead, and return a valid tuple anyway (LP: #1101094).
  * debian/patches/manpages.patch:
    - 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

Changed in scons (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.