LIBSOLV(3)

πŸ’– LIBSOLV(3) β€” the libsolv manual, bestie edition πŸ’–

okay so. libsolv is a package dependency solver library using a satisfiability algorithm. that's the whole name section, that's the vibe, we move. it's section 3 of the manual, so it's a library page, and yes it is iconic 🫢


✨ DOCUMENTATION ✨

so the libsolv docs are not one big blob, they're split into multiple parts, like a little doc-iverse 🌈 here's the lineup:

  • libsolv-history β€” the origin story. how the libsolv library came into existence. it's giving lore, fr fr πŸ“–
  • libsolv-constantids β€” fixed Ids for often used strings. the classics get their own permanent badges πŸ’…
  • libsolv-bindings β€” access libsolv from perl/python/ruby. yes queen, you don't have to write C 🐍
  • libsolv-pool β€” libsolv's pool object. the main character of the whole operation πŸ‘‘

πŸŽ€ POINTER VALIDITY πŸŽ€

okay bestie sit down, this one is important and it's a big mood. 😭

note that all pointers to objects that have an Id have only a limited validity period, with the exception of Repo pointers. they are only guaranteed to be valid until a new object of that type is added or an object of that type is removed. so like, pointers to Solvable objects are only valid until another solvable is created, because adding a Solvable may relocate the Pool's Solvable array. πŸ’€ this is also true for Pool strings β€” you should use solv_strdup() to create a copy of the string if you want to use it at some later time. you should use the Ids in the code and not the pointers, except for short times where you know that the pointer is safe. short times only, bestie, don't get attached ⏳

like holding hands in the hallway between classes. valid for one moment. then the bell rings. πŸ””

note also that the data lookup functions or the dataiterator also return values with limited lifetime. this is especially true for data stored in the paged data segment of solv files. this is normally data that consists of big strings like package descriptions, or is not often needed like package checksums. so here's the trap: looking up a description of a solvable and then looking up the description of a different solvable β€” or even the checksum of the same solvable β€” may invalidate the first result. πŸ™ˆ (the dataiterator supports a dataiterator_strdup() function to create a safe copy, so use it, she's right there πŸ’–)

the language bindings already deal with pointer validity, so you do not have to worry about this issue when using the bindings. bindings girlies stay winning, no cap ✨


🌸 SECURITY 🌸

solv files are meant as a caching mechanism, thus the solv file reader is optimized for speed and does only few bound checks.

do NOT use it to read solv files that come from untrusted sources. 🚨 seriously. this is not a vibe check you want to fail. πŸ”₯πŸ’€

πŸ’œ AUTHOR πŸ’œ

Michael Schroeder <mls@suse.de> β€” thank you for your service, king πŸ‘‘πŸ«Ά


and that's the whole page bestie!! this was the libsolv manual β€” section 3 β€” from the libsolv source, dated 09/30/2026, later version of the LIBSOLV(3) header. go build something slay with it πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from