r-universe-org / help

Support and bug tracker for R-universe
https://docs.r-universe.dev/
9 stars 2 forks source link

Package missed when building multiple packages from a monorepo #326

Closed richfitz closed 8 months ago

richfitz commented 10 months ago

We have a repo containing (currently) two related packages that we want to layout as:

DESCRIPTION <-- root containing the first package
drivers/
  windows/
    DESCRIPTION <-- a related package, within a sub-sub-directory

The real example is here https://github.com/mrc-ide/hermod and the r-universe json file is here.

We see only the root package (hermod) and not the package in the subdirectory (hermod.windows). I think I've got the url correct, but could not find docs confirming that it should be done that way. The builds don't mention the missing package: https://github.com/r-universe/mrc-ide/actions

Is this possible to do this? Do I just have the url incorrect, or is having two packages in one repo causing the issue?

jeroen commented 10 months ago

You can use the subdir value in the registry to point to a package within a subdir, some examples here: https://github.com/r-universe-org/cran-to-git/blob/HEAD/r-forge.json

Although arguably the url syntax is nicer, maybe we should support that too.

I think it should work (given that the two packages have a different name?)

richfitz commented 10 months ago

Thanks - I've made that change and it has worked.

Although arguably the url syntax is nicer, maybe we should support that too.

It's a bit odd as the URL is also not the correct - url, that will 404. Your argument version is more explicit - I could not find these in the docs though, I looked on the readme here: https://github.com/r-universe-org/help - if you could document the other keys that work too that would be great (branch is the other one I know, but I see maintainer is also used)

jeroen commented 10 months ago

It's a bit odd as the URL is also not the correct - url, that will 404.

I also realized why we did not do this in the first place: it is ambiguous which part of the url path is the git repo, and which the subdirectory. Not all git servers use the /:user/:repo url format like GitHub. Sometimes a git repo is mounted under less or more than two subdirectories.

And yes, docs are lacking. Only branch and subdir are used right now, maintainer does not do anything.