Opened 8 years ago
Closed 3 years ago
#422 closed defect (wontfix)
SYSTEM:RUN-PROGRAM does not work on Java 6
Reported by: | Mark Evenson | Owned by: | Mark Evenson |
---|---|---|---|
Priority: | blocker | Milestone: | 1.9.0 |
Component: | interpreter | Version: | 1.4.0 |
Keywords: | cffi sys:run-program java-5 java-6 | Cc: | Elias Pipping |
Parent Tickets: |
Description
In chasing down the errors with CFFI on CL-TEST-GRID <https://mailman.common-lisp.net/pipermail/armedbear-devel/2016-October/003719.html>, I have found that the [java.lang.ProcessBuilder?$Redirect][] interface used by Elias and Olof to extend SYS:RUN-PROGRAM for different types of I/O abstractions was introduced with Java 7, and will hence not work on earlier Java implementations.
[java.lang.ProcessBuilder?$Redirect]: https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.Redirect.html
Invoking ABCL-ASDF:ENSURE-MVN-VERSION, the following form causes the error
(JFIELD "java.lang.ProcessBuilder$Redirect" "INHERIT")
TODO: investigate the Java 6 APIs to see if there is a way to do I/O redirection with backwards compatibility. I currently suspect that there is no way to support Java 5/6 for this usage, which is why we never implemented I/O redirection previously.
There is undoubtedly a way re-write the SYS:RUN-PROGRAM interface so that we may invoke a process to read its output as a string in Java 5/Java 6, as it worked before. But we will have to figure out a way to advertise the different features of SYS:RUN-PROGRAM depending on the hosting VM.
Longer term, we may want to deprecate Java 5/6, but I would really have the compiler emit Java 7-compatible bytecode (mainly by passing the Java 6 verification process) before we begin that.
Attachments (2)
Change History (22)
comment:1 Changed 8 years ago by
Changed 8 years ago by
Attachment: | run-program-20161120a.diff added |
---|
comment:3 Changed 8 years ago by
After further analysis, the new plan of attack:
- Continue to deprecate SYS:RUN-SHELL-COMMAND, as the JVM-[56] actually seem to provide all the behavior we need.
- Fully support the current signature of the abcl-1.5.0-dev SYS:RUN-PROGRAM as extended by Pipping and Olof. The environment clearing/setting will work without alterations. "All that is needed" is to create an
org.abcl.util.AsyncIOManager
using the non-blocking file descriptor framework injava.jnio
(introduced in JVM5) to drain/fill input/outputorg.armedbear.lisp.Stream
instances. Pipping has collected a thorough test suite for the SYS:RUN-PROGRAM behavior, which will be of great use in implementation.
The use of SYS:RUN-PROGRAM
as invoked by UIOP/RUN-PROGRAM
as the implementation interface should mean that ASDF should "just work" when the new code passes Pipping's test suite.
TODO: transcribe details of SYS:RUN-PROGAM test suite invocation; implement ASyncIOManager
.
Such work is intended for an abcl-1.4.1 release by the end of November 2016.
comment:4 Changed 8 years ago by
Milestone: | 1.5.0 → 1.4.1 |
---|---|
Owner: | set to Mark Evenson |
Priority: | major → blocker |
Status: | new → assigned |
comment:5 Changed 8 years ago by
Cc: | Elias Pipping added |
---|---|
Keywords: | sys:run-program added; sys:run-progrom removed |
comment:6 Changed 8 years ago by
When using development versions of ABCL, [ASDF needs to be patched][1].
[1]: https://gitlab.common-lisp.net/asdf/asdf/merge_requests/57
Changed 8 years ago by
Attachment: | abcl-run-program-20161129a.diff added |
---|
comment:7 follow-up: 9 Changed 8 years ago by
Status: | assigned → accepted |
---|
Plan of attack:
1) Use Java interfaces in org.abcl.java[5678] packages to mark JVM-side availablity until we get to the Java9 module system.
2) Keep SYS:RUN-SHELL-COMMAND deprecated Lisp-side; mody SYS:RUN-PROGRAM to fall back to the appropriate org.abcl.java5 interface capabilities signaling an exception if unable to emulate requested behavior
3) Test!
comment:9 Changed 8 years ago by
Replying to mevenson:
Plan of attack:
1) Use Java interfaces in org.abcl.java[5678] packages to mark JVM-side availablity until we get to the Java9 module system.
2) Keep SYS:RUN-SHELL-COMMAND deprecated Lisp-side; mody SYS:RUN-PROGRAM to fall back to the appropriate org.abcl.java5 interface capabilities signaling an exception if unable to emulate requested behavior
3) Test!
Provide the following interfaces
org.abcl.runtime.Java5 org.abcl.runtime.Java6 org.abcl.runtime.Java7 org.abcl.runtime.Java8
for which
org.abcl.runtime.Available.getInstance()
returns something meaningful.
comment:11 Changed 7 years ago by
Summary: | SYSTEM:RUN-PROGRAM does not work on Java 5/6 → SYSTEM:RUN-PROGRAM does not work on Java 6 |
---|
comment:14 Changed 4 years ago by
Milestone: | 1.6.2 → 1.7.0 |
---|
comment:19 Changed 3 years ago by
Milestone: | 1.8.1 → 1.9.0 |
---|
comment:20 Changed 3 years ago by
Resolution: | → wontfix |
---|---|
Status: | accepted → closed |
Support for openjdk6 no longer in scope. Patches would be accepted.
Current thinking on resolution of issue: