Skip to content

Commit 82b18da

Browse files
committed
fix: set defaulted_keys in lockfile parsing for both formats (GREEN)
Fix both lockfile parsing implementations to properly set defaulted_keys with the "_initialized" sentinel required by write_repodata_record(). Changes: - env_lockfile_conda.cpp: Copy defaulted_keys from from_url() result - env_lockfile_mambajs.cpp: Set defaulted_keys = {"_initialized"} (lockfile data is authoritative, so no fields are "defaulted") This fix is required after the env_lockfile.cpp refactoring that split the implementation into separate files for conda and mambajs formats. Test Status: ALL TESTS PASS (GREEN phase) - lockfile_packages_have_initialized_in_defaulted_keys-conda: PASSED - lockfile_packages_have_initialized_in_defaulted_keys-mambajs: PASSED - All existing tests: PASSED Tests fixed: - test_lockfile[condalock-True] (Python integration test that was failing in CI) Related: #4095
1 parent 0f204a6 commit 82b18da

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libmamba/src/core/env_lockfile_conda.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ namespace mamba
7373
package.info.channel = maybe_parsed_info->channel;
7474
package.info.build_string = maybe_parsed_info->build_string;
7575
package.info.platform = maybe_parsed_info->platform;
76+
// Copy defaulted_keys for fail-hard verification in write_repodata_record().
77+
// The "_initialized" sentinel proves this PackageInfo was properly constructed.
78+
// See issue #4095.
79+
package.info.defaulted_keys = maybe_parsed_info->defaulted_keys;
7680
}
7781

7882
for (const auto& dependency : package_node["dependencies"])

libmamba/src/core/env_lockfile_mambajs.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ namespace mamba
9696
// chosen channel mirror url
9797
}
9898

99+
// Set _initialized sentinel for fail-hard verification in write_repodata_record().
100+
// Lockfile data is authoritative, so no fields are "defaulted" - only the sentinel.
101+
// See issue #4095.
102+
package.info.defaulted_keys = { "_initialized" };
103+
99104
return package;
100105
}
101106

0 commit comments

Comments
 (0)