You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #151 introduced initial support for resolving dependencies across multiple architectures for resolve or lockfile commands.
However, including the same package for multiple architectures within a single resolution context remains problematic. Since this is a common requirement in cross-compilation use cases, I suggest extending multi-arch resolution to fully support such scenarios.
Looking forward to your feedback!
Proposed changes
Packages need to be identified by some combination of name and arch, instead of just by name. The bazeldnf code will distinguish between foo.x86_64 and foo.i686 as separate packages.
The alias repository needs to provide access to multiple architectures of a package. This behaviour should be customizable with a client-provided macro, as it's hard to derive a one-size-fits-all solution. The default implementation could be, for example:
@bazeldnf_rpms//foo:foo - points to the primary/default architecture
@bazeldnf_rpms//foo:foo.x86_64 - points to the x86_64 version
@bazeldnf_rpms//foo:foo.i686 - points to the i686 version
SAT loaders / constraint updates:
Group packages by (name, arch) instead of just name for the purposes of "best" version, so that the choice is fully independent between distinct architectures of the same package. This also gives possibility for foo.i686 to participate in dependency resolution even if foo.x86_64 is the best for foo.
Relax provider uniqueness constraints – multiple packages may provide the same capability (e.g. if they have different architectures). In a multi-arch setting this is essential, as packages are often required just by their name or by library name, which is shared between multiple architectures. This also more closely matches the behaviour of dnf, where we could have e.g. multiple providers of webserver. (Related: SAT solver: Relax unique package provider clause for a package requires #142).
Because of the above, we need to add all providers as dependencies in the lock file – if the requirement is satisfied by more than one package. Let's just list them all and let the client make a choice. This can be perceived as matching the system environment more closely, where any package has access to the full filesystem anyway, which includes all possible requirement alternatives to its requirement.
Lockfile format extensions:
id field containing a unique, opaque identifier for each package. Useful for constructing repository names and mapping dependencies within the lockfile. So far, only the package name was used for these purposes.
arch field containing the package architecture, which can be used later in the alias repository for custom logic.
Backwards Compatibility
Existing single-architecture workflows will continue to work unchanged. Old lockfiles will be supported. With default settings, target references in the alias repository will remain compatible for single-architecture cases.
PR #151 introduced initial support for resolving dependencies across multiple architectures for
resolveorlockfilecommands.However, including the same package for multiple architectures within a single resolution context remains problematic. Since this is a common requirement in cross-compilation use cases, I suggest extending multi-arch resolution to fully support such scenarios.
Looking forward to your feedback!
Proposed changes
Packages need to be identified by some combination of
nameandarch, instead of just byname. The bazeldnf code will distinguish betweenfoo.x86_64andfoo.i686as separate packages.The alias repository needs to provide access to multiple architectures of a package. This behaviour should be customizable with a client-provided macro, as it's hard to derive a one-size-fits-all solution. The default implementation could be, for example:
@bazeldnf_rpms//foo:foo- points to the primary/default architecture@bazeldnf_rpms//foo:foo.x86_64- points to the x86_64 version@bazeldnf_rpms//foo:foo.i686- points to the i686 versionSAT loaders / constraint updates:
Group packages by (name, arch) instead of just name for the purposes of "best" version, so that the choice is fully independent between distinct architectures of the same package. This also gives possibility for
foo.i686to participate in dependency resolution even iffoo.x86_64is the best forfoo.Relax provider uniqueness constraints – multiple packages may provide the same capability (e.g. if they have different architectures). In a multi-arch setting this is essential, as packages are often required just by their name or by library name, which is shared between multiple architectures. This also more closely matches the behaviour of
dnf, where we could have e.g. multiple providers ofwebserver. (Related: SAT solver: Relax unique package provider clause for a package requires #142).Because of the above, we need to add all providers as dependencies in the lock file – if the requirement is satisfied by more than one package. Let's just list them all and let the client make a choice. This can be perceived as matching the system environment more closely, where any package has access to the full filesystem anyway, which includes all possible requirement alternatives to its requirement.
Lockfile format extensions:
idfield containing a unique, opaque identifier for each package. Useful for constructing repository names and mapping dependencies within the lockfile. So far, only the package name was used for these purposes.archfield containing the package architecture, which can be used later in the alias repository for custom logic.Backwards Compatibility
Existing single-architecture workflows will continue to work unchanged. Old lockfiles will be supported. With default settings, target references in the alias repository will remain compatible for single-architecture cases.