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

Error "No such keg: /opt/homebrew/Cellar/r" using setup-r@v2 for MacOS latest with R release #864

Closed
the-mad-statter opened this issue Jun 8, 2024 · 4 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@the-mad-statter
Copy link

the-mad-statter commented Jun 8, 2024

The R-CMD-check workflow here is reported as being successful but also produces the error "macOS-latest (R release) No such keg: /opt/homebrew/Cellar/r" as can be seen here.

I have traced the source of the error to this line in the setup-r installer.ts file.

I am not sure why /opt/homebrew/Cellar/r is missing, but could this situation be prevented or at least be turned into a warning?

@AlexAxthelm
Copy link

We also saw this pop up a few weeks ago in our rcmdcheck pipeline. The rest of the check process proceeds, and rcmdcheck runs normally, but Actions still marks this as a failed check.

Example: https://github.com/RMI-PACTA/pacta.workflow.utils/actions/runs/9606136641/job/26495127601#step:4:155

@AlexAxthelm
Copy link

After a little more investigation, it looks like the action is failing to unlink R, because the macOS-latest GH runners don't have R installed by default, and definitely not via brew. Running brew list shows no R installation.

I think if we add a check that R is in brew list before trying to unlink, this should eliminate the error.
I don't know enough typescript yet to open a PR for that, but if it were a bash command, it would probably be something like:

#! /bin/sh
# Check that r is installed via brew
BREW_R_VERSION="$(brew info --json r | jq  -rc '.[0] | .installed | .[0] | .version')"
echo $BREW_R_VERSION
if [ "$BREW_R_VERSION" == "null" ]; then
  echo "R is not installed via brew"
else
  echo "R is installed via brew"
  # unlink the current version of R
fi

tjakobi added a commit to jakobilab/circtools that referenced this issue Jul 15, 2024
gaborcsardi added a commit that referenced this issue Jul 31, 2024
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Jul 31, 2024
gaborcsardi added a commit that referenced this issue Aug 2, 2024
* [setup-r]: try to unlink brew R silently

To avoid #864.

* [setup-r]: run brew install silently

brew likes to warn about already installed packages
and env vars, but we don't care about these.

* NEWS for avoiding brew warnings
@gaborcsardi
Copy link
Member

Closed by #891.

Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants