RStudio Server compile error on arm64 machine?

@andresrcs @jonathan, and @GaryR Hello! I am glad this post is still open. I was about to open an issue on RStudio's Github because I have not been able to find a solution online or with Gemini.

I have been resolving issues as they arrive, but this gwt/build.xml error I can't figure out.

Architecture: Ubuntu (Jammy) arm64, building from source.

I will start with where I am at:

# Configure cmake and build RStudio
cd ~/Downloads/rstudio-$VERS/
mkdir build
 cmake -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release -DRSTUDIO_PACKAGE_BUILD=1 # ADDED: -DRSTUDIO_PACKAGE_BUILD=1 this forces you to be in main directory.
 make install

Build Error:

[ 40%] Built target rstudio-r
[ 79%] Built target rsession
[ 79%] Building GWT sources
Buildfile: /root/Downloads/rstudio-2024.04.2-764/src/gwt/build.xml
[available] DEPRECATED - <available> used to override an existing property.
[available]   Build file should not reuse the same property name for different values.

i18n-checksum:
     [echo] Commands.cmd.xml i18n checksum matches: true

i18n-unix-check:

i18n-unix:

i18n-windows-check:

i18n-windows:

generate-i18n:

ext:
   [jscomp] None of the files changed. Compilation skipped.

javac:
    [javac] Compiling 1 source file to /root/Downloads/rstudio-2024.04.2-764/src/gwt/bin

gwtc:

panmirror:
     [echo] yarn location: ../../dependencies/common/node/18.18.2/bin/yarn
     [echo] panmirror location: ./lib/quarto/apps/panmirror
     [echo] panmirror minify: true
     [exec] /usr/bin/env: ‘node’: No such file or directory

BUILD FAILED
/root/Downloads/rstudio-2024.04.2-764/src/gwt/build.xml:189: The following error occurred while executing this line:
/root/Downloads/rstudio-2024.04.2-764/src/gwt/build.xml:142: exec returned: 127

Total time: 0 seconds
make[2]: *** [gwt/CMakeFiles/gwt_build.dir/build.make:2699: gwt/timestamp] Error 1
make[1]: *** [CMakeFiles/Makefile2:491: gwt/CMakeFiles/gwt_build.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

So I research this comment: [exec] /usr/bin/env: ‘node’: No such file or directory

I found a node directory in this path, ~/Downloads/rstudio-2024.04.2-764/src/node, but not in the gwt path, ~/Downloads/rstudio-2024.04.2-764/src/gwt

I am not sure where this file is supposed to be. Also, I could not make heads or tails of lines 142 or 189 in the build.xml file, but I did find this post in GitHub#9463, which seems related because it recreates my error.

This line in the issue recreates my issue:

/usr/local/bin/ant -Dbuild.dir="bin" -Dwww.dir="www" -Dextras.dir="extras" -Dlib.dir="lib" -Dgwt.main.module="org.rstudio.studio.RStudio"

Thanks!

I think you can try installing your own gwt compiler with something like this

BTW for Ubuntu Jammy there is no need to compile RStudio on your own, you can simply download a precompiled binary from their daily builds page

Great! I will try that now.

Yes, I did see that they have daily builds, but we are trying to add RStudio Server on top of another image that has all of the R packages with have built internally and are used in production. Those are based on images that are core to our tech stack. So, unfortunately, I don't think we can use the daily builds. Would you agree?

The R package library (as well as the R interpreter) is completely independent from the RStudio IDE so I don't see how one could interfiere with the other.

First, this link returns a 404 error: https://dl.google.com/closure-compiler/compiler-latest.zip

Both http and https give the 404 error. I tried on the browser and the same response

I think the issue arises is the docker file when you reference FROM first image... FROM RStudio image. Won't there be conflicts in file locations and symlinks?

Maybe I am not understanding the process. Could you clarify?

I just found this post:

As of 2020-08 this page is no longer updated. Existing downloads will remain available, however no new versions will be posted here and the -latest symlinks no longer exist.

At this google page: Binary Downloads · google/closure-compiler Wiki · GitHub

Are these the same/related to the ones you posted?

Yes, you would need to figure out the link of the last published version. I no longer keep track of that since I use the pre-built binaries

Sorry but I don't understand your question, what would be the difference with symlinks of an RStudio version you compile yourself with the ones created by installing a precompiled binary? I fail to see the potential issue.
The only things with symlinks are embedded complements, not R packages which are loaded from the folder set in your startup variables (i.e. your .libPaths())

You don't need to install the GWT tools, they are included in the RStudio repo, and are not the same as the ones you would download (we use a fork of GWT, not vanilla GWT).

The actual error is "[exec] /usr/bin/env: ‘node’: No such file or directory" and this means the build tool ("ant" in this case) cannot find node.js, which is required for building panmirror (the visual editor). If you are using the dependency scripts to install things it should have put the correct version of node.js in the expected location. Or you can try putting node.js on the path before building and see if that is sufficient (we currently use version 20.15.1, but any relatively recent version should work). If you don't use the version installed by the dependency scripts you'll also need to make sure you have yarn installed into the instance of node.js you have on the path.

I did use the Rstudio dependency script as part of the build. It is the install make where things break.

bash install-dependencies-jammy --exclude-qt-sdk

And when you mean yarn, you are do not mean Apache yarn? You mean some other yarn, correct?

@andresrcs Good morning!

I installed the binary server from the daily builds. It the installation in the docker container completed, and it seems that RStudio Server is running, but when I go to local 8787, it does not connect.

Do you know if there is any docs on installing, or how to get connected to the server?

Thanks!!

Correct. yarn as in yarn - npm. However, since you are already running the dependency script, you shouldn't have to deal with installing node or yarn.

I'll need to fire up a VM and try building the way you are doing it; that's not something we do routinely so it's possible something is missing/outdated in the instructions. I'll kick that off on the side and see what I see.

FWIW, our "official" builds are done via the dockerfiles in the repository, e.g. rstudio/docker/jenkins/Dockerfile.jammy, along with the package build scripts, e.g. rstudio/package/linux/make-server-package. This ultimately spits out a DEB file (or RPM as applicable), versus building and installing directly. However, it's also not fully documented for external use so you'd need to wade through rstudio/docker/docker-compile.sh to unravel the secrets. I haven't tested that docker-compile.sh script recently so it may or may not work without some tweaking.

Sorry I don't use docker much but since RStudio Server is running I think you just need to make sure docker (or maybe a firewall in Ubuntu) is exposing the 8787 port to the outside world.

I believe that's accurate ("you just need to make sure docker is exposing the 8787 port to the outside world") but this isn't something I've played with recently.

You might also want to check this out (not a Posit supported thing): https://rocker-project.org/

1 Like

Yes, I tried running the docker-compile.sh script and I had build issues with it. But that was many experiments ago and I don't remember the exact error.

I believe the installing the binary might have the least rabbit holes to follow. In the picture below, you can see that the container with the .deb included is running, but I can't seem to reach the RStudio log in page on local host 8787.

@GaryR @andresrcs I got it working...with a help of a co-worker. Hopefully those errors below are not that significant.

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

2024-07-30T18:19:38.713271Z [rsession-rstudio] ERROR r error 4 (Error in source("/usr/lib/rstudio-server/R/modules/SessionAutomationRemote.R",  : 
  /usr/lib/rstudio-server/R/modules/SessionAutomationRemote.R:206:27: unexpected string constant
209:       container.env.editor
210:    }'
                               ^
) [errormsg: Error in source("/usr/lib/rstudio-server/R/modules/SessionAutomationRemote.R",  : 
  /usr/lib/rstudio-server/R/modules/SessionAutomationRemote.R:206:27: unexpected string constant
209:       container.env.editor
210:    }'
                               ^
]; OCCURRED AT rstudio::core::Error rstudio::r::exec::evaluateString(const string&, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::EvalFlags) src/cpp/r/RExec.cpp:388; LOGGED FROM: rstudio::core::Error rstudio::session::modules::automation::initialize() src/cpp/session/modules/automation/SessionAutomation.cpp:67
2024-07-30T18:19:38.966029Z [rsession-rstudio] INFO No keybindings/editor_bindings.json found at /etc/rstudio/keybindings/editor_bindings.json
2024-07-30T18:19:38.966401Z [rsession-rstudio] INFO No keybindings/rstudio_bindings.json found at /etc/rstudio/keybindings/rstudio_bindings.json
2024-07-30T18:19:38.966696Z [rsession-rstudio] INFO No keybindings/addins.json found at /etc/rstudio/keybindings/addins.json
> .libPaths()
[1] "/home/rstudio/R/aarch64-unknown-linux-gnu-library/3.6" "/opt/R/3.6.3/lib/R/library"   

@GaryR Just an FYI, I was following these steps to get the build to work before using the binary. I was solving the issues that arose in this script until I hit the GWT compiler issue. Not sure if you wanted to test this out in the VM.

No, I won't have time to mess with that. I am curious why version 0.99.473? That's almost 10 years old!

I'm not familiar with those errors you are seeing; I'm going to look into that (I have some suspicions, but don't know offhand if they indicate an actual problem or not).

FYI, I just opened an issue related to one of the errors you are seeing. I suspect it is harmless, and only happens with "older" versions of R such as 3.6.3 but we'll check into it.