Fedora:...::Solver(3)

๐Ÿ“ฆ
version 0.12.1 ยท 2 versions
, in fedora 43

๐Ÿ’– Fedora::Rebuild::Solver ๐Ÿ’–

okay so bestie, welcome to Fedora:...::Solver(3) โ€” it's part of the User Contributed Perl Documentation and it's literally just the Dependency solver for Fedora::Rebuild. She's the one who figures out whether stuff can actually be built and installed. no cap.


โœจ NAME โœจ

Fedora::Rebuild::Solver โ€” Dependency solver. that's it, that's the whole vibe. ๐Ÿ‘‘


๐ŸŽ€ CONSTRUCTOR ๐ŸŽ€

new(packages => $packages, dependencyfilter => sub {})

So new prepares (initilializes, as the ancients wrote it) a depencency solver sitting on top of a packackage set. (typos are part of the lore, don't @ me ๐Ÿ’…). Here are the possible attributes, bestie:

  • packages โ€” the set of packages, a Fedora::Rebuild::Set::Package object, with provides and requires all populated. This one is mandatory, like fr fr you cannot skip it.
  • dependencyfilter โ€” a reference to a function that takes three arguments (dependency name, relation flag, version) and returns false if the dependency should be considered, true otherwise. If this attribute is undef or just... missing, then no filtering happens at all โ€” i.e. the exact same effect as sub {1}. This one is optional. โœจ

๐Ÿ”’ PRIVATE ATTRIBUTES ๐Ÿ”’

these are private, bestie. look with your eyes, not with your hands.

cache

This is the cache of binary packages that have already been resolved as installable or not installable.

To keep coherency, do not update $self->packages or the referenced packages. ๐Ÿšซ

It's a reference to a hash of binary package names. The values hold a verdict (true for installable, false otherwise) and a message (a string of dependencies, or the reason why it's not installable).

providers

This is a reverse cache of binary packages and their providers.

To keep coherency, do not update $self->packages or the referenced packages. ๐Ÿšซ (yes, same warning, she means it)

This is a Fedora::Rebuild::Providers object. This attribute gets built in the constructor so it's ready before spawning threads. multitasking icon behavior. ๐Ÿงต


๐ŸŒธ METHODS ๐ŸŒธ

invalidate_cache()

This call invalidates the internal cache of verdicts. No arguments are recognized. don't try it. ๐Ÿ™ˆ

add_to_cache($binarypackage, $is_installable, $message)

Adds an is_installable() result into the verdict cache. ๐Ÿซถ

is_installable_recursive($package, $binarypackage, $message, $verbose, $backpath)

Decides a package is installable now and sets the string of dependencies.

This is a private method, use is_installable() instead. iykyk.
  • $package โ€” is a source package object.
  • $binarypackage โ€” is a binary package ENVR as index to $package->runrequies. (yes, runrequies, that's the actual name, leave her alone ๐Ÿ˜ญ)
  • $message โ€” is a reference to the variable where you store the (not-)found dependencies. Pass undef if you don't care.
  • verbose โ€” if true, logs the whole dependency tree. Becuse this can consume a lot of memory, the recommended value is false, which will cause logging only of unsatisfied dependencies. protect your RAM bestie ๐Ÿง ๐Ÿ’€
  • $backpath โ€” is a reference to a list of binary packages on the path in the dependecy tree from parent to root (i.e. root is last element). It's used to detect a cycle. ๐Ÿ”„

Return 0 for false, 1 for true, 2 for cycle. Fills the list of dependencies into $$message (without trailing new line) which is a reference itself.

is_installable($self, $package, $binarypackage, $message, $verbose)

Decides whether a $binarypackage compiled from source $package is installable now.

This is a hard problem, ngl โ€” it requires recursive evaluation of each package satisifying the run-time dependency of the previous package. the way that she recurses... ๐Ÿ˜ฎโ€๐Ÿ’จ

Return 0 for false, 1 or true, undef for error while deciding. Fills an error message (without trailing new line) into the reference of the third argument if defined.

is_buildable($package, $message, $verbose)

Decides whether a package is buildable now and sets the string of dependenices.

Return 0 for false, 1 or true. Fills the list of dependencies into $message (without trailing new line) which is a reference itself (or undef if you don't care).


and that's the whole page, bestie!! you ate that. ๐Ÿ“

this iconic piece of documentation came to you courtesy of perl v5.42.0, dated 2025-07-25 โ€” go forth and resolve those dependencies, main character. ๐Ÿ‘‘โœจ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from