From 75c44f83d0e011d4a370f7a97fa19306dc7f7d65 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 07:13:19 +0530 Subject: [PATCH 01/19] changes to devconatiner.json --- .devcontainer/devcontainer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 62e90add..e28b1459 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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 }, @@ -28,7 +29,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": { @@ -43,7 +44,8 @@ "johnstoncode.svn-scm", "ms-vscode.cpptools", "MS-vsliveshare.vsliveshare", - "natqe.reload" + "natqe.reload", + "vadimcn.vscode-lldb" ] } }, From 1aeca181f8ff0dd7d74d1197eec2bac3afd7b9cc Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 07:58:09 +0530 Subject: [PATCH 02/19] added launch configuration and changed script to move the file to .vscode inside the container --- .devcontainer/launch.json | 12 ++++++++++++ scripts/localscript.sh | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 .devcontainer/launch.json diff --git a/.devcontainer/launch.json b/.devcontainer/launch.json new file mode 100644 index 00000000..0fa2b45a --- /dev/null +++ b/.devcontainer/launch.json @@ -0,0 +1,12 @@ +{ +"version": "0.2.0", +"configurations": [ + { + "name": "(lldb) Attach to R", + "type": "lldb", + "request": "attach", + "pid": "${command:pickMyProcess}", + "stopOnEntry": false + } + ] +} \ No newline at end of file diff --git a/scripts/localscript.sh b/scripts/localscript.sh index 083bf016..f5bb5672 100644 --- a/scripts/localscript.sh +++ b/scripts/localscript.sh @@ -27,6 +27,11 @@ cat $WORK_DIR/scripts/welcome_msg.sh >> ~/.bashrc # Remove git directory if it exists #rm -rf .git +# copy launch.json for debugging config if present +if [ -f "$DEVCONTAINER_JSON/launch.json" ]; then + cp "$DEVCONTAINER_JSON/launch.json" "$VSCODE_DIR/launch.json" +fi + # copying vscode extension settings from devcontainer json to vscode settings json using jq if [ -f "$DEVCONTAINER_JSON" ]; then jq '.customizations.vscode.settings' "$DEVCONTAINER_JSON" > "$VSCODE_DIR/settings.json" From 22b804dcfbb85c51650c226e499f82226ce120f8 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 08:01:16 +0530 Subject: [PATCH 03/19] made a correction to the referencing of the launch.json file in the script --- scripts/localscript.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/localscript.sh b/scripts/localscript.sh index f5bb5672..23fe4b6c 100644 --- a/scripts/localscript.sh +++ b/scripts/localscript.sh @@ -28,8 +28,8 @@ cat $WORK_DIR/scripts/welcome_msg.sh >> ~/.bashrc #rm -rf .git # copy launch.json for debugging config if present -if [ -f "$DEVCONTAINER_JSON/launch.json" ]; then - cp "$DEVCONTAINER_JSON/launch.json" "$VSCODE_DIR/launch.json" +if [ -f "$WORK_DIR/.devcontainer/launch.json" ]; then + cp "$WORK_DIR/.devcontainer/launch.json" "$VSCODE_DIR/launch.json" fi # copying vscode extension settings from devcontainer json to vscode settings json using jq From 95f650999e1959f40fd196cc4f4bfd3baf7c3fdd Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 08:12:29 +0530 Subject: [PATCH 04/19] added step to set cflags in building r tutorial --- docs/tutorials/building_r.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/tutorials/building_r.md b/docs/tutorials/building_r.md index 85f68146..c49ca60e 100644 --- a/docs/tutorials/building_r.md +++ b/docs/tutorials/building_r.md @@ -55,7 +55,22 @@ mkdir -p $BUILDDIR cd $BUILDDIR ``` -**5) Configure the build** +**5) Set CFLAGS (Optional—For Debugging C Code)** + +- **This step is optional and recommended for those who want to debug C code.** +- Set the `CFLAGS` environment variable before running configure: + +```bash +CFLAGS="-g -O0" +``` + +- These flags modify the configuration defined in the next step, +so that when R is built, C code will be compiled with debugging +symbols (`-g`) and compiler optimizations will be disabled +(`-O0`) so that the structure of the code closely matches the +original source. + +**6) Configure the build** - After we change directory, we must run the configure script from the source directory. This step takes ~1 minute on the codespace. @@ -80,7 +95,7 @@ $TOP_SRCDIR/configure --with-valgrind-instrumentation=1 ![alt text](../assets/rdev7.png) -**6) Build R** +**7) Build R** Having configured R, we run `make` to build R. This take 5-10 minutes on the codespace. @@ -89,7 +104,7 @@ codespace. make ``` -**7) Check R** +**8) Check R** Check that the build of R passes R's standard checks: @@ -101,7 +116,7 @@ This takes a couple of minutes in the codespace. The check will stop with a error message if any of the tests fail. If this happens, see [SVN Help](./svn_help.md) for how to revert to a version that passes check. -**8) Make R terminals use the built R** +**9) Make R terminals use the built R** Run the `which_r` script to set which R to use for R terminals in VSCode. When prompted, enter the number corresponding to `r-devel` @@ -125,7 +140,7 @@ built![^1] selected version is saved in the VSCode settings, so will be saved when you stop and restart the codespace. -**9) Make contributions** +**10) Make contributions** - After having built the current development version of R, we can now make changes to the source code and contribute to the project. From 08934b8423d4ec925f651fb8942a6bd047edac29 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 08:52:06 +0530 Subject: [PATCH 05/19] added allow_ptrace script --- scripts/allow_ptrace.c | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/allow_ptrace.c diff --git a/scripts/allow_ptrace.c b/scripts/allow_ptrace.c new file mode 100644 index 00000000..7b52828f --- /dev/null +++ b/scripts/allow_ptrace.c @@ -0,0 +1,7 @@ +#include +#include + +__attribute__((constructor)) void allow_ptrace() { + prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); + fprintf(stderr, "allow_ptrace: called\n"); +} \ No newline at end of file From 615558e7ee4902301b3151aa1025249021a67f44 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 09:00:29 +0530 Subject: [PATCH 06/19] added launch_r script to load the wrapper --- scripts/launch_r.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 scripts/launch_r.sh diff --git a/scripts/launch_r.sh b/scripts/launch_r.sh new file mode 100644 index 00000000..36c0ff26 --- /dev/null +++ b/scripts/launch_r.sh @@ -0,0 +1,4 @@ +#!/bin/bash +export LD_PRELOAD=/workspaces/r-dev-env/scripts/allow_ptrace.so +# exec /workspaces/r-dev-env/build/r-devel/bin/R "$@" +exec /usr/bin/R "$@" \ No newline at end of file From 22b740fdf00f1caa176bbdbc9de5aef68bfaa98b Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 09:25:51 +0530 Subject: [PATCH 07/19] updated local script to build the library and make the wrapper executable --- scripts/localscript.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/localscript.sh b/scripts/localscript.sh index 23fe4b6c..c3b82008 100644 --- a/scripts/localscript.sh +++ b/scripts/localscript.sh @@ -37,6 +37,11 @@ if [ -f "$DEVCONTAINER_JSON" ]; then jq '.customizations.vscode.settings' "$DEVCONTAINER_JSON" > "$VSCODE_DIR/settings.json" fi +# Build the ptrace helper library +gcc -shared -fPIC -o "$WORK_DIR/scripts/allow_ptrace.so" "$WORK_DIR/scripts/allow_ptrace.c" + +# Mark the wrapper executable +chmod +x "$WORK_DIR/scripts/launch_r.sh" } From 9b2b1f0582d36067ca09a7ff3fa7a403dbf2fca6 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 11:06:09 +0530 Subject: [PATCH 08/19] updated which_r to execute launch_r and update it --- scripts/which_r.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/which_r.sh b/scripts/which_r.sh index 689aecf6..88eab3a3 100644 --- a/scripts/which_r.sh +++ b/scripts/which_r.sh @@ -3,6 +3,7 @@ which_r() { # Specify the parent directory parent_dir="$WORK_DIR/build" + launch_script="$WORK_DIR/scripts/launch_r.sh" # Path to the settings.json file settings_file_path=$WORK_DIR/.vscode/settings.json @@ -59,9 +60,21 @@ which_r() { selected_version="/usr/bin/R" fi + # Update launch_r.sh to call the selected R binary + if [ -f "$launch_script" ]; then + sed -i "s|^exec .*/R|exec $selected_version|" "$launch_script" + else + echo "Warning: launch_r.sh script not found, skipping update." + fi + # Update settings.json with the chosen R path - updated_settings_data=$(cat "$settings_file_path" | jq --arg subdir "$selected_version" '."r.rterm.linux"=$subdir | ."r.rpath.linux"=$subdir') - echo "$updated_settings_data" > "$settings_file_path" + if [ -f "$settings_file_path" ]; then + tmpfile="${settings_file_path}.tmp.$$" + jq --arg r "$selected_version" '."r.rpath.linux"=$r' "$settings_file_path" > "$tmpfile" && mv "$tmpfile" "$settings_file_path" + else + echo "Warning: VS Code settings.json not found, skipping update." + fi + echo "R terminal will now use version: $selected_version" echo "To update the HTML help, click \"Reload\" in the VS Code status bar (bottom right) to reload your VS Code window." From 921324cfb1124299413076fa4bfef7b984cf101e Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Mon, 11 Aug 2025 12:10:43 +0530 Subject: [PATCH 09/19] removed vscode,devocntainer and scripts dir from files exclude beacuse the scripts need to be accessed from the container --- .devcontainer/devcontainer.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e28b1459..b0757b9a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,8 +10,6 @@ "settings": { "git.ignoredRepositories": ["."], "files.exclude": { - "**/.vscode": true, - "**/.devcontainer": true, "**/.git": true, "**/.github": true, "**/.gitignore": true, @@ -20,8 +18,7 @@ "**/.markdownlint-cli2.yaml": true, "**/.pre-commit-config.yaml": true, "**/Dockerfile": true, - "**/mkdocs.yml": true, - "**/scripts": true + "**/mkdocs.yml": true }, "editor.tabSize": 8, "editor.indentSize": 4, From 6542a191ddb99fc8db3ddbcc36c102bab412397d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 07:15:13 +0000 Subject: [PATCH 10/19] [pre-commit.ci] Fixing issues with pre-commit --- .devcontainer/launch.json | 2 +- scripts/allow_ptrace.c | 2 +- scripts/launch_r.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/launch.json b/.devcontainer/launch.json index 0fa2b45a..21090143 100644 --- a/.devcontainer/launch.json +++ b/.devcontainer/launch.json @@ -9,4 +9,4 @@ "stopOnEntry": false } ] -} \ No newline at end of file +} diff --git a/scripts/allow_ptrace.c b/scripts/allow_ptrace.c index 7b52828f..4deebecc 100644 --- a/scripts/allow_ptrace.c +++ b/scripts/allow_ptrace.c @@ -4,4 +4,4 @@ __attribute__((constructor)) void allow_ptrace() { prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); fprintf(stderr, "allow_ptrace: called\n"); -} \ No newline at end of file +} diff --git a/scripts/launch_r.sh b/scripts/launch_r.sh index 36c0ff26..cc176957 100644 --- a/scripts/launch_r.sh +++ b/scripts/launch_r.sh @@ -1,4 +1,4 @@ #!/bin/bash export LD_PRELOAD=/workspaces/r-dev-env/scripts/allow_ptrace.so # exec /workspaces/r-dev-env/build/r-devel/bin/R "$@" -exec /usr/bin/R "$@" \ No newline at end of file +exec /usr/bin/R "$@" From 314983c5444a169973c4c3131fffffad4bef51ee Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Thu, 28 Aug 2025 13:16:32 +0530 Subject: [PATCH 11/19] removed absolute paths --- .devcontainer/devcontainer.json | 2 +- scripts/launch_r.sh | 6 ++++-- scripts/welcome_msg.sh | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4dd80406..62c1c439 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -47,5 +47,5 @@ ] } }, - "postCreateCommand": "sh /workspaces/r-dev-env/scripts/localscript.sh" + "postCreateCommand": "sh ./scripts/localscript.sh" } diff --git a/scripts/launch_r.sh b/scripts/launch_r.sh index cc176957..9163592f 100644 --- a/scripts/launch_r.sh +++ b/scripts/launch_r.sh @@ -1,4 +1,6 @@ #!/bin/bash -export LD_PRELOAD=/workspaces/r-dev-env/scripts/allow_ptrace.so -# exec /workspaces/r-dev-env/build/r-devel/bin/R "$@" + +WORK_DIR=$PWD +export LD_PRELOAD="$WORK_DIR/scripts/allow_ptrace.so" +# exec "$WORK_DIR/build/r-devel/bin/R" "$@" exec /usr/bin/R "$@" diff --git a/scripts/welcome_msg.sh b/scripts/welcome_msg.sh index 00d278e9..c0d724e4 100755 --- a/scripts/welcome_msg.sh +++ b/scripts/welcome_msg.sh @@ -28,9 +28,8 @@ PATCHDIR = \"$PATCHDIR\" Have fun \U0001F601 " -# open INDEX.md if INIT file exists +# open INDEX.md if svn and build directories exist if [ ! -d "svn" ] && [ ! -d "build" ]; then sleep 2 code INDEX.md - rm INIT fi From bccf15b119f6dfd9a8a91a1d62d8cc18c8c57b8b Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Thu, 28 Aug 2025 13:34:51 +0530 Subject: [PATCH 12/19] updated allow ptrace to remove printing multiple times when the wrapper is loaded and updated launch r to use relative path --- scripts/allow_ptrace.c | 1 - scripts/launch_r.sh | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/allow_ptrace.c b/scripts/allow_ptrace.c index 4deebecc..dd85a88a 100644 --- a/scripts/allow_ptrace.c +++ b/scripts/allow_ptrace.c @@ -3,5 +3,4 @@ __attribute__((constructor)) void allow_ptrace() { prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); - fprintf(stderr, "allow_ptrace: called\n"); } diff --git a/scripts/launch_r.sh b/scripts/launch_r.sh index 9163592f..096669e2 100644 --- a/scripts/launch_r.sh +++ b/scripts/launch_r.sh @@ -1,6 +1,5 @@ #!/bin/bash -WORK_DIR=$PWD -export LD_PRELOAD="$WORK_DIR/scripts/allow_ptrace.so" -# exec "$WORK_DIR/build/r-devel/bin/R" "$@" +export LD_PRELOAD="./scripts/allow_ptrace.so" +# # `which_r.sh` sets the R binary used in the command below exec /usr/bin/R "$@" From 0f93b0234c3fb50c8838c9a1dea90637f2900f67 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Thu, 28 Aug 2025 13:44:18 +0530 Subject: [PATCH 13/19] updated building r documentation to include the cflags step into the configure command --- docs/tutorials/building_r.md | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/docs/tutorials/building_r.md b/docs/tutorials/building_r.md index c49ca60e..0f1eab3f 100644 --- a/docs/tutorials/building_r.md +++ b/docs/tutorials/building_r.md @@ -55,29 +55,13 @@ mkdir -p $BUILDDIR cd $BUILDDIR ``` -**5) Set CFLAGS (Optional—For Debugging C Code)** - -- **This step is optional and recommended for those who want to debug C code.** -- Set the `CFLAGS` environment variable before running configure: - -```bash -CFLAGS="-g -O0" -``` - -- These flags modify the configuration defined in the next step, -so that when R is built, C code will be compiled with debugging -symbols (`-g`) and compiler optimizations will be disabled -(`-O0`) so that the structure of the code closely matches the -original source. - -**6) Configure the build** +**5) Configure the build** - After we change directory, we must run the configure script from the source directory. This step takes ~1 minute on the codespace. ```bash -$TOP_SRCDIR/configure --with-valgrind-instrumentation=1 - +$TOP_SRCDIR/configure --with-valgrind-instrumentation=1 CFLAGS="-g -O0" ``` @@ -86,6 +70,9 @@ $TOP_SRCDIR/configure --with-valgrind-instrumentation=1 of valgrind. See the [Using valgrind](https://cran.r-project.org/doc/manuals/R-exts.html#Using-valgrind) section of the R-admin manual for more information. + The `CFLAGS="-g -O0"` setting compiles C code with debugging symbols + (`-g`) and disables optimization (`-O0`) so the compiled code closely + matches the original source, which aids debugging. - The configure cmd prepares for building R, creating files and folders inside @@ -95,7 +82,7 @@ $TOP_SRCDIR/configure --with-valgrind-instrumentation=1 ![alt text](../assets/rdev7.png) -**7) Build R** +**6) Build R** Having configured R, we run `make` to build R. This take 5-10 minutes on the codespace. @@ -104,7 +91,7 @@ codespace. make ``` -**8) Check R** +**7) Check R** Check that the build of R passes R's standard checks: @@ -116,7 +103,7 @@ This takes a couple of minutes in the codespace. The check will stop with a error message if any of the tests fail. If this happens, see [SVN Help](./svn_help.md) for how to revert to a version that passes check. -**9) Make R terminals use the built R** +**8) Make R terminals use the built R** Run the `which_r` script to set which R to use for R terminals in VSCode. When prompted, enter the number corresponding to `r-devel` @@ -140,7 +127,7 @@ built![^1] selected version is saved in the VSCode settings, so will be saved when you stop and restart the codespace. -**10) Make contributions** +**9) Make contributions** - After having built the current development version of R, we can now make changes to the source code and contribute to the project. From 5bc250bcb7ed9df9a0be83d4bbcb53af1c9bf3bc Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Thu, 28 Aug 2025 13:55:06 +0530 Subject: [PATCH 14/19] Update r.rterm.linux setting to use the launch_r.sh script with full dynamic path --- .devcontainer/devcontainer.json | 2 +- scripts/localscript.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 62c1c439..0ae27f41 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,7 +27,7 @@ "r.lsp.diagnostics": false, "r.plot.useHttpgd": true, "r.rpath.linux": "/usr/bin/R", - "r.rterm.linux": "/workspaces/r-dev-env/scripts/launch_r.sh", + "r.rterm.linux": "/usr/bin/R", "terminal.integrated.sendKeybindingsToShell": true, "svn.multipleFolders.enabled": true, "workbench.editorAssociations": { diff --git a/scripts/localscript.sh b/scripts/localscript.sh index c3b82008..d345c0e9 100644 --- a/scripts/localscript.sh +++ b/scripts/localscript.sh @@ -37,6 +37,12 @@ if [ -f "$DEVCONTAINER_JSON" ]; then jq '.customizations.vscode.settings' "$DEVCONTAINER_JSON" > "$VSCODE_DIR/settings.json" fi +# Update r.rterm.linux setting to use the launch_r.sh script with full dynamic path +if [ -f "$VSCODE_DIR/settings.json" ]; then + tmpfile="${VSCODE_DIR/settings.json}.tmp.$$" + jq --arg rterm "$WORK_DIR/scripts/launch_r.sh" '."r.rterm.linux"=$rterm' "$VSCODE_DIR/settings.json" > "$tmpfile" && mv "$tmpfile" "$VSCODE_DIR/settings.json" +fi + # Build the ptrace helper library gcc -shared -fPIC -o "$WORK_DIR/scripts/allow_ptrace.so" "$WORK_DIR/scripts/allow_ptrace.c" From 17591fffb71355757fd95a099391d277e4f21393 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Thu, 28 Aug 2025 14:02:49 +0530 Subject: [PATCH 15/19] move the launch_script variable definition in which_r script --- scripts/which_r.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/which_r.sh b/scripts/which_r.sh index 88eab3a3..b4de5295 100644 --- a/scripts/which_r.sh +++ b/scripts/which_r.sh @@ -3,7 +3,6 @@ which_r() { # Specify the parent directory parent_dir="$WORK_DIR/build" - launch_script="$WORK_DIR/scripts/launch_r.sh" # Path to the settings.json file settings_file_path=$WORK_DIR/.vscode/settings.json @@ -60,6 +59,9 @@ which_r() { selected_version="/usr/bin/R" fi + # Define launch script path here where it's actually used + launch_script="$WORK_DIR/scripts/launch_r.sh" + # Update launch_r.sh to call the selected R binary if [ -f "$launch_script" ]; then sed -i "s|^exec .*/R|exec $selected_version|" "$launch_script" From d04f11edfda4f9fab8266ace7f3c2ab88d9f2ad1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 03:11:50 +0000 Subject: [PATCH 16/19] [pre-commit.ci] Fixing issues with pre-commit --- scripts/which_r.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/which_r.sh b/scripts/which_r.sh index b4de5295..1abf1b2c 100644 --- a/scripts/which_r.sh +++ b/scripts/which_r.sh @@ -61,7 +61,7 @@ which_r() { # Define launch script path here where it's actually used launch_script="$WORK_DIR/scripts/launch_r.sh" - + # Update launch_r.sh to call the selected R binary if [ -f "$launch_script" ]; then sed -i "s|^exec .*/R|exec $selected_version|" "$launch_script" From 9c3aee5eb086f3c91c8de9bd221fd1f1efead8f1 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Tue, 9 Sep 2025 09:02:50 +0530 Subject: [PATCH 17/19] updated which_r.sh --- scripts/which_r.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/which_r.sh b/scripts/which_r.sh index 1abf1b2c..925333ed 100644 --- a/scripts/which_r.sh +++ b/scripts/which_r.sh @@ -64,7 +64,7 @@ which_r() { # Update launch_r.sh to call the selected R binary if [ -f "$launch_script" ]; then - sed -i "s|^exec .*/R|exec $selected_version|" "$launch_script" + sed -i "s|^exec [^ ]*/R|exec $selected_version|" "$launch_script" else echo "Warning: launch_r.sh script not found, skipping update." fi From 6f40896a133a6078db44f2743a8335f8b167892e Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Tue, 9 Sep 2025 09:39:16 +0530 Subject: [PATCH 18/19] updated devcontainer.json --- .devcontainer/devcontainer.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0ae27f41..96e4c40b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,6 @@ { "name": "R-Dev-Env", "image": "ghcr.io/r-devel/r-dev-env:devel", - "runArgs": ["--cap-add=SYS_PTRACE"], "remoteUser": "vscode", "hostRequirements": { "cpus": 4 @@ -42,10 +41,9 @@ "johnstoncode.svn-scm", "ms-vscode.cpptools", "MS-vsliveshare.vsliveshare", - "natqe.reload", - "vadimcn.vscode-lldb" + "natqe.reload" ] } }, - "postCreateCommand": "sh ./scripts/localscript.sh" + "postCreateCommand": "bash /workspaces/r-dev-env/scripts/localscript.sh" } From 95f572976a30136e7fed53313649cfa3d62e25f5 Mon Sep 17 00:00:00 2001 From: avinab-neogy Date: Tue, 9 Sep 2025 09:42:10 +0530 Subject: [PATCH 19/19] updated devcontainer.json --- .devcontainer/devcontainer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 96e4c40b..17deda6e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,7 @@ { "name": "R-Dev-Env", "image": "ghcr.io/r-devel/r-dev-env:devel", + "runArgs": ["--cap-add=SYS_PTRACE"], "remoteUser": "vscode", "hostRequirements": { "cpus": 4 @@ -41,9 +42,10 @@ "johnstoncode.svn-scm", "ms-vscode.cpptools", "MS-vsliveshare.vsliveshare", - "natqe.reload" + "natqe.reload", + "vadimcn.vscode-lldb" ] } }, - "postCreateCommand": "bash /workspaces/r-dev-env/scripts/localscript.sh" + "postCreateCommand": "bash ./scripts/localscript.sh" }