r-lib / actions

GitHub Actions for the R community
Creative Commons Zero v1.0 Universal
931 stars 201 forks source link

Install older pandoc will be overwritten by setup-r-dependencies System dependencies installation on Linux #710

Closed cderv closed 4 months ago

cderv commented 1 year ago

In R Markdown ecosystem we are testing older pandoc version. This may not be a wide usage.

I was trying to understand why I lost pandoc-citeproc availability with 2.73 and 2.5 and it took me time to understand that using r-lib/actions/setup-r-dependencies@v2 will try to install pandoc from Ubuntu repo (which is currently version 2.9.2.1).

This will make any version installed with r-lib/actions/setup-pandoc@v2 in a step before to be installed over and make rmarkdown use this latest one, which is unexpected.

Opening this issue to share this problem. Don't know if there could be a solution. Several ideas:

Currently, our solution is to uninstall Pandoc after r-lib/actions/setup-r-dependencies@v2 and installing manually using the setup-pandoc action.

gaborcsardi commented 1 year ago

Yeah, I am not sure what we can do with this. Maybe we should switch to downloading pandoc from their GH releases, and install it in /usr/local/bin, then it will take priority over the DEB package.

cderv commented 1 year ago

Maybe we should switch to downloading pandoc from their GH releases, and install it in /usr/local/bin

setup-pandoc already download from GH releases I believe.

I am always suprised by pak installing Pandoc because this is a package requirement for running some tools. It is not needed for compilation like other tools.

Maybe there is nothing to do and we can just document. This issue will happen for people using older pandoc than the one available in the Linux OS system repo. I acknowledge this is quite specific usage.

gaborcsardi commented 1 year ago

setup-pandoc already download from GH releases I believe.

Yeah, sorry, I meant downloading the static linux binary, e.g. pandoc-3.1.1-linux-amd64.tar.gz and putting it in /usr/local/bin.

cderv commented 1 year ago

Oh I see. This way it could / would be put in PATH above the other one. That would probably solve the issue indeed.

gaborcsardi commented 4 months ago

This will be solved by the next r-lib/actions release, coming probably today. Now setup-pandoc installs a static binary of pandoc, and puts its path to the beginning of PATH, so it should take precedence over OS packages.

So I am closing this now, but please reopen if you still have issues.

github-actions[bot] commented 4 months ago

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