Project

General

Profile

Bug #4974

ant run and ant force-ptolemy fail to compile an updated file

Added by Christopher Brooks over 9 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
build system
Target version:
Start date:
05/03/2010
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4974

Description

In the devel tree, if I update a Ptolemy java file, then "ant run"
and "ant force-ptolemy" fail to compile the file.

I have to use "ant compile"

I think I reported this earlier, but I could not find a bug for it.

bash-3.2$ touch ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java
bash-3.2$ ant run
Buildfile: build.xml

compile:
[compile] Compiling configuration-manager...
[compile] Compiling module-manager...
[compile] Compiling core...
[compile] Compiling event-state...
[compile] Compiling util...
[compile] Compiling component-library...
[compile] Compiling sms...
[compile] Compiling data-handling...
[compile] Compiling ssh...
[compile] Compiling io...
[compile] Compiling job...
[compile] Compiling repository...
[compile] Compiling authentication...
[compile] Compiling gui...
[compile] Compiling module-manager-gui...
[compile] Compiling authentication-gui...
[compile] Compiling ecogrid...
[compile] Compiling dataturbine...
[compile] Compiling opendap...
[compile] Compiling actors...
[compile] Compiling loader...
[compile] Compiling r...
[compile] Compiling apple-extensions...

run:
[run] setting dock icon to -Xdock:icon=/Users/cxh/src/kepler/common/resources/icons/kepler-dock-icon.png
[run] Set environment variable: PATH = /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands:/Users/cxh/bin:/Users/cxh/ptII/bin:/usr/local/apache-maven/bin:/opt/subversion/bin:/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands:/opt/local/bin:/opt/local/sbin:/Users/cxh/bin:/Users/cxh/ptII/bin:/usr/local/apache-maven/bin:/opt/subversion/bin:/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/local/texlive/2007/bin:/Users/cxh/bin:/Users/cxh/ptII/bin:/usr/local/apache-maven/bin:/opt/subversion/bin:/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/local/texlive/2007/bin:/usr/texbin:/usr/local/texlive/2007/bin:/Users/cxh/src/kepler/kepler/lib:/Users/cxh/src/kepler/outreach/lib:/Users/cxh/src/kepler/apple-extensions/lib:/Users/cxh/src/kepler/r/lib:/Users/cxh/src/kepler/loader/lib:/Users/cxh/src/kepler/actors/lib:/Users/cxh/src/kepler/directors/lib:/Users/cxh/src/kepler/opendap/lib:/Users/cxh/src/kepler/dataturbine/lib:/Users/cxh/src/kepler/ecogrid/lib:/Users/cxh/src/kepler/authentication-gui/lib:/Users/cxh/src/kepler/module-manager-gui/lib:/Users/cxh/src/kepler/gui/lib:/Users/cxh/src/kepler/authentication/lib:/Users/cxh/src/kepler/repository/lib:/Users/cxh/src/kepler/job/lib:/Users/cxh/src/kepler/io/lib:/Users/cxh/src/kepler/ssh/lib:/Users/cxh/src/kepler/data-handling/lib:/Users/cxh/src/kepler/sms/lib:/Users/cxh/src/kepler/component-library/lib:/Users/cxh/src/kepler/util/lib:/Users/cxh/src/kepler/event-state/lib:/Users/cxh/src/kepler/core/lib:/Users/cxh/src/kepler/common/lib:/Users/cxh/src/kepler/module-manager/lib:/Users/cxh/src/kepler/configuration-manager/lib:/Users/cxh/src/kepler/kepler-tasks/lib:/Users/cxh/src/kepler/ptolemy/lib
[run] Set environment variable: R_HOME = /Library/Frameworks/R.framework/Resources
[run] /Users/cxh/src/kepler
[run] Found OS Extension file: /Users/cxh/src/kepler/apple-extensions/module-info/osextension.txt
[run] loading OS extensions for OS Mac OS X with class org.kepler.osx.KeplerOSXExtension
[run] Building Kars...
C-c C-c

BUILD FAILED
/Users/cxh/src/kepler/build-area/build.xml:35: Java returned: 130

Total time: 10 seconds
bash-3.2$ ant force-ptolemy
Buildfile: build.xml

force-ptolemy:

BUILD SUCCESSFUL
Total time: 0 seconds
bash-3.2$ ant compile
Buildfile: build.xml

compile:
[compile] Compiling ptolemy...
[compile] Compiling 1 source file to /Users/cxh/src/kepler/ptolemy/target/classes
[compile] Compiling configuration-manager...
[compile] Compiling module-manager...
[compile] Compiling core...
[compile] Compiling event-state...
[compile] Compiling util...
[compile] Compiling component-library...
[compile] Compiling sms...
[compile] Compiling data-handling...
[compile] Compiling ssh...
[compile] Compiling io...
[compile] Compiling job...
[compile] Compiling repository...
[compile] Compiling authentication...
[compile] Compiling gui...
[compile] Compiling module-manager-gui...
[compile] Compiling authentication-gui...
[compile] Compiling ecogrid...
[compile] Compiling dataturbine...
[compile] Compiling opendap...
[compile] Compiling actors...
[compile] Compiling loader...
[compile] Compiling r...
[compile] Compiling apple-extensions...

BUILD SUCCESSFUL
Total time: 11 seconds
bash-3.2$

History

#1 Updated by Christopher Brooks almost 8 years ago

d. hogan prompted me to look again at this bug.
The initial issue was that
cd build-area
touch ../ptolemy/src/ptolemy/actor/parameters/ParameterPort.java
ant run

would fail to compile ParameterPort.

It turns out that the bug occurs if
ant update-ptolemy -Drev=stable
is first run, followed by the touch and ant run.

If
ant update-ptolemy -Drev=head
is run first, then the problem does not occur.

Here's a complete example of the failure:
---start---
bash-3.2$ ant update-ptolemy -Drev=stable
ant update-ptolemy -Drev=stable
Buildfile: /Users/cxh/src/kepler/build-area/build.xml

update-ptolemy:
[update-ptolemy] svn update -r 62749 /Users/cxh/src/kepler/ptolemy/src
[update-ptolemy] At revision 62749.
[update-ptolemy]

BUILD SUCCESSFUL
Total time: 12 seconds
bash-3.2$ ant force-ptolemy compile
ant force-ptolemy compile
Buildfile: /Users/cxh/src/kepler/build-area/build.xml

force-ptolemy:

compile:
[echo] Note that you may need to run "ant force-ptolemy compile" to compile ptolemy.
[compile] Compiling ptolemy...
[compile] Compiling 1 source file to /Users/cxh/src/kepler/ptolemy/target/classes
[compile] Compiling configuration-manager...
[compile] Compiling module-manager...
[compile] Compiling core...
[compile] Compiling event-state...
[compile] Compiling util...
[compile] Compiling component-library...
[compile] Compiling sms...
[compile] Compiling data-handling...
[compile] Compiling ssh...
[compile] Compiling io...
[compile] Compiling job...
[compile] Compiling repository...
[compile] Compiling authentication...
[compile] Compiling module-manager-gui...
[compile] Compiling gui...
[compile] Compiling authentication-gui...
[compile] Compiling ecogrid...
[compile] Compiling dataturbine...
[compile] Compiling opendap...
[compile] Compiling actors...
[compile] Compiling loader...
[compile] Compiling r...
[compile] Compiling apple-extensions...

BUILD SUCCESSFUL
Total time: 4 seconds
bash-3.2$ touch ../ptolemy/src/ptolemy/actor/parameters/Parameter
bash-3.2$ ant compile
Buildfile: /Users/cxh/src/kepler/build-area/build.xml

compile:
[echo] Note that you may need to run "ant force-ptolemy compile" to compile ptolemy.
[compile] Compiling configuration-manager...
[compile] Compiling module-manager...
[compile] Compiling core...
[compile] Compiling event-state...
[compile] Compiling util...
[compile] Compiling component-library...
[compile] Compiling sms...
[compile] Compiling data-handling...
[compile] Compiling ssh...
[compile] Compiling io...
[compile] Compiling job...
[compile] Compiling repository...
[compile] Compiling authentication...
[compile] Compiling module-manager-gui...
[compile] Compiling gui...
[compile] Compiling authentication-gui...
[compile] Compiling ecogrid...
[compile] Compiling dataturbine...
[compile] Compiling opendap...
[compile] Compiling actors...
[compile] Compiling loader...
[compile] Compiling r...
[compile] Compiling apple-extensions...

BUILD SUCCESSFUL
Total time: 0 seconds
---end---

In turns out that the Kepler build system uses
kepler/ptolemy-head and kepler/.ptolemy-compiled
to determine whether to compile ptolemy.

kepler/build-area/src/org/kepler/build/modules/ModulesTask.java
defines two fields:
ptolemyCompiled = new File(basedir, ".ptolemy-compiled");
ptolemyHead = new File(basedir, "ptolemy-head");

In looking at the compile() method in
build-area/src/org/kepler/build/CompileModules.java
if (mn.equals(Module.PTOLEMY) || mn.matches(Module.PTOLEMY+"-\\d+\\.\\d+") ||
mn.matches(Module.PTOLEMY_KEPLER+"-\\d+\\.\\d+") || mn.startsWith(Module.PTOLEMY_FOR+"-")) {
if (!this.ptolemyHead.exists()) {
try {
ptolemyCompiled.createNewFile();
}
catch (IOException e) {
e.printStackTrace();
}
}
}

If "ant update-ptolemy -Drev=stable" is run, then kepler/ptolemy-head is removed.
If "ant compile" is then run, kepler/.ptolemy-compiled is created.

The various ant targets interact with these files to determine whether to
compile ptolemy.

The bottom line is:
If you use "ant update-ptolemy -Drev=stable", then ptolemy will not necessarily
be automatically compiled for you.
If you use "ant update-ptolemy -Drev=head", then ptolemy is more likely to be
compiled for you.

Fortunately, "ant compile" now produces a message alerting the user about this:
[echo] Note that you may need to run "ant force-ptolemy compile" to compile ptolemy.

So, even though there is a bug where the set of commands I used with the stable
configuration failed to compile, we do warn about it now, so we can close this bug.

See d. hogan's proposal for a fix to use dependencies at
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5554

#2 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 4974

Also available in: Atom PDF