Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581320 - roverlay: recommended packages need "dev-lang/R[minimal]" dependency.
Summary: roverlay: recommended packages need "dev-lang/R[minimal]" dependency.
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: André Erdmann
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-27 06:32 UTC by Benda Xu
Modified: 2017-04-21 02:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
package rule that makes lattice depend on dev-lang/R[minimal] (bug581320_package_rule.txt,785 bytes, text/plain)
2016-04-27 20:02 UTC, André Erdmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2016-04-27 06:32:24 UTC
dev-lang/R[minimal] builds R without recommended packages.  dev-lang/R[-minimal] does otherwise.

An independent ebuild in the recommended packages list, like sci-CRAN/lattice, has file conflicts with dev-lang/R[-minimal].

Therefore, the present DEPENDS of

DEPEND=">=dev-lang/R-3.0.0"

should be changed to

DEPEND=">=dev-lang/R[minimal]-3.0.0"

in recommended packages.


Is it straightforward in R_Overlay?

Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2016-04-27 06:36:16 UTC
Sorry, typo: should be

DEPEND=">=dev-lang/R-3.0.0[minimal]"
Comment 2 André Erdmann 2016-04-27 20:02:44 UTC
Created attachment 432340 [details]
package rule that makes lattice depend on dev-lang/R[minimal]
Comment 3 André Erdmann 2016-04-27 20:07:26 UTC
If there are only a few packages affected by this issue, then it's doable with a package rule that (1) adds a dependency on dev-lang/R[minimal] and (2) filters out any dep-string that could get resolved as dev-lang/R[-minimal].

(1) is "add DEPEND dev-lang/R[minimal]" in the "ACTION" block of the package rule

(2) lattice has "KernSmooth" and "MASS" in the "Suggests" field of its DESCRIPTION file, which get resolved as "dev-lang/R[-minimal]" with the current rule set (specifically, config/simple-deprules.d/R). This would effectively result in a depencency on "dev-lang/R[minimal,-minimal]".
This can be circumvented by "depstr_ignore <str>" actions.

I've attached a suitable package rule.
Comment 4 Benda Xu gentoo-dev 2016-05-10 04:40:46 UTC
(In reply to André Erdmann from comment #3)
> If there are only a few packages affected by this issue, then it's doable
> with a package rule that (1) adds a dependency on dev-lang/R[minimal] and
> (2) filters out any dep-string that could get resolved as
> dev-lang/R[-minimal].
> 
> (1) is "add DEPEND dev-lang/R[minimal]" in the "ACTION" block of the package
> rule
> 
> (2) lattice has "KernSmooth" and "MASS" in the "Suggests" field of its
> DESCRIPTION file, which get resolved as "dev-lang/R[-minimal]" with the
> current rule set (specifically, config/simple-deprules.d/R). This would
> effectively result in a depencency on "dev-lang/R[minimal,-minimal]".
> This can be circumvented by "depstr_ignore <str>" actions.
> 
> I've attached a suitable package rule.

For (2), I have a virtual-ebuild solution. Taking KernSmooth as an example:

virtual/KernSmooth-0.ebuild:
...
RDEPEND="
        || (
                dev-lang/R[-minimal]
                sci-CRAN/KernSmooth
        )"
...

and simple-deprules.d/virtual:
virtual/KernSmooth :: KernSmooth

The virtuals used now cannot encode version.  At present any versioned dependencies are resolved by sci-CRAN/KernSmooth.  We cannot easily figure out the correspondence of R version to KernSmooth version.  This might change in the future when we generate a R-version-recommended-package-versions-mapping database.

sci-CRAN/KernSmooth will in turn depend on dev-lang/R[minimal] by (1) same as lattice.

With this policy, we have a self-consistant dependency system.
Comment 5 Benda Xu gentoo-dev 2016-05-10 04:58:28 UTC
By the way, what the command to test the generation of a single package, say sci-CRAN/lattice, without going through the whole CRAN overlay?
Comment 6 Benda Xu gentoo-dev 2016-05-10 06:14:59 UTC
Hi André,

I have made the following update according to your suggestion.

--- a/roverlay/package_rules
+++ b/roverlay/package_rules
@@ -23,6 +23,30 @@ ELSE:
    rename category s=^(?P<repo>[^-/]+)([-/].*)?$=sci-\g<repo>=
 END;
 
+# https://bugs.gentoo.org/show_bug.cgi?id=581320
+# recommended packages need "dev-lang/R[minimal]" dependency.
+
+MATCH:
+   or
+   * name boot
+   * name class
+   * name cluster
+   * name codetools
+   * name foreign
+   * name KernSmooth
+   * name lattice
+   * name MASS
+   * name Matrix
+   * name mgcv
+   * name nlme
+   * name nnet
+   * name rpart
+   * name spatial
+   * name survival
+ACTION:
+   add DEPEND dev-lang/R[minimal]
+END;

It does not work cleanly on versioned dependencies, for example, lattice-0.20.33.ebuild is generated as:

...
"
DEPEND=">=dev-lang/R-3.0.0
        dev-lang/R[minimal]
"
'''

How to make it into DEPEND=">=dev-lang/R-3.0.0[minimal]"?

Benda
Comment 7 André Erdmann 2016-05-23 06:31:07 UTC
I see. USE-flag aware de-duplication/merging of dependencies needs some coding, I will do that soon.

There's no command to process a single package only. However, you can restrict list the input packages with --no-sync and instruct roverlay to replace or revbump the package in question, e.g. "roverlay --no-sync --package-revbump lattice".
An alternative to that that does not depend on not syncing is a package rule "match name lattice, then no-op, else do-not-process".

I also have a draft for the virtuals, will contact you when it's a pit more polished.
Comment 8 Benda Xu gentoo-dev 2017-04-21 02:42:12 UTC
Hi André, any updates?

Benda