Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC2C compiler with client #19

Merged
merged 282 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
282 commits
Select commit Hold shift + click to select a range
2bc9e64
Routes + flexible messages to get updated facts about a function for …
programLyrique Jul 2, 2024
51f212d
Adding contexts
programLyrique Jul 9, 2024
4f55193
Rebased with master
fikovnik Jul 9, 2024
b2d54c6
Add tool-versions
fikovnik Jul 9, 2024
48fcc0c
TYpeFeedback message
programLyrique Jul 10, 2024
60bfc1f
Start the compile service.
programLyrique Jul 10, 2024
08ee5bc
Skeleton of the compilation to bytecode
programLyrique Jul 10, 2024
a3ef301
Add support for closure calls
fikovnik Jul 10, 2024
f2314b9
Add support for closure calls
fikovnik Jul 10, 2024
2cba2b9
gRPC reflection and Rsession
programLyrique Jul 11, 2024
96838e6
External test of the server
programLyrique Jul 11, 2024
633a1d1
Add Defn.h
fikovnik Jul 12, 2024
dcdcffe
Always refer to function and packages through hashes
programLyrique Jul 12, 2024
3c70250
Inlining
fikovnik Jul 12, 2024
bd60b1e
Reorganize messages and add health service
programLyrique Jul 18, 2024
4407ce3
Add tests for the InitRequest
programLyrique Jul 18, 2024
a4f6234
WIP on compile request
programLyrique Jul 18, 2024
5f74725
Merge branch 'main' into server-rpc
programLyrique Jul 18, 2024
dba6aaf
Test the compile request
programLyrique Jul 19, 2024
33b7f78
Read a package database (rdx and rdb)
programLyrique Jul 19, 2024
a1eef99
Testing the GNURSession
programLyrique Jul 19, 2024
d683438
Read rdb files.
programLyrique Jul 22, 2024
69b576f
Adding a persistent hook for reading environments
programLyrique Jul 22, 2024
0d598ea
Correct env hook + refactor
programLyrique Jul 23, 2024
b0cab65
WIP: adding basic ALTREP support (at least for ALTREP classes used in…
programLyrique Jul 24, 2024
208a102
WIP: AltRep unserialization support for base function
programLyrique Jul 25, 2024
6f840dd
Correctly unserializing AltRep compact_intseq
programLyrique Jul 26, 2024
dc23cfd
Fixes
fikovnik Jul 29, 2024
fa18941
Correctly read non special environments referred by PersistSXP in a p…
programLyrique Jul 30, 2024
5ec8970
PERSISTSXP envs: correctly add cycles back
programLyrique Jul 31, 2024
e0a56d1
Load base and create Package and Namespace envs
programLyrique Jul 31, 2024
153df06
Setup a package namespace before reading its database
programLyrique Jul 31, 2024
a4a9ad9
Move to NAN boxing and binding cells
fikovnik Jul 31, 2024
03c2e30
Fixes to BCell
fikovnik Aug 1, 2024
d4efb4b
Load package with package name and package version
programLyrique Aug 1, 2024
5b0c0d2
Add support for ADD
fikovnik Aug 1, 2024
a82a2d6
Almost LT
fikovnik Aug 1, 2024
11b040e
Add LGL support
fikovnik Aug 2, 2024
7a2a546
Cleanup
fikovnik Aug 2, 2024
715f7cc
Use of X macros
fikovnik Aug 2, 2024
7f18e83
Fixes
fikovnik Aug 2, 2024
562a519
Compile route test now works
programLyrique Aug 2, 2024
ebd215e
Update flags
fikovnik Aug 2, 2024
42e150f
Merge branch 'backend' into server-rpc
programLyrique Aug 2, 2024
15939b1
Add support for calling functions
fikovnik Aug 2, 2024
42e33f2
Add back Filip's rsh compiler (service package)
programLyrique Aug 2, 2024
ecad026
Cleanup
fikovnik Aug 5, 2024
eb306f7
Broken LGL
fikovnik Aug 5, 2024
ef8d2fe
Fix LGL
fikovnik Aug 5, 2024
9630f6d
Fix NA
fikovnik Aug 6, 2024
28ebf0b
Refactoring
fikovnik Aug 6, 2024
da2fd6d
Before cleanup
fikovnik Aug 6, 2024
9404360
Remove the persist env from the list of bindings of a package
programLyrique Aug 6, 2024
24e8c5d
Fixes
fikovnik Aug 6, 2024
8912bda
Merge branch 'main' into backend
fikovnik Aug 6, 2024
d6ecace
Update directory structure
fikovnik Aug 6, 2024
71933b1
Add R 4.3.2
fikovnik Aug 6, 2024
de720f1
Update R after recompilation
fikovnik Aug 6, 2024
1b8e2f9
Update R path
fikovnik Aug 7, 2024
a1f061c
Merge branch 'backend' into server-rpc
programLyrique Aug 7, 2024
fc4ca56
Fix paths due to the new monorepo structure
programLyrique Aug 7, 2024
132039d
Move to submodule
fikovnik Aug 7, 2024
b0c37fd
Fix the submodule and build
fikovnik Aug 7, 2024
1dced1f
Env variables for the paths to R and to libraries
programLyrique Aug 7, 2024
640f9ca
Merge branch 'backend' into server-rpc
programLyrique Aug 7, 2024
d2e87bd
Proto files in a folder at teh root of the project so that they can b…
programLyrique Aug 7, 2024
ff53135
Do not pollute git status with untracked files in the R we install.
programLyrique Aug 7, 2024
16ba110
Migrate to embedded R
fikovnik Aug 7, 2024
14a11e5
Fixes
fikovnik Aug 8, 2024
19a66e1
Merge branch 'backend' of github.com:PRL-PRG/r-compile-server into ba…
fikovnik Aug 8, 2024
a3ac20a
Update R version
programLyrique Aug 8, 2024
7c8b1ce
Fixes
fikovnik Aug 8, 2024
fd90952
Merge branch 'backend' into server-rpc
programLyrique Aug 8, 2024
4cc2d50
Makefile to generate C++ files from the proto
programLyrique Aug 8, 2024
8a1afd5
Add end-to-end test
fikovnik Aug 9, 2024
f2d3ed9
Start of gRPC in the client
programLyrique Aug 9, 2024
91662a9
Client initialization
programLyrique Aug 12, 2024
0cf37f8
Description Parsing Added
Revanth-Kumar-Vennu Aug 13, 2024
b63cbae
Add tests for arithmetics
fikovnik Aug 19, 2024
7d8a416
Add tests for relop
fikovnik Aug 19, 2024
55b84e7
Add support for sqrt and exp
fikovnik Aug 19, 2024
b773c64
Fixed the Value representation
fikovnik Aug 20, 2024
7998af5
Add support for logicals
fikovnik Aug 20, 2024
606182f
Refactored BC2CCompiler
fikovnik Aug 21, 2024
c4049d1
Make closure - not working using .Call
fikovnik Aug 21, 2024
01da228
Moved to .External2
fikovnik Aug 21, 2024
9e5a755
Add CheckFun
fikovnik Aug 22, 2024
1d09e8a
Fixes to make the itest working again
fikovnik Aug 22, 2024
746b083
Remove the precompiled headers
fikovnik Aug 22, 2024
87510b7
Ignore .gdb_history
fikovnik Aug 22, 2024
fd4300b
Changes made according to the review
Revanth-Kumar-Vennu Aug 23, 2024
1bd3660
Experimenting...
fikovnik Aug 27, 2024
30b684a
Working both tests and JIT
fikovnik Aug 27, 2024
2dfd46d
Cleanup
fikovnik Aug 27, 2024
56be0a5
Remove lib.cpp
fikovnik Aug 27, 2024
6cfaf59
Rename all C++ headers to .hpp
fikovnik Aug 27, 2024
abd86a4
Move runtime.c into bc2c
fikovnik Aug 27, 2024
8373ba6
Implement MakeProm
fikovnik Aug 27, 2024
3d657f2
Add support for setting optimization level from environemnt variable
fikovnik Aug 27, 2024
e7b299f
Fix make promise
fikovnik Aug 29, 2024
796181a
Fix promise
fikovnik Aug 29, 2024
4733f6c
Fix options in rsh_cmpfun
fikovnik Aug 29, 2024
7b145d6
Refactoring the package to be compatible with tests
fikovnik Aug 30, 2024
70b7162
Fix BC unit tests
fikovnik Sep 1, 2024
b9cbf74
Spotless
fikovnik Sep 1, 2024
f57e659
Merge pull request #21 from PRL-PRG/server-rpc-feature2
programLyrique Sep 2, 2024
325bdac
Correctly compiling grpc C++ side
programLyrique Sep 2, 2024
5918a9b
Fix unboxing double in relop
fikovnik Sep 2, 2024
4fb8d86
Add benchmarks
fikovnik Sep 2, 2024
90f72ef
Fix relop
fikovnik Sep 2, 2024
cc0a45d
Now compiles and connects to the server.
programLyrique Sep 3, 2024
4c9470e
Namespace for proto for the java version also
programLyrique Sep 3, 2024
9285e0d
Make rsh loadable with list library(rsh)
fikovnik Sep 4, 2024
8bb9d3b
Make it easier to test
programLyrique Sep 4, 2024
6ffc174
Propagate errors in the rsh package
programLyrique Sep 4, 2024
00dc535
Compile to bytecode
programLyrique Sep 4, 2024
9ee42e3
Adding hashing
programLyrique Sep 4, 2024
5b46073
Correctly support names for the optimized native code
programLyrique Sep 5, 2024
35d8a14
Now with a cache
programLyrique Sep 5, 2024
db1deb3
Adding optimisation level to the key for the bc cache
programLyrique Sep 5, 2024
718e704
Caching: does not recompile if body (and enclosure) is not changed.
programLyrique Sep 5, 2024
48db12c
Fix some paths to have the package test pass
programLyrique Sep 5, 2024
73d82fb
Remove ZeroMQ
programLyrique Sep 5, 2024
68ca096
Merge branch 'backend' into server-rpc
programLyrique Sep 5, 2024
1cc9a16
Update API and tests
fikovnik Sep 6, 2024
c31af87
Merge branch 'backend' into server-rpc
programLyrique Sep 6, 2024
e845e4a
Fix test to follow new API
programLyrique Sep 6, 2024
d0de919
Native code compilation: integration of JITService
programLyrique Sep 6, 2024
35d5f42
Add support DOLLAR_OP
fikovnik Sep 9, 2024
7e3168a
Remove JItService, port it into the CompileService. Native code caching.
programLyrique Sep 9, 2024
39d5b04
Get rid of the tinytest
fikovnik Sep 9, 2024
adb3a3b
Updated tests and benchmarks
fikovnik Sep 9, 2024
f375196
Fixes
fikovnik Sep 9, 2024
dc6bb5a
Remove the call_fun and use just the trampoline
fikovnik Sep 9, 2024
3540570
Add profile for benchmarking
fikovnik Sep 9, 2024
1e8cbe0
Update Makefile and add some docs
fikovnik Sep 9, 2024
88e6209
More readable C function names
programLyrique Sep 10, 2024
38dc546
Idea stuff
programLyrique Sep 10, 2024
6aee69a
Clean the idea config so that it works again
programLyrique Sep 10, 2024
39a4e6b
Add support for [
fikovnik Sep 11, 2024
b21d2ae
Add support for [[
fikovnik Sep 11, 2024
b3c8e74
First try on assign
fikovnik Sep 11, 2024
bb0c358
Fix to allow the fast path
fikovnik Sep 11, 2024
bc892d8
Add support for subassign - still need to test
fikovnik Sep 13, 2024
b6089e1
Move to a new compiler layout
fikovnik Sep 14, 2024
ecea80e
Update instructions
fikovnik Sep 14, 2024
dd6f7da
Update instructions
fikovnik Sep 14, 2024
9f7c75a
Update instructions
fikovnik Sep 14, 2024
b7cba8d
Simplify
fikovnik Sep 14, 2024
48031ea
Fixes
fikovnik Sep 14, 2024
0f2dae0
Fix test
fikovnik Sep 14, 2024
b90af97
First shot at snapshots
fikovnik Sep 18, 2024
4833aa1
Native code caching
programLyrique Sep 23, 2024
fe14491
.gitignore
programLyrique Sep 23, 2024
aacf8db
Snapshot test WIP
fikovnik Sep 23, 2024
2f1a2a8
Merge branch 'backend' into server-rpc
programLyrique Sep 23, 2024
75a0a2e
More snapshot tests
fikovnik Sep 24, 2024
02a37a1
Add code to snapshots
fikovnik Sep 24, 2024
d465ad5
WIP
fikovnik Sep 24, 2024
fc8555c
WIP
fikovnik Sep 24, 2024
c674593
Fix tests
programLyrique Sep 24, 2024
ce18840
Normal port for test 6
programLyrique Sep 24, 2024
3f9031b
Add protobuf and grpc in the devcontainer
programLyrique Sep 25, 2024
71f69ab
Abstract symbol generation
programLyrique Sep 27, 2024
c32698c
Fixed snapshots bug
fikovnik Sep 28, 2024
6a16c9c
Another try
fikovnik Sep 29, 2024
ab5cb2e
Updates
fikovnik Sep 30, 2024
df2edd9
Cache and native compilation now work
programLyrique Sep 30, 2024
ffa7c38
Updates
fikovnik Oct 1, 2024
004147b
Make GNUR injected
fikovnik Oct 1, 2024
ae99d47
Merge branch 'backend' into server-rpc
programLyrique Oct 1, 2024
88f961b
Refactored snapshots
fikovnik Oct 1, 2024
c5a76e1
Session tests now use the R that is included in external/R
programLyrique Oct 1, 2024
112403e
Fix BC2C tests.
programLyrique Oct 1, 2024
ee1ef08
Cleaned up snapshots
fikovnik Oct 1, 2024
261aba3
Fixed tests
fikovnik Oct 1, 2024
4175b94
Fix PMD issue
fikovnik Oct 1, 2024
2f19c34
FIX: the body wrapper needs to have a reference to its closure
programLyrique Oct 4, 2024
2b4d069
Benchmakrs now run correctly~
programLyrique Oct 4, 2024
eca99c5
Verify working
fikovnik Oct 4, 2024
e3fac46
Fix RDS writer tests.
programLyrique Oct 4, 2024
82a55f6
Fix makefiles
fikovnik Oct 5, 2024
ecd7ff3
WIP - SETTER_CALL
fikovnik Oct 7, 2024
df5eba3
WIP - SETTER_CALL - special
fikovnik Oct 7, 2024
1879f28
SETTER_CALL
fikovnik Oct 7, 2024
f4efa4a
WIP - subassign
fikovnik Oct 7, 2024
4720a43
WIP - subset
fikovnik Oct 8, 2024
78d917e
WIP - super assign
fikovnik Oct 8, 2024
09214bb
WIP - matrix subset
fikovnik Oct 8, 2024
a55e65b
Refactored
fikovnik Oct 8, 2024
fb7806d
Refactoring 2
fikovnik Oct 8, 2024
1ad2487
Matsubassign
fikovnik Oct 8, 2024
5986e31
Matsubassign
fikovnik Oct 8, 2024
b4d9552
Subset
fikovnik Oct 9, 2024
10daeed
Subset finished
fikovnik Oct 9, 2024
c0d6508
Getter
fikovnik Oct 9, 2024
ddff33f
FIX: for in-place bytecode compilation, the bytecode body was wrongly…
programLyrique Oct 10, 2024
9b091cc
Fix path problems + script to compile all the closures in a package
programLyrique Oct 10, 2024
a0d2fb2
Record the size of messages between the client and the server
programLyrique Oct 11, 2024
8cc42cc
Update devcontainer
fikovnik Oct 14, 2024
78d10a1
Added support for devcontainers
fikovnik Oct 15, 2024
accc11e
Merge branch 'backend' of github.com:PRL-PRG/r-compile-server into ba…
fikovnik Oct 15, 2024
2d96292
Remove R-debug
fikovnik Oct 15, 2024
c0fb869
Draft of for
fikovnik Oct 15, 2024
b6c4503
Draft of for 2
fikovnik Oct 16, 2024
e0ab4de
Draft of for 3
fikovnik Oct 16, 2024
07eef5b
Draft of for 4
fikovnik Oct 16, 2024
39320c6
Draft of for 5
fikovnik Oct 16, 2024
966decb
ISQ sequences
fikovnik Oct 16, 2024
153c25a
Add more benchmarks
fikovnik Oct 16, 2024
83cf238
Add seq_along
fikovnik Oct 17, 2024
9965163
Add seq_len
fikovnik Oct 17, 2024
3887356
Add is_null and is_logical
fikovnik Oct 17, 2024
f0f43bd
Add is_*
fikovnik Oct 17, 2024
56a370e
Simplify call trampoline
fikovnik Oct 21, 2024
7f3b3fe
Update conditional
fikovnik Oct 22, 2024
6d89afc
Collect stats about compiled packages and message sizes
programLyrique Oct 24, 2024
95cbd86
Adding bounce bechmarks
fikovnik Oct 24, 2024
2627f63
Supports function that has browser inside
programLyrique Oct 29, 2024
fbb6137
Adding compression to server responses
programLyrique Oct 30, 2024
33ea078
Merge branch 'backend' into server-rpc
programLyrique Nov 7, 2024
15946d8
Make BC2C tests pass again
programLyrique Nov 8, 2024
9328712
Broken
fikovnik Nov 13, 2024
5b53bb0
Fix makefile
fikovnik Nov 13, 2024
c36106a
Fix submodule
fikovnik Nov 13, 2024
b0abe32
Update R-debug
fikovnik Nov 13, 2024
2c75dba
Fix x11
fikovnik Nov 13, 2024
1f51b19
Fix complex assign
fikovnik Nov 13, 2024
8a065a5
Fix compiler warning
fikovnik Nov 13, 2024
6d64c94
Client now compiles again
programLyrique Nov 21, 2024
b2835a0
Fix creation of closure for optimized code: correctly build the body …
programLyrique Nov 21, 2024
c9e2d3a
Reinstate the exception when there is a version mismatch in installed…
programLyrique Nov 21, 2024
dd12fa0
Merge pull request #23 from PRL-PRG/server-rpc
programLyrique Nov 21, 2024
3a6417a
Remove duplicated package
programLyrique Nov 29, 2024
60e177a
Add missing devcontainer dependencies
fikovnik Dec 3, 2024
a230bd8
Fixes
fikovnik Dec 3, 2024
30e0991
Set LOG level to FINER for CCCOmpilation.java in IntelliJ
programLyrique Dec 3, 2024
9894922
Add And and Or instructions
fikovnik Dec 4, 2024
16b552b
Merge branch 'backend' of github.com:PRL-PRG/r-compile-server into ba…
fikovnik Dec 4, 2024
f3ae399
Added rest of the areWeFast benchmarks
fikovnik Dec 4, 2024
75c93fd
Add log
fikovnik Dec 4, 2024
05cb60f
WIP
fikovnik Dec 4, 2024
8ab7cac
Fix benchmark regression
programLyrique Dec 4, 2024
b87422e
Merge branch 'backend' of github.com:PRL-PRG/r-compile-server into ba…
programLyrique Dec 4, 2024
5fa55ef
Add Math1
fikovnik Dec 4, 2024
77a547c
Minor fixes
fikovnik Dec 4, 2024
c14a02e
Add comments
fikovnik Dec 5, 2024
c2b7f5c
Allow a larger size for the messages sent and received by the client
programLyrique Dec 5, 2024
3d3f4a5
Add a CleanCache message to clean the bytecode and native caches
programLyrique Dec 5, 2024
491e332
Merge branch 'backend' of github.com:PRL-PRG/r-compile-server into ba…
fikovnik Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
133 changes: 62 additions & 71 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,79 +1,70 @@
# This Dockerfile uses separate build arguments instead of VARIANT
ARG TARGET_JAVA_VERSION=22.0.2+9
ARG TARGET_GNUR_VERSION=4.3.2
ARG TARGET_DEBIAN_VERSION=bookworm
FROM mcr.microsoft.com/devcontainers/base:$TARGET_DEBIAN_VERSION
ARG JAVA_VERSION=22
ARG MAVEN_VERSION=3.9.9
ARG LLVM_VERSION=17
ARG BASE_IMAGE=ubuntu-24.04

USER root
ARG TARGET_JAVA_VERSION
ARG TARGET_GNUR_VERSION
ENV JAVA_HOME=/usr/lib/jvm/jdk
ENV PATH="$JAVA_HOME/bin:$PATH"
# Default to UTF-8 file.encoding
ENV LANG=en_US.UTF-8

# Install OpenJDK (Adoptium / temurin)
RUN arch="$(dpkg --print-architecture)" \
&& case "$arch" in \
"amd64") \
arch1="x64"; \
;; \
"arm64") \
arch1="aarch64"; \
;; \
*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \
esac \
&& jdkUrl="https://github.com/adoptium/temurin22-binaries/releases/download/jdk-$TARGET_JAVA_VERSION/OpenJDK22U-jdk_${arch1}_linux_hotspot_$(echo $TARGET_JAVA_VERSION | tr '+' '_').tar.gz" \
&& wget --progress=dot:giga -O temurin.tar.gz "$jdkUrl" \
&& wget --progress=dot:giga -O sha256.txt "$jdkUrl.sha256.txt"

RUN sha256Text=$(cat sha256.txt) \
&& sha256=$(expr substr "$sha256Text" 1 64) \
&& echo "$sha256 temurin.tar.gz" | sha256sum --strict --check - \
&& rm sha256.txt*
FROM mcr.microsoft.com/devcontainers/base:$BASE_IMAGE

RUN mkdir -p "$JAVA_HOME"
RUN tar --extract \
--file temurin.tar.gz \
--directory "$JAVA_HOME" \
--strip-components 1 \
--no-same-owner
RUN rm temurin.tar.gz*

RUN ln -s $JAVA_HOME /docker-java-home
RUN ln -s $JAVA_HOME /usr/local/openjdk-$(echo $TARGET_JAVA_VERSION | cut -d'-' -f1)

# Install GNU-R
# From https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Essential-and-useful-other-programs-under-a-Unix_002dalike
ARG GNUR_RUNTIME_DEPENDENCIES="build-essential gfortran"
ARG GNUR_BUILD_DEPENDENCIES="libreadline-dev zlib1g-dev libbz2-dev liblzma-dev libpcre2-dev"
# default to UTF-8 file.encoding
ENV LANG=en_US.UTF-8

RUN gnurUrl="https://cloud.r-project.org/src/base/R-$(printf %.1s $TARGET_GNUR_VERSION)/R-$TARGET_GNUR_VERSION.tar.gz" \
&& wget --progress=dot:giga -O gnur.tar.gz "$gnurUrl"
# this is weird, but without this, the default value would not be used.
ARG JAVA_VERSION
ARG MAVEN_VERSION
ARG LLVM_VERSION

RUN mkdir -p /tmp/gnur
RUN tar --extract \
--file gnur.tar.gz \
--directory /tmp/gnur \
--strip-components 1 \
--no-same-owner
RUN rm gnur.tar.gz*
# install OpenJDK
RUN curl -fsSL https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null \
&& echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \
&& apt update -y \
&& apt install -y temurin-$JAVA_VERSION-jdk \
&& ln -s "$(which java | xargs readlink -f | xargs dirname | xargs dirname)" /opt/java

RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends $GNUR_BUILD_DEPENDENCIES $GNUR_RUNTIME_DEPENDENCIES
# install maven
RUN mkdir -p /opt/maven \
&& curl -fsSL -o /tmp/apache-maven.tar.gz "https://dlcdn.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" \
&& tar -xzf /tmp/apache-maven.tar.gz -C /opt/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz

RUN cd /tmp/gnur \
&& ./tools/rsync-recommended \
&& ./configure --prefix=/usr/local --with-x=no \
&& make \
&& make install
RUN rm -rf /tmp/gnur
ENV MAVEN_HOME=/opt/maven
ENV JAVA_HOME=/opt/java
ENV PATH="$PATH:$MAVEN_HOME/bin"

RUN DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge $GNUR_BUILD_DEPENDENCIES
# Fortran is needed at
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends gfortran
RUN DEBIAN_FRONTEND=noninteractive apt-get -y autoremove
# install support for building client:
# - the bundled R
# - the rsh R package
RUN apt update -y \
&& apt install -y \
bear \
build-essential \
ca-certificates \
gdb \
gfortran \
libbz2-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libgrpc++-dev \
libgtk2.0-dev \
libicu-dev \
libjpeg-dev \
liblzma-dev \
libpango1.0-dev \
libpng-dev \
libreadline-dev \
libssl-dev \
libtiff5-dev \
libx11-dev \
libxt-dev \
libxxhash-dev \
libzmq3-dev \
protobuf-compiler \
protobuf-compiler-grpc \
rr \
software-properties-common \
xvfb \
zlib1g-dev

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# install LLVM
RUN curl -fsSL -o /opt/llvm.sh https://apt.llvm.org/llvm.sh \
&& chmod +x /opt/llvm.sh \
&& /opt/llvm.sh "$LLVM_VERSION"
31 changes: 25 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
{
"name": "r-compile-server",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},
features: {
"ghcr.io/devcontainers/features/java:1": {
"installMaven": "true"
// ensure consistency between vscode and intellij
// the embedded R uses absolute paths
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"postCreateCommand": "make setup",
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"llvm-vs-code-extensions.vscode-clangd",
"vadimcn.vscode-lldb"
]
}
},
"containerEnv": {
"JAVA_HOME": "/usr/lib/jvm/jdk"
// needed for ptrace based debuggers such as gdb / rr
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"updateRemoteUserUID": true,
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true
}
}
}
}
36 changes: 20 additions & 16 deletions .githooks/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#!/bin/bash

