Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set R temp directory to be in Runner temp directory #217

Closed
cderv opened this issue Dec 4, 2020 · 2 comments
Closed

Set R temp directory to be in Runner temp directory #217

cderv opened this issue Dec 4, 2020 · 2 comments

Comments

@cderv
Copy link
Contributor

cderv commented Dec 4, 2020

On windows, short path name (or 8.3 filename) are still used on GHA. This path can cause issue with some tools - specifically we encounter error on windows with LaTeX when rendering from a tempfile()

As nothing is done specifically in setup-r, R will look at %TEMP% which contains a short filename - this has been reported already and it is normal. (actions/runner-images#712)

What about setting TEMPDIR, TMP or TEMP to the runner temp directory by default? (RUNNER_TEMP, runner.temp, process.env["RUNNER_TEMP"]). This is already use to place the R user library (R_LIBS_USER). This folder has the advantage to not have space on Windows, so no short file name with ~.

It could also be a parameter to pass to the action to set the R temp dir to a different location

      - uses: r-lib/actions/setup-r@v1
        with:
          temp_directory: ${{ runner.temp }}

Currently to make the test pass, I set this environment for the step

      - name: Check
        env:
          _R_CHECK_CRAN_INCOMING_: false
          TMPDIR: ${{ runner.temp }}
        run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
        shell: Rscript {0}

I could also do it for the job by setting globally using a custom step

      - name: change temp dir
        run: echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV
        shell: bash

it seems this variable can't be define in env: at the job level, as it is done with secrets (no access to ${{ runner.temp }} there it seems)

Would it be something to consider ?

@koppor
Copy link

koppor commented Aug 18, 2021

This refs actions/toolkit#518, because that issue asks for documentation of RUNNER_TEMP for actions.

@jimhester
Copy link
Member

I have never really ran into this issue in any of our workflows, so I don't think this is widespread enough to change the default, and the workaround you mentioned above seems like a good solution.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants