public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Internal Error at compile time - Suggestions?
@ 2015-11-18  5:16 Ben Simon
  2015-11-18  5:46 ` Ben Simon
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Simon @ 2015-11-18  5:16 UTC (permalink / raw)
  To: kawa

Howdy all -

I'm starting to flesh out a new Android app written in Kawa and I'm
getting following compile errors:

     [java] (compiling
/home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm
to com.benjisimon.thermaroid.main)
     [java] /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm:16:36:
internal error - allocate method for LambdaExp:camera-ids/17/l:15 in
module ModuleExp:camera/6/l:5 that has already been compiled
     [java] /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm:17:39:
internal error - allocate method for LambdaExp:camera-facing/19/l:19
in module ModuleExp:camera/6/l:5 that has already been compiled

The files involved in the compilation are below. Or you can see them
here: https://github.com/benjisimon/thermaroid/tree/master/src/com/benjisimon/thermaroid

I'm using kawa-2.1.1.jar.

What am I missing?  Thanks or the assistance.


main.scm is:
---
(define-alias CameraManager android.hardware.camera2.CameraManager)
(define-alias Context android.content.Context)
(define-alias Activity android.app.Activity)

(require 'android-defs)
(require <com.benjisimon.thermaroid.camera>)

(activity main
          (on-create-view
           (let* ((ids :: string[] (camera-ids))
                  (directions :: list (map camera-facing ids))
                  (cam-info (apply string-append
                                   (lambda (id direction)
                                     (string-append id ": " direction))
                                   ids directions)))
             (android.widget.TextView (this)
                                      text: (as string cam-info)))))
---

and camera.scm is:
---
(define-alias Activity android.app.Activity)
(define-alias CameraManager android.hardware.camera2.CameraManager)
(define-alias Context android.content.Context)
(define-alias CameraCharacteristics
android.hardware.camera2.CameraCharacteristics)

(module-export camera-ids camera-facing)

(define (camera-mgr) :: CameraManager
  (invoke (current-activity) 'getSystemService Context:CAMERA_SERVICE))

(define (camera-ids) :: string[]
  (let ((mgr :: CameraManager (camera-mgr)))
    (mgr:getCameraIdList)))

(define (camera-facing (id :: string))
  (let* ((mgr :: CameraManager (camera-mgr))
         (details :: CameraCharacteristics (mgr:get-camera-characteristics id))
         (key CameraCharacteristics:LENS_FACING)
         (direction (details:get key)))
    (vector-ref direction (vector "Front" "Back" "External"))))
---



-- 
Have an idea for software?  I can make it happen -
http://www.ideas2executables.com
My Blog: http://www.BlogByBen.com

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

* Re: Internal Error at compile time - Suggestions?
  2015-11-18  5:16 Internal Error at compile time - Suggestions? Ben Simon
@ 2015-11-18  5:46 ` Ben Simon
  2015-11-19  0:55   ` Per Bothner
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Simon @ 2015-11-18  5:46 UTC (permalink / raw)
  To: kawa

On Wed, Nov 18, 2015 at 12:15 AM, Ben Simon <benjisimon@gmail.com> wrote:
> I'm starting to flesh out a new Android app written in Kawa and I'm
> getting following compile errors:

I did an:
  ant clean

and re-compiled, and the error went away.

Sorry about the false alarm.

-Ben

-- 
Have an idea for software?  I can make it happen -
http://www.ideas2executables.com
My Blog: http://www.BlogByBen.com

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

* Re: Internal Error at compile time - Suggestions?
  2015-11-18  5:46 ` Ben Simon
@ 2015-11-19  0:55   ` Per Bothner
  2015-11-19 18:19     ` Ben Simon
  0 siblings, 1 reply; 5+ messages in thread
From: Per Bothner @ 2015-11-19  0:55 UTC (permalink / raw)
  To: kawa, Ben Simon



On 11/17/2015 09:45 PM, Ben Simon wrote:
> On Wed, Nov 18, 2015 at 12:15 AM, Ben Simon <benjisimon@gmail.com> wrote:
>> I'm starting to flesh out a new Android app written in Kawa and I'm
>> getting following compile errors:
>
> I did an:
>    ant clean
>
> and re-compiled, and the error went away.
>
> Sorry about the false alarm.

Well, technically any "internal error" is a bug in Kawa.
It should at least give a more informative error message.

I'm going to add the following to the message:
     (Try removing all class files and doing a full re-compile.)

I would prefer a real fix - some day.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

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

* Re: Internal Error at compile time - Suggestions?
  2015-11-19  0:55   ` Per Bothner
@ 2015-11-19 18:19     ` Ben Simon
  2015-11-20  5:04       ` Per Bothner
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Simon @ 2015-11-19 18:19 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa

On Wed, Nov 18, 2015 at 7:55 PM, Per Bothner <per@bothner.com> wrote:
> Well, technically any "internal error" is a bug in Kawa.
> It should at least give a more informative error message.

Actually, this may be an issue. Consider this sequence:

I've got this project here: https://github.com/benjisimon/thermaroid

Note that the top level activity is main.scm. main.scm in turn
requires printer.scm.

  ant clean
  ant debug
  -- works

  -- make changes to main.scm
  ant debug
  -- works

  touch printer.scm
  ant debug
  -- error:
     [java] (compiling
/home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm
to com.benjisimon.thermaroid.main)
     [java] /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm:54:91:
internal error - allocate method for LambdaExp:send-to-printer/18/l:25
in module ModuleExp:printer/7/l:5 that has already been compiled

Note: all I did was touch printer.scm, I didn't make any real changes to it.

Now if I run:
   ant clean
   ant debug
compilation will succeed.

However running a make clean after every change to dependent file
seems a bit much, no?

If you want, I can prepare a much smaller, more self contained example.

Let me know.

-Ben

-- 
Have an idea for software?  I can make it happen -
http://www.ideas2executables.com
My Blog: http://www.BlogByBen.com

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

* Re: Internal Error at compile time - Suggestions?
  2015-11-19 18:19     ` Ben Simon
@ 2015-11-20  5:04       ` Per Bothner
  0 siblings, 0 replies; 5+ messages in thread
From: Per Bothner @ 2015-11-20  5:04 UTC (permalink / raw)
  To: Ben Simon; +Cc: kawa



On 11/19/2015 10:19 AM, Ben Simon wrote:
>    touch printer.scm
>    ant debug
>    -- error:
>       [java] (compiling
> /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm
> to com.benjisimon.thermaroid.main)
>       [java] /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm:54:91:
> internal error - allocate method for LambdaExp:send-to-printer/18/l:25
> in module ModuleExp:printer/7/l:5 that has already been compiled
>
> Note: all I did was touch printer.scm, I didn't make any real changes to it.
>
> Now if I run:
>     ant clean
>     ant debug
> compilation will succeed.
>
> However running a make clean after every change to dependent file
> seems a bit much, no?

I agree.

>
> If you want, I can prepare a much smaller, more self contained example.
>
> Let me know.

That would be appreciate.

I'm in the middle of some other work, so it might be best to create a Savannah bug
(with attachments) so I don't forget the problem.

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

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

end of thread, other threads:[~2015-11-20  5:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18  5:16 Internal Error at compile time - Suggestions? Ben Simon
2015-11-18  5:46 ` Ben Simon
2015-11-19  0:55   ` Per Bothner
2015-11-19 18:19     ` Ben Simon
2015-11-20  5:04       ` 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).