Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "R-Dev-Env",
"image": "ghcr.io/r-devel/r-dev-env:devel",
"runArgs": ["--cap-add=SYS_PTRACE"],
"hostRequirements": {
"cpus": 4
},
Expand All @@ -13,7 +14,7 @@
"r.lsp.diagnostics": false,
"r.plot.useHttpgd": true,
"r.rpath.linux": "/usr/bin/R",
"r.rterm.linux": "/usr/bin/R",
"r.rterm.linux": "/workspaces/r-dev-env/scripts/launch_r.sh",
"terminal.integrated.sendKeybindingsToShell": true,
"svn.multipleFolders.enabled": true,
"workbench.editorAssociations": {
Expand All @@ -28,7 +29,8 @@
"johnstoncode.svn-scm",
"ms-vscode.cpptools",
"MS-vsliveshare.vsliveshare",
"natqe.reload"
"natqe.reload",
"vadimcn.vscode-lldb"
]
}
},
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ R-4.1.3/
R-4.1.3.tar.gz
R-devel/
R-devel.tar.gz
/build
/svn
/venv
.cache/
.Rproj.user
*.Rproj
**.so
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Attach to R",
"type": "lldb",
"request": "attach",
"pid": "${command:pickMyProcess}",
"stopOnEntry": false
}
]
}
7 changes: 7 additions & 0 deletions scripts/allow_ptrace.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <sys/prctl.h>
#include <stdio.h>

__attribute__((constructor)) void allow_ptrace() {
prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);
fprintf(stderr, "allow_ptrace: called\n");
}
5 changes: 5 additions & 0 deletions scripts/launch_r.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
export LD_PRELOAD=/workspaces/r-dev-env/scripts/allow_ptrace.so
# which_r.sh needs updating to switch R version here vs in vscode settings
# exec /workspaces/r-dev-env/build/r-devel/bin/R "$@"
exec /usr/bin/R "$@"
2 changes: 1 addition & 1 deletion scripts/localscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cat $WORK_DIR/scripts/welcome_msg.sh >> ~/.bashrc
#bash ~/.bashrc

# Remove git directory if it exists
rm -rf .git
# rm -rf .git
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented out this line and added a .gitignore file to make it easier to share my changes here. I think we still want to delete the .git in the container to avoid confusing users.


# copying vscode extension settings from devcontainer json to vscode settings json using jq
if [ -f "$DEVCONTAINER_JSON" ]; then
Expand Down