emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Android port


From: Po Lu
Subject: Re: Android port
Date: Mon, 20 Feb 2023 10:37:44 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Arsen Arsenović <arsen@aarsen.me> writes:

> Hi,
>
> I encountered another one:
>
>   javac -classpath 
> "/home/arsen/Android/Sdk/platforms/android-Tiramisu/android.jar:." -target 
> 1.7 -source 1.7 -Xlint:d
>   eprecation org/gnu/emacs/EmacsContextMenu.java
>   warning: [options] bootstrap class path not set in conjunction with -source 
> 7
>   warning: [options] source value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] target value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] To suppress warnings about obsolete options, use 
> -Xlint:-options.
>   org/gnu/emacs/EmacsContextMenu.java:265: error: cannot find symbol
>       final Holder<Boolean> rc;
>             ^
>     symbol:   class Holder
>     location: class EmacsContextMenu
>   org/gnu/emacs/EmacsContextMenu.java:267: error: cannot find symbol
>       rc = new Holder<Boolean> ();
>                ^
>     symbol:   class Holder
>     location: class EmacsContextMenu
>   2 errors
>   4 warnings
>   make[2]: *** [Makefile:261: org/gnu/emacs/EmacsContextMenu.class] Error 1 
> shuffle=2758590628
>
> I tried replicating with that shuffle= value, but it seems that I did
> not get lucky twice.  However, I believe I have the reason why:
>
>   ~/gnu/emacs-android2 130 $ grep -r --include='*.java' Holder
>   java/org/gnu/emacs/EmacsService.java:class Holder<T>
>   java/org/gnu/emacs/EmacsService.java:    final Holder<EmacsView> view;
>   java/org/gnu/emacs/EmacsService.java:    view = new Holder<EmacsView> ();
>   java/org/gnu/emacs/EmacsService.java:    final Holder<ClipboardManager> 
> manager;
>   java/org/gnu/emacs/EmacsService.java:    manager = new 
> Holder<ClipboardManager> ();
>   java/org/gnu/emacs/EmacsDialog.java:    final Holder<Boolean> rc;
>   java/org/gnu/emacs/EmacsDialog.java:    rc = new Holder<Boolean> ();
>   java/org/gnu/emacs/EmacsContextMenu.java:    final Holder<Boolean> rc;
>   java/org/gnu/emacs/EmacsContextMenu.java:    rc = new Holder<Boolean> ();
>
> There is no dependency between these Holder<T> users and the .java that
> provides it:
>
>   ~/gnu/emacs-android2/java$ rm org/gnu/emacs/EmacsDialog.class
>   ~/gnu/emacs-android2/java$ make org/gnu/emacs/EmacsDialog.class
>     JAVAC    org/gnu/emacs/EmacsDialog.class
>   warning: [options] bootstrap class path not set in conjunction with -source 
> 7
>   warning: [options] source value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] target value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] To suppress warnings about obsolete options, use 
> -Xlint:-options.
>   org/gnu/emacs/EmacsDialog.java:302: error: cannot find symbol
>       final Holder<Boolean> rc;
>             ^
>     symbol:   class Holder
>     location: class EmacsDialog
>   org/gnu/emacs/EmacsDialog.java:304: error: cannot find symbol
>       rc = new Holder<Boolean> ();
>                ^
>     symbol:   class Holder
>     location: class EmacsDialog
>   2 errors
>   4 warnings
>   make: *** [Makefile:261: org/gnu/emacs/EmacsDialog.class] Error 1
>   ~/gnu/emacs-android2/java 2 $ rm org/gnu/emacs/EmacsService.class; make 
> org/gnu/emacs/EmacsService.class
>     JAVAC    org/gnu/emacs/EmacsService.class
>   warning: [options] bootstrap class path not set in conjunction with -source 
> 7
>   warning: [options] source value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] target value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] To suppress warnings about obsolete options, use 
> -Xlint:-options.
>   4 warnings
>   ~/gnu/emacs-android2/java$ make org/gnu/emacs/EmacsDialog.class
>     JAVAC    org/gnu/emacs/EmacsDialog.class
>   warning: [options] bootstrap class path not set in conjunction with -source 
> 7
>   warning: [options] source value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] target value 7 is obsolete and will be removed in a 
> future release
>   warning: [options] To suppress warnings about obsolete options, use 
> -Xlint:-options.
>   4 warnings
>   ~/gnu/emacs-android2/java$ 
>
> The simplest way to fix it is probably to break out Holder<T> into
> Holder.java, as that won't require manually bookkeeping the
> dependencies.  I attached a patch, which builds on x86_64-pc-linux-gnu.
>
> From faf8fc54ad1d835d843e33833715eed2af83d517 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
> Date: Sun, 19 Feb 2023 16:21:02 +0100
> Subject: [PATCH] java: Resolve possible parallelism error across Holder class
>
> * java/org/gnu/emacs/EmacsService.java (Holder): Move from here
> to...
> * java/org/gnu/emacs/Holder.java: ... here.  New file.
> ---
>  java/org/gnu/emacs/EmacsService.java | 5 -----
>  java/org/gnu/emacs/Holder.java       | 6 ++++++
>  2 files changed, 6 insertions(+), 5 deletions(-)
>  create mode 100644 java/org/gnu/emacs/Holder.java
>
> diff --git a/java/org/gnu/emacs/EmacsService.java 
> b/java/org/gnu/emacs/EmacsService.java
> index ba6ec485d62..18cbb06eaa8 100644
> --- a/java/org/gnu/emacs/EmacsService.java
> +++ b/java/org/gnu/emacs/EmacsService.java
> @@ -62,11 +62,6 @@
>  
>  import android.hardware.input.InputManager;
>  
> -class Holder<T>
> -{
> -  T thing;
> -};
> -
>  /* EmacsService is the service that starts the thread running Emacs
>     and handles requests by that Emacs instance.  */
>  
> diff --git a/java/org/gnu/emacs/Holder.java b/java/org/gnu/emacs/Holder.java
> new file mode 100644
> index 00000000000..41866084ab9
> --- /dev/null
> +++ b/java/org/gnu/emacs/Holder.java
> @@ -0,0 +1,6 @@
> +package org.gnu.emacs;
> +
> +class Holder<T>
> +{
> +  T thing;
> +};
> -- 
> 2.39.2
>
>
> I also tested the above by making EmacsDialog.class on a clean
> configure, triggering the edge case.
>
> Thanks in advance.

Thanks.  The make depends thing is supposed to be done by javac
internally, and it should scan through source files in
org/gnu/emacs to find missing definitions.

I will try to fix the group rule definition.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]