Bug 241391

Summary: devel/RStudio: Fails to build: build.xml:110: Java returned: 1
Product: Ports & Packages Reporter: O. Hartmann <ohartmann>
Component: Individual Port(s)Assignee: Yuri Victorovich <yuri>
Status: Closed FIXED    
Severity: Affects Some People CC: Trond.Endrestol, rhurlin
Priority: --- Flags: bugzilla: maintainer-feedback? (yuri)
Version: Latest   
Hardware: Any   
OS: Any   

Description O. Hartmann 2019-10-21 11:36:56 UTC
Port devel/RStudio fails to build in poudriere, popping up the error shown below.

Build environment:

 =>> Building devel/RStudio
build started at Mon Oct 21 10:37:08 UTC 2019
port directory: /usr/ports/devel/RStudio
package name: RStudio-1.2.5001
building for: FreeBSD anger.walstatt.dynvpn.de 12.1-STABLE FreeBSD 12.1-STABLE 1201500 amd64
maintained by: yuri@FreeBSD.org
Makefile ident:      $FreeBSD: head/devel/RStudio/Makefile 514646 2019-10-17 07:06:44Z yuri $
Poudriere version: 3.3.2_1
Host OSVERSION: 1300053
Jail OSVERSION: 1201500
Job Id: 02

---Begin Environment---
SHELL=/bin/csh
OSVERSION=1201500
UNAME_v=FreeBSD 12.1-STABLE 1201500
UNAME_r=12.1-STABLE
BLOCKSIZE=K
MAIL=/var/mail/root
STATUS=1
HOME=/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
LOCALBASE=/usr/local
USER=root
LIBEXECPREFIX=/usr/local/libexec/poudriere
POUDRIERE_VERSION=3.3.2_1
MAKEOBJDIRPREFIX=/pool/sources/12-STABLE/obj/
MASTERMNT=/pool/poudriere/data/.m/12-amd64-head-default/ref
POUDRIERE_BUILD_TYPE=bulk
PACKAGE_BUILDING=yes
SAVED_TERM=screen
PWD=/pool/poudriere/data/.m/12-amd64-head-default/ref/.p/pool
P_PORTS_FEATURES=FLAVORS SELECTED_OPTIONS
MASTERNAME=12-amd64-head-default
SCRIPTPREFIX=/usr/local/share/poudriere
OLDPWD=/pool/poudriere/data/.m/12-amd64-head-default/ref/.p
SCRIPTPATH=/usr/local/share/poudriere/bulk.sh
POUDRIEREPATH=/usr/local/bin/poudriere
---End Environment---

---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=
DEPENDS_ARGS=
MAKE_ARGS=
---End Poudriere Port Flags/Env---

---Begin OPTIONS List---
---End OPTIONS List---


The error is:


[...]
--- src/cpp/r/CMakeFiles/rstudio-r.dir/all ---
--- src/cpp/r/CMakeFiles/rstudio-r.dir/session/graphics/RGraphicsErrorCategory.cpp.o ---
[ 48%] Building CXX object src/cpp/r/CMakeFiles/rstudio-r.dir/session/graphics/RGraphicsErrorCategory.cpp.o
cd /wrkdirs/usr/ports/devel/RStudio/work/.build/src/cpp/r && /usr/bin/c++  -DBOOST_ASIO_DISABLE_KQUEUE -DBOOST_ENABLE_ASSERT_HANDLER -DBOOST_SIGNALS_NO_DEPRECATION_WARNING -DRSTUDIO_BOOST_NAMESPACE=boost -DRSTUDIO_BOOST_SIGNALS_VERSION=2 -DWEBSOCKETPP_STRICT_MASKING -D_FORTIFY_SOURCE=2 -D_WEBSOCKETPP_NO_CPP11_MEMORY_=1 -I/wrkdirs/usr/ports/devel/RStudio/work/rstudio-1.2.5001/src/cpp/r/include -I/wrkdirs/usr/ports/devel/RStudio/work/.build/src/cpp/r -I/wrkdirs/usr/ports/devel/RStudio/work/rstudio-1.2.5001/src/cpp/core/include -I/usr/local/lib/R/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -std=c++0x -std=c++11 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC   -Wall -pthread -Wformat -Wformat-security -fstack-protector --param ssp-buffer-size=4 -fPIC -o CMakeFiles/rstudio-r.dir/session/graphics/RGraphicsErrorCategory.cpp.o -c /wrkdirs/usr/ports/devel/RStudio/work/rstudio-1.2.5001/src/cpp/r/session/graphics/RGraphicsErrorCategory.cpp
--- src/gwt/CMakeFiles/gwt_build.dir/all ---

BUILD FAILED
/wrkdirs/usr/ports/devel/RStudio/work/rstudio-1.2.5001/src/gwt/build.xml:110: Java returned: 1
Comment 1 Rainer Hurling freebsd_committer freebsd_triage 2019-10-21 16:12:47 UTC
Hi Oliver,

I had the very same error outside of Poudriere on 13.0-CURRENT.

I my case, it turns out, that having two versions of java installed (java/openjdk8, java/openjdk12) caused the trouble. After removing openjdk12, the build of RStudio works like expected.

Is it possible, that there are also two versions in your Poudriere for some reason?

Regards,
Rainer
Comment 2 Trond Endrestøl 2020-01-23 20:02:01 UTC
I ran into the same issue on 13.0-CURRENT, r356768, ports tree at r523938. However, I use ports-mgmt/synth, and the log file contains some lines that may provide clues:

--- src/gwt/CMakeFiles/gwt_build.dir/all ---
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Compiling 2231 source files to /construction/xports/devel/RStudio/work/rstudio-1.2.5033/src/gwt/bin
    [javac] /construction/xports/devel/RStudio/work/rstudio-1.2.5033/src/gwt/src/org/rstudio/core/client/resources/ImageResourceUrl.java:62: warning: [deprecation] getURL() in ImageResource has been deprecated
    [javac]    public String getURL()
    [javac]                  ^
    [javac] /construction/xports/devel/RStudio/work/rstudio-1.2.5033/src/gwt/src/org/rstudio/studio/client/projects/model/ProjectTemplateIconImageResource.java:53: warning: [deprecation] getURL() in ImageResource has been deprecated
    [javac]    public String getURL()
    [javac]                  ^
    [javac] 2 warnings
     [copy] Copying 1477 files to /construction/xports/devel/RStudio/work/rstudio-1.2.5033/src/gwt/bin
gwtc:
     [java] Jan 23, 2020 7:45:32 PM java.util.prefs.FileSystemPreferences$1 run
     [java] INFO: Created user preferences directory.
--- src/gwt/CMakeFiles/gwt_build.dir/all ---
     [java] [ERROR] Unexpected internal compiler error
     [java] java.lang.UnsatisfiedLinkError: sun.nio.fs.LinuxWatchService.inotifyInit()I
     [java]     at sun.nio.fs.LinuxWatchService.inotifyInit(Native Method)
     [java]     at sun.nio.fs.LinuxWatchService.<init>(LinuxWatchService.java:59)
     [java]     at sun.nio.fs.BsdFileSystem.newWatchService(BsdFileSystem.java:51)
     [java]     at com.google.gwt.dev.resource.impl.ResourceAccumulator.maybeInitializeWatchService(ResourceAccumulator.java:98)
     [java]     at com.google.gwt.dev.resource.impl.ResourceAccumulator.fullRefresh(ResourceAccumulator.java:89)
     [java]     at com.google.gwt.dev.resource.impl.ResourceAccumulator.refreshResources(ResourceAccumulator.java:69)
     [java]     at com.google.gwt.dev.resource.impl.ResourceAccumulatorManager.getResources(ResourceAccumulatorManager.java:113)
     [java]     at com.google.gwt.dev.resource.impl.DirectoryClassPathEntry.findApplicableResources(DirectoryClassPathEntry.java:49)
     [java]     at com.google.gwt.dev.resource.impl.ResourceOracleImpl.scanResources(ResourceOracleImpl.java:263)
     [java]     at com.google.gwt.dev.cfg.ModuleDef.ensureResourcesScanned(ModuleDef.java:731)
     [java]     at com.google.gwt.dev.cfg.ModuleDef.getSourceResourceOracle(ModuleDef.java:567)
     [java]     at com.google.gwt.dev.CompilerContext$Builder.initializeResourceOracles(CompilerContext.java:100)
     [java]     at com.google.gwt.dev.CompilerContext$Builder.build(CompilerContext.java:48)
     [java]     at com.google.gwt.dev.Compiler.compile(Compiler.java:193)
     [java]     at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
     [java]     at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
     [java]     at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
     [java]     at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
     [java]     at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
     [java]     at com.google.gwt.dev.Compiler.main(Compiler.java:125)

BUILD FAILED
/construction/xports/devel/RStudio/work/rstudio-1.2.5033/src/gwt/build.xml:110: Java returned: 1

Could the last error messages indicate some incompatibility with the Linux ecosystem, e.g. system calls related to filesystems?

Also, from the discussion above, neither Poudriere nor synth pulls in any other JDK than the one(s) specified by the port's Makefile.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2020-01-23 20:37:46 UTC
When built in poudriere, a higher limit for the file descriptor count should be set for RStudio.

Please add this line to etc/poudriere.conf
MAX_FILES_RStudio=4096

Yuri
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2020-01-23 20:39:00 UTC
Please reopen if this is still a problem even with the poudriere.conf setting and with an extra-java version removed.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2020-01-24 04:10:27 UTC
It appears that it is really failing in poudriere.
Comment 6 Yuri Victorovich freebsd_committer freebsd_triage 2020-01-24 04:22:41 UTC
Build fails with Java 8 and Java 11: https://github.com/rstudio/rstudio/issues/6088
Comment 7 Trond Endrestøl 2020-02-19 06:14:23 UTC
The commit r526466 made RStudio build and run on my laptop running head r358073. Thank you!
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2020-02-19 06:23:39 UTC
(In reply to Trond.Endrestol from comment #7)

Thanks!