R compile-Server
git clone --recursive [email protected]:PRL-PRG/r-compile-server.gitor
git clone --recursive https://github.com/PRL-PRG/r-compile-server.gitThis shall clone also the submodules. If you forgot to clone the submodules, you can run
git submodule update --init --recursiveTo 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:
- Install Docker
- Install Jetbrains Gateway
- Launch JetBrains Gateway and select "Create Dev Container", set "Git Repository" to "https://github.com/PRL-PRG/r-compile-server.git" or "[email protected]/PRL-PRG/r-compiler-server.git", then click "Build Container and Continue".
- The process is also described at https://www.jetbrains.com/help/idea/connect-to-devcontainer.html#start_from_gateway.
- If everything works, the dev container should build and you can click "Continue" to launch the project. If not, see troubleshooting.
If the dev container is too slow, you can also setup on the host machine. To do so, must install the following dependencies:
- Java 24 and Maven 3
- IntelliJ will automatically install these. If not, you can download a Java 24 binary from https://adoptium.net/temurin/releases/?version=24, and Maven from https://maven.apache.org/download.cgi.
- If you are using IntelliJ, navigate to "Project Structure > Project" and make sure the *SDK is set to a JDK of version 24 (e.g. "openjdk-24"). If not, click the dropdown and "Download JDK", then select any JDK of version 24.
- Run
make setupto initialize the dependencies- It installs GNU-R in
external/R.
- It installs GNU-R in
- Run
make setup-gitto install Git Hooks. The commit hook formats, the pre-push hook runs tests and static analyses. - Build with
makeormvn package - Test (no static analyses) with
make testormvn test - Test and static anaylses with
make checkormvn verify - Format with
make formatormvn spotless:apply. This requires to havenpminstalled.
- 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 rungit init. Note that you won't be able to push changes or create a PR since it's not a proper git repo.
- This happens if you downloaded a ZIP instead of
- Problem: In Maven,
Fatal error compiling: invalid target release: 24- Solution: ensure you have a Java 24 JDK installed, then run
JAVA_HOME=<path to JDK 24> mvn …- e.g. if using IntelliJ on macOS, openJDK 24, set
JAVA_HOME=~/Library/Java/JavaVirtualMachines/openjdk-24/Contents/Home - In the devcontainer,
JAVA_HOME=/usr/lib/jvm/jdk
- e.g. if using IntelliJ on macOS, openJDK 24, set
- Solution: ensure you have a Java 24 JDK installed, then run
- Problem: some R symbols are not visible when JIT-compiling.
- Solution: make sure that
external/Ris up-to-date withgit submodule update --init --recursiveand check if it is the right branch,RSH-4-3-2.
- Solution: make sure that
If you have a different issue than the above, report it on GitHub.
In this project, all values are considered non-null unless specified as @Nullable.
To enforce this, every package must have a package-info.json with the following code:
@ParametersAreNonnullByDefault
@FieldsAreNonNullByDefault
@ReturnTypesAreNonNullByDefault
package org.prlprg.<package-name>;
import org.prlprg.util.FieldsAreNonNullByDefault;
import org.prlprg.util.ReturnTypesAreNonNullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;In IntelliJ you can simply copy package-info.json from any package into the new one and it will automatically change the package path.