Skip to content

fix(loader): a recipe outside an index is read with the host's index libs (0.0.69) - #56

Merged
Sunrisepeak merged 2 commits into
openxlings:mainfrom
speak-agent:fix/loader-host-index
Dec 5, 2026
Merged

Sunrisepeak merged 2 commits into
openxlings:mainfrom
speak-agent:fix/loader-host-index

Conversation

@speak-agent

Copy link
Copy Markdown
Contributor

What | 内容

load_package re-runs a spec 3 recipe's top level in the spec 3 environment (check_spec3_top_level). That run read index libs only from the recipe's own index, three levels up the path. The executor's top level already used the host's index for a recipe in no index with libs (ReadTarget::pkgindex_dir, 0.0.68). So a recipe the host keeps outside an index could be installed but not read:

import: "xim.pkgindex.sysroot": this recipe is not in an index, which has no libs

That covers xlings' local overlay (xlings config --add-xpkg) and a recipe given by path. xim-pkgindex's registration test found it with xlings 2026.12.5.1 (openxlings/xim-pkgindex#1477).

  • LoaderContext gains pkgindex_dir, the host's answer. The top-level check uses it the way the executor does: the recipe's own index comes first.
  • The specification states the rule (§6.2). Version 0.0.69.
  • Test Spec3EnvTest.ALoadedRecipeOutsideAnIndexReadsTheHostsIndexLibs covers three cases:
    • with the host's index, the recipe is read;
    • without one, the load error names the reason;
    • the recipe's own index's lib is the one read.

Verification | 验证

mcpp test: 15 test programs, all passed. xlings passes pkgindex_root_for(recipe) in its metadata reads (openxlings/xlings#752).

Authorship | 作者

Authorship: ai-and-human

Sunrisepeak and others added 2 commits December 5, 2026 13:33
…libs, as its hooks run (0.0.69)

load_package re-runs a spec 3 recipe's top level in the spec 3 environment
(check_spec3_top_level), and that run took index libs only from the recipe's
own index, three levels up. The executor's top level already read the
host's index for a recipe in no index with libs (ReadTarget::pkgindex_dir),
so a recipe the host keeps outside an index -- xlings' local overlay
(`config --add-xpkg`), a recipe given by path -- installed but could not be
read: "import: "xim.pkgindex.sysroot": this recipe is not in an index,
which has no libs". Found by xim-pkgindex's registration test with xlings
2026.12.5.1.

LoaderContext gains pkgindex_dir, the host's answer, and the check uses it
the way the executor does: the recipe's own index first. The specification
states it (§6.2); 0.0.69.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
…t's context

build_index_impl's branch without boundaries read each recipe with an
empty context and skipped what failed to load, so a host building its
local overlay in process (xlings with no policy, the common home) left out
a recipe that imports the host's index libs at its top level, silently.
build_index(repo, ns, context, output) is that builder with the host's
context (platform, architecture, pkgindex_dir); the three-argument one is
unchanged (an empty context). Test: an index without libs built with the
host's context has the recipe, and without it does not.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak
Sunrisepeak merged commit dcf144d into openxlings:main Dec 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants