Skip to content

About

New R compile server

Resources

Stars

5 stars

Watchers

5 watching

Forks

Repository files navigation

R compile-Server

Setup (development)

Clone the repository

git clone git@github.com:PRL-PRG/r-compile-server.git
# or: git clone https://github.com/PRL-PRG/r-compile-server.git
cd r-compile-server
git submodule update --init --depth 1

The R submodule is a fork of GNU-R. --depth 1 skips its history since 1997, which is about 400 MiB. (git clone --recurse-submodules --shallow-submodules doesn't help as much, because the pinned commit isn't a branch tip.) To fetch the history later, run git -C R fetch --unshallow.

Install git LFS and run make setup-git (below) before committing. The stdlib test snapshots are stored in LFS, and aren't downloaded unless you ask for them (see server/src/test/java/org/prlprg/snapshot/package-info.java).

From dev container

To quickly get started with development, you can use the project's Dev Container. We strongly recommend using IntelliJ.

To run the IntelliJ inside the dev container:

Manually

If the dev container is too slow, you can also setup on the host machine. To do so, must install the following dependencies:

  • Java 26 and Maven 4
    • IntelliJ will automatically install these. If not, you can download a Java 26 binary from https://adoptium.net/temurin/releases/?version=26, and Maven from https://maven.apache.org/download.cgi.
    • Alternatively, run server/mvnw instead of mvn: it downloads the pinned Maven version (see server/.mvn/wrapper/maven-wrapper.properties) on first use. This is what CI does.
    • If you are using IntelliJ, navigate to "Project Structure > Project" and make sure the *SDK is set to a JDK of version 26 (e.g. "openjdk-26"). If not, click the dropdown and "Download JDK", then select any JDK of version 26.

Commands

  • Run make setup to initialize the dependencies
    • It installs GNU-R in R.
  • Run make setup-git to install Git Hooks. The commit hook formats, and git lfs install adds the LFS hooks (the pre-push hook uploads LFS objects).
  • Build with make or mvn package
  • Test (no static analyses) with make test or mvn test
  • Test and static anaylses with make check or mvn verify
  • Format with make format or mvn spotless:apply. This requires to have npm installed.

Troubleshooting

  • Problem: In Maven, Could not find or initialize a local git repository. A repository is required
    • This happens if you downloaded a ZIP instead of git clone-ing. The solution is to run git init. Note that you won't be able to push changes or create a PR since it's not a proper git repo.
  • Problem: In Maven, Fatal error compiling: invalid target release: 26
    • Solution: ensure you have a Java 26 JDK installed, then run JAVA_HOME=<path to JDK 26> mvn …
      • e.g. if using IntelliJ on macOS, openJDK 26, set JAVA_HOME=~/Library/Java/JavaVirtualMachines/openjdk-26/Contents/Home
      • In the devcontainer, JAVA_HOME=/usr/lib/jvm/jdk
  • Problem: some R symbols are not visible when JIT-compiling.
    • Solution: make sure that R is up-to-date with git submodule update --init --depth 1 and check if it is the right branch, RCS-4-5-2.

If you have a different issue than the above, report it on GitHub.

Development Notes

In this project, all values are considered non-null unless specified as @Nullable.

To enforce this, every package must have a package-info.java with the following code:

@NullMarked
package org.prlprg.<package-name>;

import org.jspecify.annotations.NullMarked;

In IntelliJ you can simply copy package-info.java from any package into the new one and it will automatically change the package path.

About

New R compile server

Resources

Stars

5 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages