You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Russel Winder <ru...@winder.org.uk> on 2017/09/28 06:21:02 UTC

Bash feature is Shell script

Because Gradle can't cope with executing on Zulu 9 :-( I have to run Gradle on
Zulu 8, but I can still execute on Zulu 9, well except for Groovy :-((

It looks like someone is assuming /bin/sh is actually Bash in the launch
scripts for groovy:


|> groovy -version
/home/users/russel/lib/JDK/groovy/bin/groovy: 281: /home/users/russel/lib/JDK/groovy/bin/groovy: [[: not found
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/users/russel/lib/JDK/groovy/lib/groovy-3.0.0-SNAPSHOT.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 3.0.0-SNAPSHOT JVM: 9.0.0.15 Vendor: Azul Systems, Inc. OS: Linux


I am unsure whether to suggest switching to Bash for launch or ensuring no
Bash features in the scripts.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Re: Bash feature is Shell script

Posted by Keegan Witt <ke...@gmail.com>.
I've noticed this with the Alpine Docker images
<https://github.com/groovy/docker-groovy> I maintain.  GROOVY-7906
<https://issues.apache.org/jira/browse/GROOVY-7906> documents this.  What
I've done for now is replace the shebang with Bash in the scripts.  Longer
term,  I'm thinking it'd be best to replace the Bash-specific syntax with
something that'll work with more interpreters.

On Thu, Sep 28, 2017 at 2:21 AM, Russel Winder <ru...@winder.org.uk> wrote:

> Because Gradle can't cope with executing on Zulu 9 :-( I have to run
> Gradle on
> Zulu 8, but I can still execute on Zulu 9, well except for Groovy :-((
>
> It looks like someone is assuming /bin/sh is actually Bash in the launch
> scripts for groovy:
>
>
> |> groovy -version
> /home/users/russel/lib/JDK/groovy/bin/groovy: 281:
> /home/users/russel/lib/JDK/groovy/bin/groovy: [[: not found
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass
> (file:/home/users/russel/lib/JDK/groovy/lib/groovy-3.0.0-SNAPSHOT.jar) to
> method java.lang.Object.finalize()
> WARNING: Please consider reporting this to the maintainers of
> org.codehaus.groovy.reflection.CachedClass
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> Groovy Version: 3.0.0-SNAPSHOT JVM: 9.0.0.15 Vendor: Azul Systems, Inc.
> OS: Linux
>
>
> I am unsure whether to suggest switching to Bash for launch or ensuring no
> Bash features in the scripts.
>
> --
> Russel.
> ============================================================
> =================
> Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:russel.winder@ekiga.net
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Re: Bash feature is Shell script

Posted by Daniel Sun <re...@hotmail.com>.
My pleasure :)



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Re: Bash feature is Shell script

Posted by Russel Winder <ru...@winder.org.uk>.
Looks to be working now. Thanks for fast fixing.

On Thu, 2017-09-28 at 11:11 -0700, Daniel Sun wrote:
> Hi  Bahman,
> 
>     As you proposed, the scripts have been modified: 
> https://github.com/apache/groovy/commit/87c68fba3b599238d5c900d8eb18975074fa
> 926d
> 
>     Please give it a try. 
> 
> Cheers,
> Daniel.Sun
> 
> 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

Re: Bash feature is Shell script

Posted by Daniel Sun <re...@hotmail.com>.
Hi  Bahman,

    As you proposed, the scripts have been modified: 
https://github.com/apache/groovy/commit/87c68fba3b599238d5c900d8eb18975074fa926d

    Please give it a try. 

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Re: Bash feature is Shell script

Posted by Bahman Movaqar <ba...@bahmanm.com>.
As a side note, we should be using `/usr/bin/env sh` or `/usr/bin/env
bash` to make sure path inconsistencies across different distros and
OSes (e.g. FreeBSD) are covered.

--
Bahman

On Thu, Sep 28, 2017 at 7:47 PM, Daniel Sun <re...@hotmail.com> wrote:
> Try to fix the bash specific issue further...
> https://github.com/apache/groovy/commit/042dbdb3f74a238a09768676f03ea05dcce95606
>
> Please give it a try... thanks.
>
> P.S. I'm using Win10.
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Re: Bash feature is Shell script

Posted by Daniel Sun <re...@hotmail.com>.
Try to fix the bash specific issue further...
https://github.com/apache/groovy/commit/042dbdb3f74a238a09768676f03ea05dcce95606

Please give it a try... thanks.

P.S. I'm using Win10.

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Re: Bash feature is Shell script

Posted by Russel Winder <ru...@winder.org.uk>.
On Thu, 2017-09-28 at 01:09 -0700, Daniel Sun wrote:
> Hi  Russel,
> 
>     I just tried to fix the issue:
> https://github.com/apache/groovy/commit/28d2f6a5f34f44f524ffea0e44be70c3c6a5
> c24e
>     Please give it a try :-)

Evolved, but unfortunately:

|> groovy -version
/home/users/russel/lib/JDK/groovy/bin/groovy: 283: test: unexpected operator
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/users/russel/lib/JDK/groovy/lib/groovy-3.0.0-SNAPSHOT.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 3.0.0-SNAPSHOT JVM: 9.0.0.15 Vendor: Azul Systems, Inc. OS: Linux

-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

Re: Bash feature is Shell script

Posted by Daniel Sun <re...@hotmail.com>.
Hi  Russel,

    I just tried to fix the issue:
https://github.com/apache/groovy/commit/28d2f6a5f34f44f524ffea0e44be70c3c6a5c24e
    Please give it a try :-)

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html