public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Getting kawa -w to work on OS X
@ 2017-01-18  6:17 Duncan Mak
  2017-01-18  6:51 ` Per Bothner
  0 siblings, 1 reply; 4+ messages in thread
From: Duncan Mak @ 2017-01-18  6:17 UTC (permalink / raw)
  To: kawa mailing list

Hello Per,

I just tried building kawa from source (using a checkout from the
gitlab repo) and "kawa -w" works if I build it locally.

Running it from the official binary distribution fails
(https://github.com/Homebrew/homebrew-core/pull/8301#issuecomment-273030690)
- this means there's something system-dependent that got baked into
the JAR file?

Let me know if you want to send you a copy of my repl.class.


-- 
Duncan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting kawa -w to work on OS X
  2017-01-18  6:17 Getting kawa -w to work on OS X Duncan Mak
@ 2017-01-18  6:51 ` Per Bothner
  2017-01-18 17:02   ` Duncan Mak
  0 siblings, 1 reply; 4+ messages in thread
From: Per Bothner @ 2017-01-18  6:51 UTC (permalink / raw)
  To: Duncan Mak, kawa mailing list

[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]



On 01/17/2017 10:16 PM, Duncan Mak wrote:
> Hello Per,
>
> I just tried building kawa from source (using a checkout from the
> gitlab repo) and "kawa -w" works if I build it locally.
>
> Running it from the official binary distribution fails
> (https://github.com/Homebrew/homebrew-core/pull/8301#issuecomment-273030690)
> - this means there's something system-dependent that got baked into
> the JAR file?

My guess is the "system dependency" is DomTerm and/or JLine.  If you build
from source, if you don't specify the configure flags --with-domterm and/or --with-jline3
then -w will be equivalent to -wswing - it won't try to use any of the DomTerm
console variations.  However, the binary distribution includes both,
so -w will try to use Domterm (and jline) and fail.

The old Swing console works, but it has some basic problems, specifically
rather limited input editing.

You can use the DomTerm and JLine from the binary distribution
to build the source distribution:
   ./configure --with-domterm=/tmp/kawa-2.3 --with-jline3=/tmp/kawa-2.3/lib/jline.jar
assuming you unziped kawa-2.3.zip into /tmp

You can also try the attached patch.  You're supposed to see something like:

$ bin/kawa -w
java.lang.Error: setCurL:kawa.standard.Scheme@1a86f2f1 th:Thread[main,5,main] p1:#|kawa:%N|#  p2:#|%P.%N|#
	at gnu.expr.Language.setCurrentLanguage(Language.java:55)
	at gnu.expr.Language.setDefaults(Language.java:1206)
	at kawa.repl.getLanguage(repl.java:227)
	at kawa.repl.processArgs(repl.java:383)
	at kawa.repl.main(repl.java:820)
Started web server on port 46315.  Browse http://127.0.0.1:46315/
java.lang.Error: DomTerm.run th:Thread[Thread-9,5,main] p1:#|kawa:%N|#  p2:#|%P.%N|#
	at kawa.DomTermBackend.run(DomTermBackend.java:132)
	at java.lang.Thread.run(Thread.java:745)

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

[-- Attachment #2: kawa1.patch --]
[-- Type: text/x-patch, Size: 1229 bytes --]

diff --git a/gnu/expr/Language.java b/gnu/expr/Language.java
index 0447af9..2bd0663 100644
--- a/gnu/expr/Language.java
+++ b/gnu/expr/Language.java
@@ -52,6 +52,7 @@ public abstract class Language
         CheckConsole.prompt1.set(language.getPrimaryPrompt());
     if (CheckConsole.prompt2.get(null) == null)
         CheckConsole.prompt2.set(language.getSecondaryPrompt());
+    new Error("setCurL:"+language+" th:"+Thread.currentThread()+" p1:"+CheckConsole.prompt1.get(null)+" p2:"+CheckConsole.prompt2.get(null)).printStackTrace();
   }
 
   public static Language setSaveCurrent (Language language)
diff --git a/kawa/DomTermBackend.java b/kawa/DomTermBackend.java
index feb4f81..0492b0b 100644
--- a/kawa/DomTermBackend.java
+++ b/kawa/DomTermBackend.java
@@ -129,6 +129,7 @@ public class DomTermBackend extends Backend implements Runnable {
     }
 
     public void run() {
+        new Error("DomTerm.run th:"+Thread.currentThread()+" p1:"+CheckConsole.prompt1.get(null)+" p2:"+CheckConsole.prompt2.get(null)).printStackTrace();
         Writer errWriter = new DomTermErrorWriter(termWriter);
         OutPort outp = new OutPort(termWriter, true, true,
                                    Path.valueOf("/dev/stdout"));

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting kawa -w to work on OS X
  2017-01-18  6:51 ` Per Bothner
@ 2017-01-18 17:02   ` Duncan Mak
  2017-01-18 20:50     ` Per Bothner
  0 siblings, 1 reply; 4+ messages in thread
From: Duncan Mak @ 2017-01-18 17:02 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa mailing list

Ah, yes, I did forget about the configure flags.

However, even using the configure line that you posted, I can't seem
to force the DomTerm backend to start.

I tried giving more flags to -w, and this is what I see:

duncan@furigana:~/git/Kawa (master)$ java kawa.repl -wjavafx
kawa: -wjavafx failed: java.lang.NoClassDefFoundError: org/domterm/Backend

if I just run java kawa.repl -w, I just get the Swing console,
regardless of the patch or not.



On Wed, Jan 18, 2017 at 1:50 AM, Per Bothner <per@bothner.com> wrote:
>
>
> On 01/17/2017 10:16 PM, Duncan Mak wrote:
>>
>> Hello Per,
>>
>> I just tried building kawa from source (using a checkout from the
>> gitlab repo) and "kawa -w" works if I build it locally.
>>
>> Running it from the official binary distribution fails
>>
>> (https://github.com/Homebrew/homebrew-core/pull/8301#issuecomment-273030690)
>> - this means there's something system-dependent that got baked into
>> the JAR file?
>
>
> My guess is the "system dependency" is DomTerm and/or JLine.  If you build
> from source, if you don't specify the configure flags --with-domterm and/or
> --with-jline3
> then -w will be equivalent to -wswing - it won't try to use any of the
> DomTerm
> console variations.  However, the binary distribution includes both,
> so -w will try to use Domterm (and jline) and fail.
>
> The old Swing console works, but it has some basic problems, specifically
> rather limited input editing.
>
> You can use the DomTerm and JLine from the binary distribution
> to build the source distribution:
>   ./configure --with-domterm=/tmp/kawa-2.3
> --with-jline3=/tmp/kawa-2.3/lib/jline.jar
> assuming you unziped kawa-2.3.zip into /tmp
>
> You can also try the attached patch.  You're supposed to see something like:
>
> $ bin/kawa -w
> java.lang.Error: setCurL:kawa.standard.Scheme@1a86f2f1
> th:Thread[main,5,main] p1:#|kawa:%N|#  p2:#|%P.%N|#
>         at gnu.expr.Language.setCurrentLanguage(Language.java:55)
>         at gnu.expr.Language.setDefaults(Language.java:1206)
>         at kawa.repl.getLanguage(repl.java:227)
>         at kawa.repl.processArgs(repl.java:383)
>         at kawa.repl.main(repl.java:820)
> Started web server on port 46315.  Browse http://127.0.0.1:46315/
> java.lang.Error: DomTerm.run th:Thread[Thread-9,5,main] p1:#|kawa:%N|#
> p2:#|%P.%N|#
>         at kawa.DomTermBackend.run(DomTermBackend.java:132)
>         at java.lang.Thread.run(Thread.java:745)
>
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/



-- 
Duncan.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting kawa -w to work on OS X
  2017-01-18 17:02   ` Duncan Mak
@ 2017-01-18 20:50     ` Per Bothner
  0 siblings, 0 replies; 4+ messages in thread
From: Per Bothner @ 2017-01-18 20:50 UTC (permalink / raw)
  To: Duncan Mak; +Cc: kawa mailing list



On 01/18/2017 09:01 AM, Duncan Mak wrote:
> I tried giving more flags to -w, and this is what I see:
>
> duncan@furigana:~/git/Kawa (master)$ java kawa.repl -wjavafx
> kawa: -wjavafx failed: java.lang.NoClassDefFoundError: org/domterm/Backend
>
> if I just run java kawa.repl -w, I just get the Swing console,
> regardless of the patch or not.

You need to make sure the CLASSPATH includes domterm.jar.
If you use the bin/kawa script it should work automatically.
(Unless there are MacOS portability issues.  Someone mentioned readlink -f.)
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-18 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18  6:17 Getting kawa -w to work on OS X Duncan Mak
2017-01-18  6:51 ` Per Bothner
2017-01-18 17:02   ` Duncan Mak
2017-01-18 20:50     ` Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).