Task #7734 (closed)
Opened 8 years ago
Closed 7 years ago
Bug: build.py doesn't use JDK on Windows
| Reported by: | jamoore | Owned by: | jamoore |
|---|---|---|---|
| Priority: | major | Milestone: | OMERO-4.4 |
| Component: | Deployment | Version: | n.a. |
| Keywords: | n.a. | Cc: | jburel |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | 0.0d |
| Sprint: | 2012-06-19 (17) |
Description
With the test ant file:
<project name="test" default="test">
<target name="test">
<property environment="t"/>
<echo>JAVA_HOME=${t.JAVA_HOME}</echo>
<echo>java.home=${java.home}</echo>
</target>
</project>
I see the following on Windows:
C:\ome.git>java omero -f t.xml Buildfile: C:\ome.git\t.xml test: JAVA_HOME=c:\Program Files\java\jdk1.6.0_21 java.home=c:\Program Files\java\jdk1.6.0_21\jre BUILD SUCCESSFUL Total time: 1 second C:\ome.git>python build.py -f t.xml Buildfile: C:\ome.git\t.xml test: JAVA_HOME=c:\Program Files\java\jdk1.6.0_21 java.home=C:\Program Files\Java\jre6 BUILD SUCCESSFUL Total time: 1 second
which results in javac not being found but only for the insight build even after explicitly setting JAVA_HOME and PATH:
C:\ome.git>echo %JAVA_HOME% c:\Program Files\java\jdk1.6.0_21 C:\ome.git>echo %PATH% c:\Program Files\java\jdk1.6.0_21\bin;C:\Python26\Scripts;C:\Python26\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Ice-3.3.1-VC90\bin;c :\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\PostgreSQL\8.4\bin\;C:\Program Files\GnuWin32\bin;c:\hudson\hdf5-1.8.5-patch1-win 32\dll;c:\hudson\pthreads-win32-2.8.0\lib;C:\Program Files\Git\cmd;%APPDATA%\Python\Scripts;
and with the following patch to build.py:
diff --git a/build.py b/build.py
index db7ed52..5e9b3f7 100755
--- a/build.py
+++ b/build.py
@@ -12,6 +12,18 @@ import sys
import time
import subprocess
+def popen(args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE):
+ copy = os.environ.copy()
+ return subprocess.Popen(args, env=copy, stdin=stdin, stdout=stdout, stderr=stderr)
+
+
+def execute(args):
+ p = popen(args, stdout=sys.stdout, stderr=sys.stderr)
+ rc = p.wait()
+ if rc != 0:
+ sys.exit(rc)
+
+
def notification(msg, prio):
"""
Provides UI notification.
@@ -22,8 +34,7 @@ def notification(msg, prio):
return
try:
- p = subprocess.Popen(["growlnotify","-t","OMERO Build Status","-p",str(prio)],\
- stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ p = popen(["growlnotify","-t","OMERO Build Status","-p",str(prio)], stdin=subprocess.PIPE)
p.communicate(msg)
rc = p.wait()
if rc != 0:
@@ -98,7 +109,7 @@ def choose_omero_version():
omero_build = os.environ["OMERO_BUILD"]
command = [ find_java(), "omero","-q","version" ]
try:
- p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ p = popen(command)
omero_version,err = p.communicate()
omero_version = omero_version.split()[1]
return [ "-Domero.version=%s-%s" % (omero_version, omero_build) ]
@@ -108,11 +119,6 @@ def choose_omero_version():
except KeyError, ke:
return [] # Use default
-def execute(args):
- rc = subprocess.call(args)
- if rc != 0:
- sys.exit(rc)
-
if __name__ == "__main__":
#
@@ -139,3 +145,4 @@ if __name__ == "__main__":
except SystemExit, se:
notification(""" Failed: %s """ % " ".join(args), 100)
sys.exit(se.code)
+
Change History (9)
comment:1 Changed 8 years ago by jmoore
- Remaining Time set to 0.25
- Status changed from new to accepted
comment:2 Changed 8 years ago by jmoore
- Remaining Time changed from 0.25 to 0
- Resolution set to fixed
- Status changed from accepted to closed
comment:3 Changed 8 years ago by jmoore <josh@…>
(In [14c9113dd9758b907b87ba4f83006c47bf588cb6/ome.git] on branch develop) Attempt to fix Windows insight build (See #7734)
comment:4 Changed 8 years ago by jmoore <josh@…>
(In [f82eb769f1fa2a8d79eb8f4fc9ac0df7f9d4f7bb/ome.git] on branch develop) shell=True on win32 finds the JDK (Fix #7734)
comment:5 Changed 7 years ago by jburel
The problem now happens with the B-F build
comment:6 Changed 7 years ago by jmoore
- Remaining Time changed from 0 to 0.25
- Resolution fixed deleted
- Sprint changed from 2012-01-17 (6) to 2012-06-19 (17)
- Status changed from closed to reopened
At which step does it fail, J-M?
comment:7 Changed 7 years ago by jburel
always fails at bioformats\ant\xml line29
comment:8 Changed 7 years ago by jmoore
Note: this is happening under MINGW. One thread suggests to use progra~1 in JAVA_HOME.
comment:9 Changed 7 years ago by jburel
- Remaining Time changed from 0.25 to 0
- Resolution set to fixed
- Status changed from reopened to closed
This was due to an already installed jre, The build is now working w/o any changes. Closing
./build.py requires shell=True under Windows. Pushed to my sprint6-server-backlog branch.