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
- arch rolling: libsolv 0.7.41-1 Β· BSD-3-Clause
- fedora 44: libsolv-devel 0.7.41-1.fc44 Β· BSD-3-Clause
- fedora 44: libsolv-devel 0.7.41-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms