ratpack compilation fails under Linux and Windows

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

ratpack compilation fails under Linux and Windows

Andrey Hihlovskiy
I could not compile ratpack actual sources (commit 5bc9a1f340cd8f249a0c60a28ce5cbd669cbe2c0). The compilation always fails with an error message.

error on Linux:

:ratpack-manual:installCompass
Successfully installed compass-0.12.2
Building native extensions.  This could take a while...
ERROR:  Error installing breakpoint:
	ERROR: Failed to build gem native extension.

        java -jar /home/ahi/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.3/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar mkrf_conf.rb
/bin/sh: 1: java: not found


Gem files will remain installed in /home/ahi/.gradle/.jruby/gems/sass-3.3.0.rc.3 for inspection.
Results logged to /home/ahi/.gradle/.jruby/gems/sass-3.3.0.rc.3/ext/gem_make.out
1 gem installed
:ratpack-manual:installCompass FAILED

error on Windows:

Building native extensions.  This could take a while...

ERROR:  Error installing breakpoint:
        ERROR: Failed to build gem native extension.

        java -jar /C:/Users/ahi/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.3/2273e4c2a2abdd4b25a21b
c513bfc05cfba31f3b/jruby-complete-1.7.3.jar mkrf_conf.rb
'java' is not recognized as an internal or external command,
operable program or batch file.


Gem files will remain installed in C:/Users/ahi/.gradle/.jruby/gems/sass-3.3.0.rc.3 for inspection.
Results logged to C:/Users/ahi/.gradle/.jruby/gems/sass-3.3.0.rc.3/ext/gem_make.out

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

4 gems installed

:ratpack-manual:installCompass
FAILED
Configuration/environment Linux:
  1. Freshly installed Linux Mint Petra 64-bit, 3.11.0-12-generic, all updates installed.
  2. java-7-oracle (JDK) update 51 installed from ppa:webupd8team/java
  3. JAVA_HOME is correctly set to an existing folder containing JDK
  4. JAVA_HOME does not point to symbolic link
  5. java -version works in bash without problems
  6. ruby is not installed (although it should not matter for jruby)
  7. gradle 1.10 installed via gvm-tool
Configuration/environment Windows:
  1. Freshly installed Windows-7 64-bit, all updates installed.
  2. java-7-oracle (JDK) update 51 installed from oracle site
  3. JAVA_HOME is correctly set to an existing folder containing JDK
  4. JAVA_HOME does not point to symbolic link
  5. java -version works in git-bash without problems
  6. ruby is not installed (although it should not matter for jruby)
  7. gradle 1.10 installed via gvm-tool
Note: switch to java-8-oracle does not fix the error (both on Linux and Windows).

Attempts to compile:

I tried compiling via "gradle build" and "./gradlew build", the result is always the same - the abovementioned error message.

Questions:

  1. Is it a known problem?
  2. Do I invoke correct gradle tasks?
  3. On which system/configuration it is guaranteed to compile?
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Luke Daley
Administrator
For some reason `java` is just not on the effective path when running the build.

Is $JAVA_HOME/bin on your $PATH?

It builds fine on Linux and Windows for many other people.
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Luke Daley
Administrator
In reply to this post by Andrey Hihlovskiy
Looks like this has just started failing on CI as well, for reasons I can't explain.

Looking into it.
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Andrey Hihlovskiy
In reply to this post by Andrey Hihlovskiy
Adding $JAVA_HOME/bin to $PATH did not help - ratpack-manual shows the same error.
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Andrey Hihlovskiy
This post was updated on .
In reply to this post by Andrey Hihlovskiy
I isolated problem to be related to "gradle-compass" plugin. The following stripped-down gradle script produces the same error ("java not found"):
apply plugin: 'compass'

buildscript {
  repositories {
    jcenter()
    maven { url 'http://dl.bintray.com/robfletcher/gradle-plugins' }
  }
  dependencies {
    classpath 'org.gradle.plugins:gradle-compass:1.0.9'
  }
}

apply plugin: 'maven'

repositories {
  jcenter()
}

compass {
  gemPath = new File(gradle.gradleUserHomeDir, ".jruby")
  gems = ["compass", "breakpoint"]
}
I also tried upgrading to gradle-compass 1.0.10-SNAPSHOT and to jruby 1.7.10 - to no avail.
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Andrey Hihlovskiy
In reply to this post by Andrey Hihlovskiy
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Luke Daley
Administrator
Thanks Andrey,

I also raised https://github.com/ratpack/ratpack/issues/252.
Me
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Me
Hi Luke,
I have the same problem as Andrey and I was wondering why JRuby is needed at all.
Is there a way to build a minimal Ratpack with Java only features?

Regards

Anonymous coward
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

uris77
I  believe it is needed for the ratpack website. You do have a point, the website should not be a dependency for building the core. Not sure if there is a task that ignores the website build.
Reply | Threaded
Open this post in threaded view
|

Re: ratpack compilation fails under Linux and Windows

Luke Daley
Administrator
In reply to this post by Me
It depends on exactly what you are trying to do with the build.

What's the command you're trying to run? Or, what are you trying to do with the build?