r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
643 stars 56 forks source link

actions check error when installing dependency whose repo name != package name #521

Closed jefferis closed 1 year ago

jefferis commented 1 year ago

@gaborcsardi as discussed. Thanks so much for any input you can give.

tl;dr

Where in a package being checked with GitHub actions can I hint to pak about a dependency whose repo name != package name? So far, my best guess leaves a check error It looks like this package has a loading problem when not on .libPaths:.

The details:

I am trying to use github actions with a package (natverse/malevc). It depends (suggests) a package natverse/fafbseg which in turn depends (imports) a package catmaid=natverse/rcatmaid. For this last case the package name (catmaid) is not the same as the repo name (rcatmaid). This is not something I can change.

I know that I can do

pak::pkg_install('catmaid=natverse/rcatmaid')

But I do not know where I can hint to pak running through github actions that the package catmaid can be found at natverse/rcatmaid. The DESCRIPTION of the second package (fafbseg) has

Remotes: 
    ...
    natverse/rcatmaid,
    ...

But this is not enough for pak (although it is sufficient for remotes) and I get a dependency resolution error. I have tried specifying the difficult dependency (catmaid) in the workflow file like this:

      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: any::rcmdcheck, catmaid=natverse/rcatmaid
          needs: check

This installs fine, but then I get a check error:

* checking loading without being on the library search path ... WARNING
Error: Error in loadNamespace(x) : there is no package called ‘fafbseg’

It looks like this package has a loading problem when not on .libPaths:
see the messages for details.
jefferis commented 1 year ago

OK my conclusion is that this was the right thing to do:

      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: any::rcmdcheck, catmaid=natverse/rcatmaid
          needs: check

and the additional failure was an unrelated issue.

jefferis commented 1 year ago

closing with apologies for noise.

gaborcsardi commented 1 year ago

No worries. Happy that it works now.