Purge explicit packs on solution load#2503
Conversation
Test Results 7 files - 51 53 suites - 123 6m 8s ⏱️ - 17m 42s Results for commit ca21e7c. ± Comparison against base commit 2054682. This pull request removes 735 tests.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR targets issue #330 by ensuring solution-specific packs (packs loaded from explicit paths) don’t “stick” across solution loads, which could cause the IDE/tooling to keep referencing stale local pack directories when switching solutions.
Changes:
- Purge packs loaded from explicit paths during RPC
LoadSolution, and clear the global model more aggressively when the registry changes. - Simplify pack insertion / duplicate reporting logic in the RTE model/kernel.
- Extend/refactor RPC tests and test environment data to validate pack-path switching across solutions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/projmgr/test/src/ProjMgrTestEnv.cpp | Adds an additional copied solution-specific pack folder for new/updated tests. |
| tools/projmgr/test/src/ProjMgrRpcTests.cpp | Refactors RPC request building and adds coverage for switching solutions with the “same” pack from different explicit directories. |
| tools/projmgr/src/ProjMgrWorker.cpp | Forces installed-pack discovery/loading in RPC mode when loading relevant packs. |
| tools/projmgr/src/ProjMgrRpcServer.cpp | Purges packs at solution load and clears global state when purging occurs. |
| libs/rtemodel/src/RtePackage.cpp | Extends pack-registry purge to also delete explicit-path packs. |
| libs/rtemodel/src/RteModel.cpp | Simplifies duplicate-pack handling in InsertPack. |
| libs/rtemodel/src/RteKernel.cpp | Removes redundant explicit-pack override filtering during LoadAndInsertPacks. |
Comments suppressed due to low confidence (1)
tools/projmgr/src/ProjMgrWorker.cpp:555
- In RPC mode this now calls
GetEffectivePdscFiles(pdscFiles, ...)on a non-emptypdscFileslist, which appends the full installed-pack list. That can re-add entries already present from the solution’s pack requirements, andRteKernel::LoadAndInsertPacks()only doespdscFiles.unique()(adjacent-only), so duplicates may survive and cause redundantLoadPack()/InsertPack()work.
To keep ordering (explicit packs first) and avoid duplicates reliably, consider collecting installed PDSCs into a temporary list and then merging into pdscFiles via CollectionUtils::PushBackUniquely.
if (m_rpcMode || pdscFiles.empty() || (m_loadPacksPolicy == LoadPacksPolicy::ALL) || (m_loadPacksPolicy == LoadPacksPolicy::LATEST)) {
const bool latest = (m_loadPacksPolicy == LoadPacksPolicy::LATEST) || (m_loadPacksPolicy == LoadPacksPolicy::DEFAULT);
if (!m_kernel->GetEffectivePdscFiles(pdscFiles, latest)) {
ProjMgrLogger::Get().Error("parsing installed packs failed");
return false;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2503 +/- ##
==========================================
+ Coverage 65.24% 65.26% +0.01%
==========================================
Files 147 147
Lines 26677 26692 +15
Branches 16166 16181 +15
==========================================
+ Hits 17406 17421 +15
Misses 7071 7071
Partials 2200 2200
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Fixes
Changes
Checklist