From ad1535e9173f1c013b5287852d7ef0e4f00fabd1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 11:30:16 +0000 Subject: [PATCH 1/3] Initial plan From a8fb692042e4b55a3c337c7f43131f2d65ade9fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 11:32:12 +0000 Subject: [PATCH 2/3] fix: set JAVA_HOME on Windows in setup-r-dependencies --- setup-r-dependencies/README.md | 4 ++++ setup-r-dependencies/action.yaml | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/setup-r-dependencies/README.md b/setup-r-dependencies/README.md index 8705132c..aac91a7f 100644 --- a/setup-r-dependencies/README.md +++ b/setup-r-dependencies/README.md @@ -286,6 +286,10 @@ On macOS you can usually use `brew`, here is an example step in a workflow: On Windows you can usually use `pacman` that is included in Rtools4, or `choco` to install external software: +`setup-r-dependencies` also sets `JAVA_HOME` to Java 21 on GitHub-hosted +Windows runners (`JAVA_HOME_21_X64` on x64, `JAVA_HOME_21_AARCH64` on arm64) +if `JAVA_HOME` is not already set. + ```yaml - name: Install most Windows system dependencies if: runner.os == 'Windows' diff --git a/setup-r-dependencies/action.yaml b/setup-r-dependencies/action.yaml index e7082ba1..282519d1 100644 --- a/setup-r-dependencies/action.yaml +++ b/setup-r-dependencies/action.yaml @@ -128,6 +128,18 @@ runs: cat("::endgroup::\n") shell: Rscript {0} + - name: Set JAVA_HOME (Windows x64) + if: ${{ runner.os == 'Windows' && runner.arch == 'X64' && env.JAVA_HOME == '' }} + shell: bash + run: | + echo "JAVA_HOME=${JAVA_HOME_21_X64}" >> $GITHUB_ENV + + - name: Set JAVA_HOME (Windows arm64) + if: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && env.JAVA_HOME == '' }} + shell: bash + run: | + echo "JAVA_HOME=${JAVA_HOME_21_AARCH64}" >> $GITHUB_ENV + - name: Install pak (Unix) if: ${{ runner.os != 'Windows' && inputs.pak-version != 'none' }} run: | From d27332520b83287737d06ade93acf4785cadff87 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 11:35:23 +0000 Subject: [PATCH 3/3] docs: clarify JAVA_HOME setup note placement --- setup-r-dependencies/README.md | 8 ++++---- setup-r-dependencies/action.yaml | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/setup-r-dependencies/README.md b/setup-r-dependencies/README.md index aac91a7f..e361a3c4 100644 --- a/setup-r-dependencies/README.md +++ b/setup-r-dependencies/README.md @@ -286,10 +286,6 @@ On macOS you can usually use `brew`, here is an example step in a workflow: On Windows you can usually use `pacman` that is included in Rtools4, or `choco` to install external software: -`setup-r-dependencies` also sets `JAVA_HOME` to Java 21 on GitHub-hosted -Windows runners (`JAVA_HOME_21_X64` on x64, `JAVA_HOME_21_AARCH64` on arm64) -if `JAVA_HOME` is not already set. - ```yaml - name: Install most Windows system dependencies if: runner.os == 'Windows' @@ -305,6 +301,10 @@ if `JAVA_HOME` is not already set. choco install mariadb ``` +`setup-r-dependencies` also sets `JAVA_HOME` to Java 21 on GitHub-hosted +Windows runners (`JAVA_HOME_21_X64` on x64, `JAVA_HOME_21_AARCH64` on arm64) +if `JAVA_HOME` is not already set. + # Installing the latest dependencies Note that `setup-r-dependencies` does _not_ necessarily install the latest diff --git a/setup-r-dependencies/action.yaml b/setup-r-dependencies/action.yaml index 282519d1..bb19e3ef 100644 --- a/setup-r-dependencies/action.yaml +++ b/setup-r-dependencies/action.yaml @@ -128,17 +128,19 @@ runs: cat("::endgroup::\n") shell: Rscript {0} - - name: Set JAVA_HOME (Windows x64) - if: ${{ runner.os == 'Windows' && runner.arch == 'X64' && env.JAVA_HOME == '' }} + - name: Set JAVA_HOME (Windows) + if: ${{ runner.os == 'Windows' }} shell: bash run: | - echo "JAVA_HOME=${JAVA_HOME_21_X64}" >> $GITHUB_ENV - - - name: Set JAVA_HOME (Windows arm64) - if: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && env.JAVA_HOME == '' }} - shell: bash - run: | - echo "JAVA_HOME=${JAVA_HOME_21_AARCH64}" >> $GITHUB_ENV + if [ -z "${JAVA_HOME:-}" ]; then + arch="${RUNNER_ARCH^^}" + case "${arch}" in + X64) echo "JAVA_HOME=${JAVA_HOME_21_X64}" >> $GITHUB_ENV ;; + # GitHub runners expose ARM64 Java 21 in JAVA_HOME_21_AARCH64. + ARM64) echo "JAVA_HOME=${JAVA_HOME_21_AARCH64}" >> $GITHUB_ENV ;; + *) echo "Warning: unsupported Windows architecture '${arch}', JAVA_HOME not set by setup-r-dependencies." >&2 ;; + esac + fi - name: Install pak (Unix) if: ${{ runner.os != 'Windows' && inputs.pak-version != 'none' }}