@@ -59,6 +59,18 @@ The imgui validation exposed two separate mcpp-side problems.
5959 ` imgui.backend.* ` modules. The lock file also obscured the real dependency
6060 source.
6161
62+ 4 . Bare dependency selectors could not fall back to independent root packages.
63+
64+ ` resolve_dependency_selector("imgui") ` produced only ` mcpplibs/imgui ` .
65+ That missed the intended rule that bare names first try the omitted
66+ ` mcpplibs ` root and then fall back to an independent root package.
67+
68+ The failure had a second layer: the default-namespace strict lookup uses
69+ ` imgui.lua ` as its canonical filename, which is the same descriptor filename
70+ used by an independent root ` imgui ` package. Without checking the xpkg
71+ descriptor's declared ` package.name ` / ` package.namespace ` , the first
72+ candidate could consume the independent package as ` mcpplibs.imgui ` .
73+
6274## Changes In This Branch
6375
6476- ` src/build/flags.cppm `
@@ -94,6 +106,28 @@ The imgui validation exposed two separate mcpp-side problems.
94106 - Added a branch dependency regression that verifies ` mcpp update <dep> `
95107 refreshes a moved branch and that lock source metadata is marked as git.
96108
109+ - ` src/pm/dependency_selector.cppm `
110+ - Bare selectors now produce ordered candidates:
111+ ` mcpplibs/<name> ` , then independent root ` <name> ` .
112+
113+ - ` src/manifest.cppm `
114+ - Added ` extract_xpkg_name() ` alongside ` extract_xpkg_namespace() ` so resolver
115+ code can validate package identity from the xpkg descriptor.
116+
117+ - ` src/cli.cppm `
118+ - Candidate selection now validates that a matched xpkg descriptor belongs to
119+ the candidate coordinate before selecting it.
120+ - Independent root packages keep an empty package namespace in ` mcpp.lock `
121+ instead of being rewritten as ` mcpplibs ` .
122+
123+ - ` tests/unit/test_pm_compat.cpp `
124+ - Added a bare selector regression for ` imgui -> mcpplibs/imgui, then imgui ` .
125+
126+ - ` tests/e2e/63_bare_dependency_peer_root_priority.sh `
127+ - Added a no-network regression that provides only an independent root
128+ ` imgui ` package in a temporary default index and verifies ` imgui = "1.0.0" `
129+ builds/runs without locking the package as ` mcpplibs ` .
130+
97131## Evidence So Far
98132
99133- Red test for the include bug:
@@ -116,7 +150,7 @@ The imgui validation exposed two separate mcpp-side problems.
116150
117151- Green e2e after rebuilding the mcpp CLI with the resolver fix:
118152 - Command:
119- ` MCPP=target/x86_64-linux-gnu/85da010ca4e7d6e2/ bin/mcpp bash tests/e2e/60_stale_xpkg_cache_reinstall.sh `
153+ ` MCPP=<mcpp- bin> bash tests/e2e/60_stale_xpkg_cache_reinstall.sh `
120154 - Result: ` OK `
121155
122156- Boundary regression caught and fixed:
@@ -143,7 +177,7 @@ The imgui validation exposed two separate mcpp-side problems.
143177
144178- Green e2e after rebuilding the mcpp CLI with the git dependency fix:
145179 - Command:
146- ` MCPP=target/x86_64-linux-gnu/ea28c45f9dcd4fed/ bin/mcpp bash tests/e2e/24_git_dependency.sh `
180+ ` MCPP=<mcpp- bin> bash tests/e2e/24_git_dependency.sh `
147181 - Result: ` OK `
148182
149183- Focused regression after the final git dependency change:
@@ -152,9 +186,31 @@ The imgui validation exposed two separate mcpp-side problems.
152186 - ` tests/e2e/24_git_dependency.sh ` : ` OK `
153187 - ` tests/e2e/62_dotted_dependency_selector_priority.sh ` : ` OK `
154188
189+ - Red unit test for bare selector fallback before the fix:
190+ - ` DependencySelector.BareSelectorBuildsOmittedMcpplibsThenPeerRootCandidates `
191+ failed because ` selector.candidates.size() ` was ` 1 ` , expected ` 2 ` .
192+
193+ - Green focused verification after the bare selector and candidate identity fix:
194+ - ` mcpp test -- --gtest_filter=DependencySelector.BareSelectorBuildsOmittedMcpplibsThenPeerRootCandidates ` :
195+ ` 18 passed; 0 failed `
196+ - ` tests/e2e/62_dotted_dependency_selector_priority.sh ` : ` OK `
197+ - ` tests/e2e/63_bare_dependency_peer_root_priority.sh ` : ` OK `
198+
199+ - Full local verification after the final edits:
200+ - ` mcpp test ` : ` 18 passed; 0 failed `
201+ - ` tests/e2e/run_all.sh ` : ` 67 passed, 0 failed, 0 skipped `
202+ - ` tests/e2e/62_dotted_dependency_selector_priority.sh ` : ` OK `
203+ - ` tests/e2e/63_bare_dependency_peer_root_priority.sh ` : ` OK `
204+
205+ - External mcpp-index imgui smoke with the rebuilt mcpp CLI:
206+ - Command shape: ` MCPP=<mcpp-bin> bash tests/smoke_imgui_module.sh `
207+ - Result: ` Dear ImGui 1.92.8 module package ok `
208+ - Observed install target: ` mcpplibs:imgui@0.0.1 ` , meaning default index
209+ package ` imgui ` ; not ` mcpplibs.imgui ` .
210+
155211- Fresh external ` imgui-private ` git consumer with rebuilt mcpp CLI:
156212 - Command:
157- ` MCPP_HOME=/ tmp/imgui-private-fixed-mcpp- home target/x86_64-linux-gnu/ea28c45f9dcd4fed/ bin/mcpp run `
213+ ` MCPP_HOME=< tmp- home> <mcpp- bin> run `
158214 - Result:
159215 ` external git consumer imported Dear ImGui 1.92.8 `
160216 - Lock source:
@@ -181,3 +237,6 @@ The imgui validation exposed two separate mcpp-side problems.
181237 corrected.
182238- The mcpp fixes should be submitted as a separate PR from imgui package/index
183239 updates.
240+ - Public ` imgui ` package identity is independent root ` imgui ` , not
241+ ` mcpplibs.imgui ` ; mcpp's omitted-` mcpplibs ` priority must not rewrite that
242+ identity after the fallback candidate is selected.
0 commit comments