Skip to content

Commit 10bb76e

Browse files
avinab-neogyhturner
andcommitted
update docs/tutorials/building_r.md
modify the step for setting CFLAGS for a better explanation Co-authored-by: Heather Turner <[email protected]>
1 parent e31cb45 commit 10bb76e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scripts/launch_r.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/usr/bin/env bash
2-
export LD_PRELOAD=/workspaces/r-dev-env/scripts/allow_ptrace.so
2+
# Preload helper for ptrace
3+
export LD_PRELOAD="$(dirname "$0")/allow_ptrace.so"
34

4-
# If the first argument is a file, use that as R_BINARY; otherwise default.
5-
if [ -x "$1" ]; then
6-
R_BINARY="$1"
7-
shift
5+
# VS Code sets the env var R_RPATH_LINUX to the path from r.rpath.linux
6+
if [ -n "${R_RPATH_LINUX:-}" ] && [ -x "$R_RPATH_LINUX" ]; then
7+
R_BINARY="$R_RPATH_LINUX"
88
else
99
R_BINARY="/usr/bin/R"
1010
fi
1111

12-
# Exec R with all remaining arguments
1312
exec "$R_BINARY" "$@"

0 commit comments

Comments
 (0)