Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
maint: Log information about build for improper fields
Such as:

```
warning  libmamba Failed to parse field 'noarch' (msgpack type=1) in shard package record for 'tensorboard-2.1.1-py38_0.tar.bz2': Expected STR or BIN type for string conversion. This field will be ignored.
```

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
  • Loading branch information
jjerphan committed Apr 2, 2026
commit 368ec705f12ccf51de09b7cb781416de5fb88904
16 changes: 12 additions & 4 deletions libmamba/src/core/shards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ namespace mamba
* This handles the case where sha256 and md5 can be either strings or bytes
* (as per Python TypedDict: NotRequired[str | bytes]).
*/
auto parse_shard_package_record(const msgpack_object& obj) -> specs::RepoDataPackage
auto parse_shard_package_record(const msgpack_object& obj, std::string_view package_filename)
-> specs::RepoDataPackage
{
specs::RepoDataPackage record;

Expand Down Expand Up @@ -365,8 +366,12 @@ namespace mamba
catch (const std::exception& e)
{
LOG_WARNING << "Failed to parse field '" << key
<< "' (type=" << static_cast<int>(val_obj.type)
<< ") in shard package record: " << e.what();
<< "' (msgpack type=" << static_cast<int>(val_obj.type)
<< ") in shard package record"
<< (package_filename.empty()
? ""
: (" for '" + std::string(package_filename) + "'"))
<< ": " << e.what() << ". This field will be ignored.";
// Continue parsing other fields
}
}
Expand Down Expand Up @@ -1026,7 +1031,10 @@ namespace mamba
continue;
}
std::string pkg_filename = msgpack_object_to_string(key);
specs::RepoDataPackage parsed_record = parse_shard_package_record(val);
specs::RepoDataPackage parsed_record = parse_shard_package_record(
val,
pkg_filename
);
target_map[pkg_filename] = std::move(parsed_record);
}
catch (const std::exception& e)
Expand Down