Conversation
e96bc6f to
ce3eaaf
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors libzypp’s SAT/pool plumbing by introducing zyppng SAT infrastructure (Pool, Repository, Queue, namespace providers/components) and centralizing libsolv stringpool usage via a new StringPool singleton, while also normalizing includes (notably Functional.h) and adding CMake helpers for GLib/GObject introspection.
Changes:
- Replace legacy SAT pool access with
zyppng::sat::StringPooland add a new zyppng SATPool/Repository/Queuestack plus modularPoolComponents and namespace providers. - Update headers to include
zypp-core/base/Functional.hand add a compat header for the old include path. - Add new CMake modules for GLib tools and gobject-introspection support; adjust glib event loop/dispatcher code to accept an optional
GMainContext*.
Reviewed changes
Copilot reviewed 129 out of 564 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| zypp/zypp/ZYppFactory.cc | Switch Functional header include to the zypp-core path. |
| zypp/zypp/ZConfig.cc | Move architecture autodetection to Arch::detectSystemArchitecture(). |
| zypp/zypp/ResPoolProxy.cc | Switch Functional header include to the zypp-core path. |
| zypp/zypp/ResFilters.h | Switch Functional header include to the zypp-core path. |
| zypp/zypp/ProvideFilePolicy.h | Switch Functional header include to the zypp-core path. |
| zypp/zypp/ProblemTypes.h | Switch Functional header include to the zypp-core path. |
| zypp/zypp/Filter.h | Switch Functional header include to the zypp-core path. |
| zypp/zypp/Capability.h | Trivial whitespace change in Capability API header. |
| zypp/zypp/Capability.cc | Migrate richdep parsing / pool access to zyppng::sat::StringPool. |
| zypp/zypp/Capabilities.h | Remove legacy PoolMember include dependency. |
| zypp/zypp-compat/zypp/base/Functional.h | Add compat forwarding header for legacy zypp/base/Functional.h. |
| zypp/zypp-compat/CMakeLists.txt | Install new compat Functional header. |
| zypp-logic/zypp/sat/detail/PoolMember.h | Factor libsolv C type aliases/IDs into PoolDefines.h. |
| zypp-logic/zypp/sat/detail/PoolDefines.h | New shared sat/detail type/id definitions header. |
| zypp-logic/zypp/ng/sat/stringpool.h | New singleton wrapper around libsolv Pool for string resolution. |
| zypp-logic/zypp/ng/sat/stringpool.cc | Implement StringPool lifecycle and pool creation/freeing. |
| zypp-logic/zypp/ng/sat/solvattr.h | Add zyppng wrapper for zypp::sat::SolvAttr. |
| zypp-logic/zypp/ng/sat/solvableident.h | New helper for splitting kind/name identifiers in zyppng SAT. |
| zypp-logic/zypp/ng/sat/solvableident.cc | Implement identifier splitting logic. |
| zypp-logic/zypp/ng/sat/repository.h | New zyppng SAT Repository abstraction. |
| zypp-logic/zypp/ng/sat/repository.cc | Implement Repository operations (metadata, solvable iteration, add solv/helix/testtags). |
| zypp-logic/zypp/ng/sat/queue.h | New zyppng Queue wrapper around libsolv Queue. |
| zypp-logic/zypp/ng/sat/queue.cc | Implement Queue operations and comparisons. |
| zypp-logic/zypp/ng/sat/poolmember.h | New minimal PoolMember base for zyppng SAT wrappers. |
| zypp-logic/zypp/ng/sat/poolmember.cc | Implement global Pool access for PoolMember. |
| zypp-logic/zypp/ng/sat/poolconstants.h | New zyppng SAT constants/types header bridging to zypp sat/detail. |
| zypp-logic/zypp/ng/sat/pool.h | New zyppng SAT Pool orchestrator with component hooks. |
| zypp-logic/zypp/ng/sat/pool.cc | Implement Pool orchestration, repo management, whatprovides helpers. |
| zypp-logic/zypp/ng/sat/namespaces/namespaceprovider.h | New namespace provider base class for libsolv namespace callbacks. |
| zypp-logic/zypp/ng/sat/namespaces/namespaceprovider.cc | Implement provider attach + dirty notification logic. |
| zypp-logic/zypp/ng/sat/namespaces/modalias.h | Add provider for modalias namespace resolution. |
| zypp-logic/zypp/ng/sat/namespaces/modalias.cc | Implement modalias decode + callback evaluation. |
| zypp-logic/zypp/ng/sat/namespaces/language.h | Add provider for language/locale namespace resolution. |
| zypp-logic/zypp/ng/sat/namespaces/language.cc | Implement requested/available locale tracking and matching. |
| zypp-logic/zypp/ng/sat/namespaces/filesystem.h | Add provider for filesystem namespace derived from sysconfig. |
| zypp-logic/zypp/ng/sat/namespaces/filesystem.cc | Implement filesystem provider lazy parsing + file watching. |
| zypp-logic/zypp/ng/sat/components/poolcomponents.h | Introduce component model for Pool lifecycle hooks. |
| zypp-logic/zypp/ng/sat/components/poolcomponents.cc | Translation unit placeholder for poolcomponents. |
| zypp-logic/zypp/ng/sat/components/packagepolicycomponent.h | Add package policy component (retracted/PTF/reboot hints). |
| zypp-logic/zypp/ng/sat/components/packagepolicycomponent.cc | Implement invalidation and whatprovides-based initialization. |
| zypp-logic/zypp/ng/sat/components/namespacecomponent.h | Add component installing libsolv namespace callbacks. |
| zypp-logic/zypp/ng/sat/components/namespacecomponent.cc | Implement callback routing to registered providers. |
| zypp-logic/zypp/ng/sat/components/autoinstalledcomponent.h | Add component tracking autoinstalled solvables. |
| zypp-logic/zypp/ng/sat/components/autoinstalledcomponent.cc | Clear autoinstalled state when system repo is removed. |
| zypp-logic/zypp/ng/sat/components/architecturecomponent.h | Add component syncing/using detected system architecture. |
| zypp-logic/zypp/ng/sat/components/architecturecomponent.cc | Implement pool arch sync and repo arch filtering. |
| zypp-logic/zypp/ng/sat/capabilities.h | New zyppng SAT Capabilities container and iterator. |
| zypp-logic/zypp/ng/sat/capabilities.cc | Implement Capabilities construction/size logic. |
| zypp-logic/zypp/ng/sat/cap2str.h | New shared SAT ID-to-string conversion helpers. |
| zypp-logic/zypp/ng/sat/cap2str.cc | Implement recursive richdep stringification utilities. |
| zypp-logic/zypp/ng/restraits.h | Add zyppng wrapper for zypp/ResTraits.h. |
| zypp-logic/zypp/ng/resolvernamespace.h | Add zyppng wrapper for zypp/ResolverNamespace.h. |
| zypp-logic/zypp/ng/reskind.h | Add zyppng wrapper for zypp/ResKind.h. |
| zypp-logic/zypp/ng/relcompare.h | Add zyppng wrapper for zypp/RelCompare.h. |
| zypp-logic/zypp/ng/rel.h | Add zyppng wrapper for zypp/Rel.h. |
| zypp-logic/zypp/ng/range.h | Add zyppng wrapper for zypp/Range.h. |
| zypp-logic/zypp/ng/log/sat/solvable.h | Add log formatter specialization for zyppng SAT Solvable. |
| zypp-logic/zypp/ng/log/sat/solvable.cc | Implement Solvable log formatting. |
| zypp-logic/zypp/ng/log/sat/repository.h | Add log formatter specialization for zyppng SAT Repository. |
| zypp-logic/zypp/ng/log/sat/repository.cc | Implement Repository log formatting. |
| zypp-logic/zypp/ng/log/sat/queue.h | Add log formatter specialization + dump helpers for SAT Queue. |
| zypp-logic/zypp/ng/log/sat/queue.cc | Implement Queue logging/dumping. |
| zypp-logic/zypp/ng/log/sat/lookupattr.h | Add log formatter specializations for LookupAttr and iterator internals. |
| zypp-logic/zypp/ng/log/sat/lookupattr.cc | Implement LookupAttr logging/dump helpers. |
| zypp-logic/zypp/ng/log/sat/capability.h | Add log formatter specializations for Capability and CapDetail. |
| zypp-logic/zypp/ng/log/sat/capability.cc | Implement Capability/CapDetail formatted output using sat pool. |
| zypp-logic/zypp/ng/log/sat/capabilities.h | Add log formatter specialization for Capabilities. |
| zypp-logic/zypp/ng/log/sat/capabilities.cc | Stub out Capabilities formatter implementation (currently no output). |
| zypp-logic/zypp/ng/log/format.h | Add generic log formatting framework (formatter, view_proxy). |
| zypp-logic/zypp/ng/locale.h | Add zyppng wrapper for zypp/Locale.h + LocaleSet alias. |
| zypp-logic/zypp/ng/languagecode.h | Add zyppng wrapper for zypp/LanguageCode.h. |
| zypp-logic/zypp/ng/idstringtype.h | Add zyppng wrapper for zypp/IdStringType.h. |
| zypp-logic/zypp/ng/idstring.h | Add zyppng wrapper for zypp/IdString.h. |
| zypp-logic/zypp/ng/edition.h | Add zyppng wrapper for zypp/Edition.h. |
| zypp-logic/zypp/ng/dep.h | Add zyppng wrapper for zypp/Dep.h. |
| zypp-logic/zypp/ng/cpeid.h | Add zyppng wrapper for zypp/CpeId.h. |
| zypp-logic/zypp/ng/countrycode.h | Add zyppng wrapper for zypp/CountryCode.h. |
| zypp-logic/zypp/ng/capmatch.h | Add zyppng wrapper for zypp/CapMatch.h. |
| zypp-logic/zypp/ng/bit.h | Add zyppng wrapper for zypp/Bit.h. |
| zypp-logic/zypp/ng/base/strmatcher.h | Add zyppng wrapper for zypp/base/StrMatcher.h (+ ADL helpers). |
| zypp-logic/zypp/ng/base/settracker.h | Add zyppng wrapper for zypp/base/SetTracker.h (+ ADL helper). |
| zypp-logic/zypp/ng/base/serialnumber.h | Add zyppng wrapper for zypp/base/SerialNumber.h. |
| zypp-logic/zypp/ng/arch.h | Add zyppng wrapper for zypp/Arch.h (exports Arch constants). |
| zypp-logic/zypp/base/SetTracker.h | Add missing <ostream> include. |
| zypp-logic/zypp/RelCompare.h | Remove unused <functional> include. |
| zypp-logic/zypp/Locale.h | Exclude Locale::bestMatch under ZYPPNG. |
| zypp-logic/zypp/Locale.cc | Exclude bestMatch implementation under ZYPPNG. |
| zypp-logic/zypp/LanguageCode.cc | Change include to local header path ordering. |
| zypp-logic/zypp/IdStringType.h | Make PoolMember inheritance conditional under legacy/non-ZYPPNG. |
| zypp-logic/zypp/IdString.h | Make PoolMember inheritance conditional under legacy/non-ZYPPNG. |
| zypp-logic/zypp/IdString.cc | Switch stringpool operations to zyppng::sat::StringPool. |
| zypp-logic/zypp/Edition.h | Remove unused <functional> include. |
| zypp-logic/zypp/Edition.cc | Switch evr compare/match pool access to zyppng::sat::StringPool. |
| zypp-logic/zypp/Dep.h | Add zypp-core/Globals.h include. |
| zypp-logic/zypp/CountryCode.cc | Change include to local header path ordering. |
| zypp-logic/zypp/Arch.h | Add Arch::detectSystemArchitecture() API. |
| zypp-logic/zypp/Arch.cc | Move architecture autodetection logic here from ZConfig. |
| zypp-logic/zypp-curl/ng/network/request.h | Remove export macro from NetworkRequest declaration. |
| zypp-logic/zypp-curl/ng/network/networkrequesterror.h | Remove export macro from NetworkRequestError declaration. |
| zypp-logic/zypp-curl/ng/network/networkrequestdispatcher.h | Remove export macro from NetworkRequestDispatcher declaration. |
| zypp-logic/zypp-core/zypp-core.cmake | Add base/Functional.h to installed core headers list. |
| zypp-logic/zypp-core/ng/thread/asyncqueue.h | Remove export macro from AsyncQueueWatch declaration. |
| zypp-logic/zypp-core/ng/meta/type_traits.h | Add always_false_v helper. |
| zypp-logic/zypp-core/ng/base/zyppglobal.h | Remove export macro definitions/include for zyppng shared library. |
| zypp-logic/zypp-core/ng/base/threaddata.cc | Allow dispatcher creation with a GMainContext*. |
| zypp-logic/zypp-core/ng/base/private/threaddata_p.h | Forward declare GMainContext and plumb it into ensureDispatcher. |
| zypp-logic/zypp-core/ng/base/private/eventdispatcher_glib_p.h | Allow EventDispatcherPrivate creation with a GMainContext*. |
| zypp-logic/zypp-core/ng/base/private/base_p.h | Add per-object data storage map for native wrapper plumbing. |
| zypp-logic/zypp-core/ng/base/eventloop_glib.cc | Add EventLoop creation with explicit dispatcher/context; ensure context pop on exit. |
| zypp-logic/zypp-core/ng/base/eventloop.h | Add EventLoop factory overloads taking a GMainContext* / dispatcher. |
| zypp-logic/zypp-core/ng/base/eventdispatcher_glib.cc | Thread context plumbed into dispatcher; expose glibContext(). |
| zypp-logic/zypp-core/ng/base/eventdispatcher.h | Update dispatcher pointer typedefs and add glibContext() accessor. |
| zypp-logic/zypp-core/ng/base/base.h | Add per-object data API for native bindings; include AutoDispose. |
| zypp-logic/zypp-core/ng/base/base.cc | Implement per-object data API. |
| zypp-logic/zypp-core/ng/base/abstracteventsource.h | Remove export macro from AbstractEventSource declaration. |
| zypp-logic/zypp-core/base/defaultintegral.h | Change include from <iosfwd> to <string>. |
| zypp-logic/zypp-core/base/Functional.h | Rename header guard to zypp-core variant and comment out includes. |
| zypp-logic/zypp-common/private/keyring_p.cc | Switch to zypp-core/fs TmpPath/PathInfo and include KeyRing exceptions. |
| zypp-logic/zypp-common/PublicKey.cc | Switch to zypp-core/fs TmpPath/PathInfo. |
| cmake/modules/GObjectIntrospection.cmake | Add helper to generate GIR/typelib using pkg-config. |
| cmake/modules/GLibTools.cmake | Add helper functions for glib-mkenums/genmarshal/compile-resources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| const detail::CQueue * l = lhs; | ||
| const detail::CQueue * r = rhs; | ||
| return( l == r || ( l->count == r->count && ::memcmp( l->elements, r->elements, l->count ) == 0 ) ); |
There was a problem hiding this comment.
::memcmp is comparing only l->count bytes, but elements is an array of IdType values. This will yield false positives/negatives for queues larger than 1 byte per element. Compare l->count * sizeof(*l->elements) bytes (or iterate elements) instead.
| return( l == r || ( l->count == r->count && ::memcmp( l->elements, r->elements, l->count ) == 0 ) ); | |
| return( l == r || ( l->count == r->count && ::memcmp( l->elements, r->elements, l->count * sizeof(*l->elements) ) == 0 ) ); |
| NO_REPOSITORY_THROW( zypp::Exception( "Can't add solvables to norepo." ) ); | ||
|
|
||
| std::string command( file_r.extension() == ".gz" ? "zcat " : "cat " ); | ||
| command += file_r.asString(); |
There was a problem hiding this comment.
Building a shell command by concatenating file_r.asString() and passing it to popen enables command injection if the path contains shell metacharacters (and is also inconsistent with addTesttags, which does quote). Prefer avoiding the shell entirely (e.g., open the file directly and use a gzip reader for .gz, or spawn the tool via an exec-style API with argument vector).
| command += file_r.asString(); | |
| command += zypp::str::quote( file_r.asString() ); |
76119f5 to
e5514ff
Compare
There is no longer a need to mark C++ code in zyppng as EXPORT, we do not plan to export any of those classes, in favor of the glib-C API.
- Add always_false_v<> helper template to type_traits.h (needed by NG sat) - Fix include paths in keyring_p.cc: use zypp-core/fs/ instead of zypp/ - Add missing KeyRingException.h include to keyring_p.cc - Comment out unused includes in Functional.h - Fix defaultintegral.h: use <string> instead of <iosfwd> - Temporarily disable zypp-common in zyppng build (depends on legacy zypp headers not available in NG context) - Fix DZYPPNG definition to use =1 - Fix Provider_test.cc to use zypp-core TmpPath include
Move fundamental zypp types (Arch, Edition, IdString, Rel, Dep, Locale, CountryCode, LanguageCode, CapMatch, CpeId, Range, ResKind, ResTraits, ResolverNamespace, RelCompare, IdStringType, Bit) and base utilities (SerialNumber, SetRelationMixin, SetTracker, StrMatcher) from the legacy layer (zypp/zypp/) to the shared layer (zypp-logic/zypp/). Also moves sat/SolvAttr and introduces the new shared sat infrastructure: sat/detail/PoolDefines.h, sat/detail/PoolMember.h (rewritten for the shared layer), and ng/sat/stringpool.h, ng/sat/stringpool.cc, ng/sat/poolconstants.h which provide the NG string pool that the moved core types depend on. The legacy CMakeLists.txt is updated to remove the moved files, and zypp-logic/zypp/zypp.cmake is extended to compile them in the shared object library.
Add zyppng namespace wrapper headers that re-export the shared core types (Arch, Bit, CapMatch, CpeId, CountryCode, Dep, Edition, IdString, IdStringType, LanguageCode, Locale, Range, Rel, RelCompare, ResKind, ResTraits, ResolverNamespace) and base utilities (SerialNumber, SetTracker, StrMatcher) into the zyppng namespace via using declarations. These thin headers in zypp-logic/zypp/ng/ allow next-gen code to use zyppng::Arch, zyppng::Edition, etc. without directly depending on legacy zypp:: types.
Add the next-gen sat pool infrastructure to the shared layer: - Pool, PoolMember, Solvable, Queue, Repository, Capability, Capabilities, Cap2Str, LookupAttr, LookupAttrTools, SolvableIdent, SolvAttr (NG wrapper) - Pool components: ArchitectureComponent, AutoInstalledComponent, PackagePolicyComponent, NamespaceComponent, PoolComponents These provide the zyppng::sat namespace with a modern, component-based pool implementation that wraps libsolv while maintaining a clean separation from the legacy zypp::sat layer.
Add namespace provider infrastructure for the NG sat pool: - NamespaceProvider base class for extensible namespace callback handling - FilesystemNamespace for file dependency namespace resolution - LanguageNamespace for locale-based namespace resolution - ModaliasNamespace for hardware modalias namespace resolution These providers are registered with the NG pool to handle libsolv namespace callback queries during dependency resolution.
Add logging and formatting support for NG sat types: - ng/log/format.h: Generic format helper for stream output - Specialized stream operators for Capability, Capabilities, Solvable, Queue, Repository, and LookupAttr in the zyppng::sat namespace These enable consistent debug/log output for all NG sat types using the zypp logging infrastructure.
Update legacy code to work with the shared layer: - Capability.h/cc: Migrate Capability change to use NG sat types - Capabilities.h: Remove unused include - Queue.h: Update include path for shared PoolMember - ZConfig.cc: Move architecture definitions to shared Arch.cc - PoolImpl.cc: Add NG pool string pool integration Add zyppng application data and pool test infrastructure: - applicationdata.h/cc: Application-wide data for the NG context - PoolNg_test.cc: Comprehensive test for NG sat::Pool including repository management, solvable queries, capability matching, and pool stability verification
No description provided.