Opened 11 years ago

Closed 11 years ago

#262 closed defect (fixed)

fails to (require :jna)

Reported by: Christoph Egger Owned by: Mark Evenson
Priority: major Milestone: 1.1.0
Component: abcl-contrib Version: 1.1.0-dev
Keywords: Cc: siccegge@…
Parent Tickets:

Description

The value NIL is not of type REAL.
   [Condition of type TYPE-ERROR]

backtrace attached. maven 3.0.4 is installed

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=repo.maven.apache.org -Dartifact=net.java.dev.jna:jna:3.5.1

Works just fine and downloads jna

Change History (8)

comment:1 Changed 11 years ago by Christoph Egger

because this trac gives me a 500 if I try to attach the file:

http://cs.ucsb.edu/~egger/bt

comment:2 Changed 11 years ago by Christoph Egger

EVIL> (read-line (sys::process-output (sys::run-program "mvn" '("-version"))))
"Warning: JAVA_HOME environment variable is not set."
NIL

comment:3 Changed 11 years ago by Christoph Egger

Couldn't the first matching line be used instead of failing if the first line doesn't work out? And maybe something more meaningfull returned than "The value NIL is not of type REAL." when abcl-asdf can't parse the maven versionstring ;-)

comment:4 Changed 11 years ago by Christoph Egger

Following patch works for me

Index: contrib/abcl-asdf/maven-embedder.lisp
===================================================================
--- contrib/abcl-asdf/maven-embedder.lisp	(revision 14231)
+++ contrib/abcl-asdf/maven-embedder.lisp	(working copy)
@@ -114,21 +114,21 @@
 
 (defun mvn-version ()
   "Return the Maven version used by the Aether connector."
-  (let* ((line
-         (read-line (sys::process-output 
-                     (sys::run-program 
-                      (namestring (find-mvn)) '("-version")))))
-         (pattern (#"compile" 
-                   'regex.Pattern
-                   "Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)"))
-         (matcher (#"matcher" pattern line))
-         (found (#"find" matcher)))
-    (unless found 
-      (return-from mvn-version nil))
-    (mapcar #'parse-integer
-            `(,(#"group" matcher 1)
-              ,(#"group" matcher 2)
-              ,(#"group" matcher 3)))))
+  (let ((stream (sys::process-output
+				 (sys::run-program
+				  (namestring (find-mvn)) '("-version")))))
+	(do ((line (read-line stream nil) (read-line stream nil))
+		 (pattern (#"compile"
+				   'regex.Pattern
+				   "Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)")))
+		((not line) nil)
+	  (let ((matcher (#"matcher" pattern line)))
+		(when (#"find" matcher)
+		  (return-from mvn-version
+			(mapcar #'parse-integer
+					`(,(#"group" matcher 1)
+					   ,(#"group" matcher 2)
+					   ,(#"group" matcher 3))))))))
 
 (defun ensure-mvn-version ()
   "Return t if Maven version is 3.0.3 or greater."

comment:5 Changed 11 years ago by Mark Evenson

Milestone: 1.1.0
Version: 1.1.0-dev

comment:6 Changed 11 years ago by Mark Evenson

(In [14233]) Re #262 in abcl-asdf: use first matching line if the first line doesn't work out.

Further work needed as something more meaningful should be returned
other than "The value NIL is not of type REAL" when abcl-asdf can't
parse the Maven version string.

Initial patch by Christoph.

comment:7 Changed 11 years ago by Mark Evenson

Milestone: 1.1.01.1.1

Needs further triage for failing cases.

Possibly attempt to set the process's M2_HOME environment to the pathname of a suitable Maven.

Now possible to specify a :CLASSNAME in the ASDF definition that bypasses any attempt to use Maven.

comment:8 Changed 11 years ago by Mark Evenson

Milestone: 1.1.11.1.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.