everything_staged=$(git diff --name-only)
SERVER_DIR="server"

cd "$SERVER_DIR"

everything_staged=$(git diff --name-only -- "$SERVER_DIR")
# `no_partial_stages` from https://github.com/evilmartians/lefthook/issues/140#issuecomment-1012967850
no_partial_stages=$(comm -12 <(git diff --name-only | sort) <(git diff --name-only --staged | sort))
format_only_staged=-DspotlessFiles="$(git diff --staged --name-only | sed 's/^/.*/' | paste -sd ',' -)"
no_partial_stages=$(comm -12 <(git diff --name-only -- "$SERVER_DIR" | sort) <(git diff --name-only --staged -- "$SERVER_DIR" | sort))
format_only_staged=-DspotlessFiles="$(git diff --staged --name-only -- "$SERVER_DIR" | sed 's/^/.*/' | paste -sd ',' -)"

if [ -n "$no_partial_stages" ]; then
# Format only staged changes. Don't commit if we change anything, because we can't partially format a file, and it's
# ambiguous what formatting changes should be staged and what shouldn't.
mvn spotless:check "$format_only_staged" || {
mvn spotless:apply "$format_only_staged"
echo "Reformatted a partially-staged file. Re-interactively-stage and commit again."
exit 1
}
# Format only staged changes. Don't commit if we change anything, because we can't partially format a file, and it's
# ambiguous what formatting changes should be staged and what shouldn't.
mvn spotless:check "$format_only_staged" || {
mvn spotless:apply "$format_only_staged"
echo "Reformatted a partially-staged file. Re-interactively-stage and commit again."
exit 1
}
elif [ -n "$everything_staged" ]; then
# Format only staged changes. We must re-add them because the formats aren't committed.
mvn spotless:apply "$format_only_staged"
git diff --name-only --staged | tr \\n \\0 | xargs -0 git add -f
# Format only staged changes. We must re-add them because the formats aren't committed.
mvn spotless:apply "$format_only_staged"
git diff --name-only --staged -- "$SERVER_DIR" | tr \\n \\0 | xargs -0 git add -f
else
# Format everything because spotless caches. We must re-add everything because the formats aren't committed.
mvn spotless:apply
git add -u
# Format everything because spotless caches. We must re-add everything because the formats aren't committed.
mvn spotless:apply
git add -u
fi
7 changes: 7 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ jobs:
with:
r-version: "4.3.2"
- name: Build artifact
working-directory: server
run: mvn --batch-mode --update-snapshots package
- run: mkdir staging && cp target/*.jar staging
working-directory: server
- name: Upload snapshot as artifact
uses: actions/upload-artifact@v3
working-directory: server
with:
name: snapshot
path: target/*-SNAPSHOT.jar
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
working-directory: server
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

test:
Expand All @@ -58,6 +62,7 @@ jobs:
with:
r-version: "4.3.2"
- name: Run tests (no static analyses)
working-directory: server
run: mvn --batch-mode --update-snapshots test

verify:
Expand All @@ -76,6 +81,7 @@ jobs:
with:
r-version: "4.3.2"
- name: Run tests and static analyses
working-directory: server
run: mvn --batch-mode --update-snapshots verify

verify-macos:
Expand All @@ -94,4 +100,5 @@ jobs:
with:
r-version: "4.3.2"
- name: Run tests and static analyses
working-directory: server
run: mvn --batch-mode --update-snapshots verify
59 changes: 20 additions & 39 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,47 +1,28 @@
**/src/test/snapshots/**/*.fail*
!src/test/resources/**/*.log

### Tempfiles ###
.devcontainer/.features.temp.dockerfile

### Build ###
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
# We actually want to sync this
# .settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
# We actually want to sync this
# .vscode/

### Mac OS ###
.DS_Store
.DS_Store

### R ###
.RData
.Rhistory
external/R/doc/manual/*.html
external/R/doc/NEWS.pdf
..Rcheck

### C ###
.cache
.gdb_history
compile_commands.json
*.so
*.o

### IntelliJ IDEA ###
/.idea/uiDesigner.xml
.idea/modules.xml
.idea/workspace.iml
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submodule "external/R"]
path = external/R
url = https://github.com/PRL-PRG/r-compiler-server-gnur
ignore = untracked
[submodule "external/R-debug"]
path = external/R-debug
url = https://github.com/PRL-PRG/r-compiler-server-gnur
2 changes: 0 additions & 2 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading