Summary: | [Future EAPI] pkg_needrebuild() to replace smart-live-rebuild | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Michał Górny <mgorny> |
Component: | PMS/EAPI | Assignee: | Package Manager Specification <pms> |
Status: | CONFIRMED --- | ||
Severity: | enhancement | CC: | adjudicatordarren, ahipp0, eschwartz, esigra, eugene.shalygin, gentoo, kingjon3377, mail, mike, pacho, rafallalik, tsmksubc |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=182028 https://bugs.gentoo.org/show_bug.cgi?id=481434 https://github.com/pkgcore/pkgcore/pull/315 https://bugs.gentoo.org/show_bug.cgi?id=936255 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 174380 |
Description
Michał Górny
![]() ![]() ![]() ![]() Thinking about it, it should probably go for the opposite logic. That is, pkg_liveneedsrebuild() or something like that, so that we wouldn't return 0 on failure to reach remote :). I suggest that the function has three possible return values: 0 = needs rebuild 1 = doesn't need rebuild 2 = some trouble occured (In reply to Michał Górny from comment #1) > pkg_liveneedsrebuild() or something like that, pkg_outofdate()? *** Bug 539698 has been marked as a duplicate of this bug. *** (In reply to Ulrich Müller from comment #2) > I suggest that the function has three possible return values: > 0 = needs rebuild > 1 = doesn't need rebuild > 2 = some trouble occured I withdraw the last one, as doesn't fit into the systematic of other phase functions. The function should just die if it cannot determine if a rebuild is needed (e.g. if it cannot contact remote). At what point would this be called? After pkg_pretend, but before pkg_setup? (In reply to Ulrich Müller from comment #5) > At what point would this be called? After pkg_pretend, but before pkg_setup? I was thinking of making it completely disjoint. The initial idea was to call it when determining the contents of @live-rebuild set, pretty much how smart-live-rebuild works right now. If we added some '--live-rebuild y' option, then it would probably be called during dependency calc. (In reply to Michał Górny from comment #6) > I was thinking of making it completely disjoint. The initial idea was to > call it when determining the contents of @live-rebuild set, pretty much how > smart-live-rebuild works right now. If we added some '--live-rebuild y' > option, then it would probably be called during dependency calc. So it would be similar to pkg_config, with respect to dependencies. The problem is that it won't be guaranteed that any build time dependencies (like dev-vcs/git) are satisfied at this point. So either git would have to be a runtime dependency for any affected package (which is somewhat ugly), or we would need a new dependency type. I'd say this is strictly related to src_fetch() dependency handling. I don't really see putting some intermediate install in middle of dependency resolution, so I'd guess PM would need to keep appropriate dependencies installed. Then I don't understand it. I thought the PM would call the pkg_needrebuild phase function of the _installed_ package? (For a package that isn't installed the question if it needs to be rebuilt doesn't arise.) (In reply to Ulrich Müller from comment #9) > Then I don't understand it. I thought the PM would call the pkg_needrebuild > phase function of the _installed_ package? (For a package that isn't > installed the question if it needs to be rebuilt doesn't arise.) Yes, but if it has extra dependencies needed to run the phase, then you either need to ensure that they aren't cleaned, or install them before running the phase... which would mean having an unintended install run in action that isn't supposed to install stuff. The package manager could check if DEPEND (possibly FETCHDEPEND if we add a new variable) is satisfied for relevant packages, and if not then bail out and advise the user to run a command that installs the relevant dependencies (`emerge --noreplace --with-bdeps=y @live` or something like that). *** Bug 693660 has been marked as a duplicate of this bug. *** (In reply to Michał Górny from comment #0) > (better name appreciated :P) Definitely needed, because pkg_needrebuild contains "ebuild" as a substring and therefore is a reserved name. |