Skip to content

Commit 2a36892

Browse files
Gemini: back to overwriting R binary, but using R.home() for subprocesses too
1 parent 61293b7 commit 2a36892

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/R-CMD-check-occasional.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,21 @@ jobs:
100100
with:
101101
r-version: ${{ matrix.r }}
102102

103+
- name: Override R for locale-specific check
104+
if: matrix.os == 'ubuntu-latest' && !contains(matrix.locale, 'utf8')
105+
run: |
106+
R_BIN_DIR=$(Rscript -e 'cat(R.home("bin"))')
107+
for bin in R Rscript; do
108+
target="${R_BIN_DIR}/${bin}"
109+
sudo mv "$target" "${target}.orig"
110+
sudo tee "$target" << EOF
111+
#!/bin/bash
112+
set -o pipefail
113+
exec "${target}.orig" "\$@" 2>&1 | iconv -c -t UTF-8
114+
EOF
115+
sudo chmod +x "$target"
116+
done
117+
103118
- name: Set script permissions
104119
run: chmod +x configure cleanup 2>/dev/null || true # Silence some GHA Annotations
105120
shell: bash
@@ -190,7 +205,7 @@ jobs:
190205
stop("R CMD check failed")
191206
}
192207
}
193-
shell: bash -c 'set -o pipefail; Rscript {0} 2>&1 | iconv -c -t UTF-8'
208+
shell: Rscript {0}
194209

195210
- name: Upload check results
196211
if: failure()

0 commit comments

Comments
 (0)