Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with old roscpp using dxr/quick-xml fix #8

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

jobafr
Copy link
Contributor

@jobafr jobafr commented Dec 2, 2024

The previously used version of quick-xml (dependency of dxr) sometimes emitted self-closing XML tags (like <this />), instead of the longer form (<this></this>). which is not supported by some versions of roscpp (causing a C++ exception). While quick-xml has an option called expand_empty_elements, which dxr uses (because apparently handling self-closing tags is a known issue in xmlrpc libraries), that option was not always respected.

Dxr has now released v0.7, which comes with the fixed quick-xml version and some minor API changes.

Actual underlying fix:
https://github.com/tafia/quick-xml/blame/a5ad85e0020b62182a377338b887e8796ffb0acf/src/se/element.rs#L484

Issue thread on dxr's repo:
ironthree/dxr#23

@@ -1011,7 +1011,7 @@ impl Handler for GetParamHandler {
let key_path = key_full.strip_prefix('/').unwrap_or(&key_full).split('/');

Ok(match params.get(key_path) {
Some(value) => (1, "".to_owned(), value.to_owned()),
Some(value) => (1, format!("Parameter [{}]", &key_full), value.to_owned()),
Copy link
Owner

@PatWie PatWie Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we for consistency keep the formatting string the same as below or adjust the line below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, fixed.

@jobafr jobafr requested a review from PatWie December 3, 2024 15:47
@PatWie PatWie merged commit e2eef4a into PatWie:main Dec 3, 2024
2 checks passed
@decathorpe
Copy link

Just out of curiosity - what did you think about the simplified client API (i.e. removal of the Call wrapper)?

@PatWie
Copy link
Owner

PatWie commented Dec 12, 2024

How would that look like?

@decathorpe
Copy link

I'm referring to changes like this one:

https://github.com/PatWie/ros-core-rs/pull/8/files#diff-ad7fb910631f7e1f3bd8282006160095c066585e6a8d86c4be048aa278db132bL87-R86

(i.e. Client::call now having the arguments that Call::new used to have, instead of Client::call taking a Call argument)

@PatWie
Copy link
Owner

PatWie commented Dec 15, 2024

Oh, that makes a lot of sense. I wonder why I did separate it in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants