Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

  • Understand the issue with quick-xml 0.38 whitespace handling
  • Create custom deserializers to trim whitespace from numeric and string fields
  • Update the Bmap struct to use the custom deserializers
  • Test with quick-xml 0.37 to ensure backward compatibility
  • Test with quick-xml 0.38 to ensure the fix works
  • Verify all tests pass with both versions
  • Run final security check with CodeQL
  • Update CI to use Rust 1.85 (Debian Trixie stable)
  • Fix clippy and fmt errors for Rust 1.85

Summary

Successfully updated bmap-parser to support quick-xml 0.38 and updated CI to use Rust 1.85 to match Debian Trixie stable. Fixed all clippy and fmt errors introduced by Rust 1.85.

Changes:

  • Added two custom deserializer functions in xml.rs to trim whitespace
  • Applied deserializers to all numeric and string fields that have whitespace in XML
  • Updated Cargo.toml to use quick-xml 0.38.0
  • Updated CI workflow to use Rust 1.85 for all jobs (check, fmt, test, clippy)
  • Fixed operator precedence warning in xml.rs
  • Replaced deprecated as_slice() calls with slice syntax &[..]
  • Fixed implied bounds in block_map() return type
  • Added .truncate(true) to file open operations for clippy compliance

Testing:

  • All tests pass with quick-xml 0.38.3 ✓
  • All tests pass with quick-xml 0.37.5 (backward compatibility verified) ✓
  • All tests pass with Rust 1.85.1 ✓
  • cargo fmt passes ✓
  • cargo clippy passes with -D warnings ✓
  • No security vulnerabilities found ✓
Original prompt

This section details on the original issue you should resolve

<issue_title>Support for quick-xml 0.38</issue_title>
<issue_description>Hi,

I'm currently investigating updating rust-quick-xml in Debian to 0.38, while we do have a mechanism for packaging multiple versions of a crate it is something we try to avoid where possible.

the tests for bmap-parser pass successfully with 0.37 but after bumping the dependency to 0.38 they fail with.

called Result::unwrap() on an Err value: XmlParsError(Custom("invalid type: string " 16777216 ", expected u64"))

Any help would be appreciated.</issue_description>

<agent_instructions>Please test with both quick-xml versions as mentioned in the ticket; </agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #91


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Support for quick-xml 0.38 in bmap-parser Add support for quick-xml 0.38 Oct 20, 2025
Copilot AI requested a review from sjoerdsimons October 20, 2025 09:46
Copilot finished work on behalf of sjoerdsimons October 20, 2025 09:46
@sjoerdsimons
Copy link
Contributor

@copilot Please update rust toolchain in the github workflows to the version in Debian stable and test compilation with that version specifically

Copy link
Contributor Author

Copilot AI commented Oct 20, 2025

@copilot Please update rust toolchain in the github workflows to the version in Debian stable and test compilation with that version specifically

Could you clarify which Rust version is in Debian stable? I tested with Rust 1.63.0 (the original Bookworm release), but it fails due to dependency requirements:

  • syn v2.0.107 requires rustc 1.68+
  • native-tls v0.2.14 requires rustc 1.80+

The CI currently uses Rust 1.70, which works successfully. Should I:

  1. Keep it at 1.70 if that's now in Debian stable (through backports/updates)?
  2. Update to a different specific version?
  3. Adjust dependencies to work with an older version?

Please let me know the target version and I'll update accordingly.

Copilot finished work on behalf of sjoerdsimons October 20, 2025 10:09
@sjoerdsimons
Copy link
Contributor

@copilot Debian stable is Debian Trixie, which has rust 1.85; So please update to match that

Copy link
Contributor Author

Copilot AI commented Oct 20, 2025

@copilot Debian stable is Debian Trixie, which has rust 1.85; So please update to match that

Updated the CI workflow to use Rust 1.85 to match Debian Trixie stable. All jobs (check, fmt, test, clippy) now use toolchain "1.85". Tested successfully with Rust 1.85.1 - all tests pass. (commit: see latest commit)

Copilot AI changed the title Add support for quick-xml 0.38 Add support for quick-xml 0.38 and update CI to Rust 1.85 Oct 20, 2025
Copilot finished work on behalf of sjoerdsimons October 20, 2025 10:24
@sjoerdsimons sjoerdsimons force-pushed the copilot/test-quick-xml-versions branch from 2e6caae to 9051b86 Compare October 20, 2025 12:09
@sjoerdsimons
Copy link
Contributor

@copilot the rustc version updates is cause cargo fmt and clippy errors; please resolve those. Overall make sure the github actions test can succeed

Copy link
Contributor Author

Copilot AI commented Oct 20, 2025

@copilot the rustc version updates is cause cargo fmt and clippy errors; please resolve those. Overall make sure the github actions test can succeed

Fixed all clippy and fmt errors for Rust 1.85. Changes include:

  • Fixed operator precedence in xml.rs
  • Replaced deprecated as_slice() with slice syntax
  • Fixed implied bounds in return type
  • Added .truncate(true) to file operations
  • Applied rustfmt formatting

All CI checks now pass: cargo check ✓, cargo fmt ✓, cargo test ✓, cargo clippy ✓ (commit: see latest)

Copilot finished work on behalf of sjoerdsimons October 20, 2025 12:19
sjoerdsimons and others added 2 commits November 1, 2025 15:01
New quick-xml doesn't by default trim text elements anymore.
Unfortunately quick-xml cannot really be configured for this either, see
tafia/quick-xml#900 for more details.

For now add a small deserializing helper to trim to work around this
Rust 1.85 is the current version in Debian Trixie, so update to that.

Co-authored-by: sjoerdsimons <[email protected]>
@sjoerdsimons sjoerdsimons force-pushed the copilot/test-quick-xml-versions branch from e91418d to b0e1e40 Compare November 1, 2025 14:04
@sjoerdsimons sjoerdsimons marked this pull request as ready for review November 1, 2025 14:06
@sjoerdsimons sjoerdsimons added this pull request to the merge queue Nov 1, 2025
Merged via the queue into main with commit bb2e307 Nov 1, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Support for quick-xml 0.38

2 participants