Ticket #1314 (new defect)

Opened 4 years ago

Last modified 4 years ago

'cave resolve' checks other slots of an ~arch masked dependency even if a slot was defined in the dependcency atom

Reported by: christian. Owned by:
Priority: Sometime Milestone:
Component: clients/cave Version: 2.0.0
Keywords: Cc:
Blocked By: Blocking:
Distribution: Gentoo

Description

Hey there,

when I was trying to install www-apps/redmine on Gentoo, I was stuck with some blockers in the Ruby area. I know Ruby on Gentoo is somewhat broken, but I usually manage to get it to work. Anyway, while narrowing down the right configuration for keywords and USE flags to install www-apps/redmine, I stumbled upon some interesting behaviour regarding the resolution of ~arch masked packages required to successfully resolve.

I made a minimal test case in form of a tiny repository/overlay named "sandbox", which boils down to the following:

  • I am trying to do "cave resolve some-cat/target"
  • contains two packages some-cat/target and its dependency some-cat/dependency
  • some-cat/dependency has slots "1", "2", "3"
  • in slot "2" there are two versions "2.0" and "2.1", and only one version in the other slots
  • some-cat/target-1 has dependency ">=some-cat/dependency-2.0:2"
  • all versions of "some-cat/dependency" are ~arch masked.

Now, I expect "cave" to tell me something along the line: You have to unmask some-cat/dependency-2.1. But instead it kinda indicates to unmask some-cat/dependency-3:3 -- which cannot satisfy the dependency -- even though it knows, that the actual dependency is on slot 2.

Here is what actually happens:

$ sudo cave resolve some-cat/target
Done: 10 steps              

These are the actions I will take, in order:

n   some-cat/target:1::sandbox 1 to ::installed
    "target"
    build_options: symbols=split -dwarf_compress -optional_tests -trace work=tidyup
    Reasons: target

Total: 1 new installs

Build Options:
    dwarf_compress:                Compress DWARF2+ debug information
    optional_tests:                Run tests considered by the package to be optional
    symbols:                       How to handle debug symbols in installed files
    trace:                         Trace actions executed by the package (very noisy, for debugging broken builds only)
    work:                          Whether to preserve or remove working directories



I encountered the following errors:

!   some-cat/dependency
    Reasons: some-cat/target-1:1::sandbox
    Unsuitable candidates:
      * some-cat/dependency-3:3::sandbox
        Masked by keyword
            Keywords ~amd64 ~x86
        Did not meet >=some-cat/dependency-2.0:2, use existing if possible, installing to / from some-cat/target-1:1::sandbox

I know the information is sort of in the error message (i. e. ">=some-cat/dependency-2.0:2"), but I expected some message like:

I encountered the following errors:

!   some-cat/dependency
    Reasons: some-cat/target-1:1::sandbox
    Unsuitable candidates:
      * some-cat/dependency-2.1:2::sandbox
        Masked by keyword
            Keywords ~amd64 ~x86

As soon as the correct package (some-cat/dependency-2.1) is unmasked, it goes through just fine.

While figuring out which packages to unmask, I realized that it was some iterative process: As soon as I unmasked the right slot new errors (i. e. packages) appeared. I think "cave" did go down the wrong road (i. e. slot), when trying to give the user all the packages which needed to be unmasked.

Attachments

sandbox.tar.xz Download (1.4 KB) - added by christian. 4 years ago.
sandbox repository providing minimal test-case

Change History

Changed 4 years ago by christian.

sandbox repository providing minimal test-case

comment:1 follow-up: ↓ 2 Changed 4 years ago by ciaranm

Can you use --explain to see the constraints that are in action?

comment:2 in reply to: ↑ 1 Changed 4 years ago by christian.

Sure thing:

# cave resolve some-cat/target --explain 'some-cat/dependency'
Done: 10 steps              

These are the actions I will take, in order:

n   some-cat/target:1::sandbox 1 to ::installed
    "target"
    build_options: symbols=split -dwarf_compress -optional_tests -trace work=tidyup
    Reasons: target

Total: 1 new installs

Build Options:
    dwarf_compress:                Compress DWARF2+ debug information
    optional_tests:                Run tests considered by the package to be optional
    symbols:                       How to handle debug symbols in installed files
    trace:                         Trace actions executed by the package (very noisy, for debugging broken builds only)
    work:                          Whether to preserve or remove working directories

I encountered the following errors:

!   some-cat/dependency
    Reasons: some-cat/target-1:1::sandbox
    Unsuitable candidates:
      * some-cat/dependency-3:3::sandbox
        Masked by keyword
            Keywords ~amd64 ~x86
        Did not meet >=some-cat/dependency-2.0:2, use existing if possible, installing to / from some-cat/target-1:1::sandbox

Explaining requested decisions:

For some-cat/dependency:3::(install_to_slash):
    The following constraints were in action:
      * >=some-cat/dependency-2.0:2, use existing if possible, installing to /
        Because of >=some-cat/dependency-2.0:2 from some-cat/target-1:1::sandbox, key 'Build dependencies', labelled 'DEPEND'
    No decision could be made
Note: See TracTickets for help on using tickets.