Skip to content

Commit f0573e0

Browse files
speak-agentclaude
andcommitted
the resolved provider is matched by name, not by substring
`Layer::impl` is `name@version`. A substring test matched `openkal` against `openkal-linux@0.15.0` and would have read one implementation's interface list as another's. The name is what precedes the separator. Co-authored-by: Claude Code <noreply@anthropic.com>
1 parent 9aa57be commit f0573e0

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎src/build/prepare.cppm‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11194,10 +11194,17 @@ prepare_build(bool print_fingerprint,
1119411194
std::string providerId;
1119511195
for (auto& pkg : packages) {
1119611196
if (pkg.manifest.kernelAbiProvidesInterfaces.empty()) continue;
11197-
if (!resolvedTargetSide.kernelAbi.impl.empty()
11198-
&& resolvedTargetSide.kernelAbi.impl.find(
11199-
pkg.manifest.package.name) == std::string::npos)
11200-
continue;
11197+
// `impl` is `name@version`; the name is what precedes the
11198+
// separator. A substring test would match `openkal` against
11199+
// `openkal-linux@0.15.0` and read one implementation's list
11200+
// as another's.
11201+
if (!resolvedTargetSide.kernelAbi.impl.empty()) {
11202+
auto const& impl = resolvedTargetSide.kernelAbi.impl;
11203+
const auto at = impl.find('@');
11204+
const auto implName = at == std::string::npos
11205+
? impl : impl.substr(0, at);
11206+
if (implName != pkg.manifest.package.name) continue;
11207+
}
1120111208
providedInterfaces = pkg.manifest.kernelAbiProvidesInterfaces;
1120211209
providerId = pkg.manifest.package.name;
1120311210
break;

0 commit comments

Comments
 (0)