Disable default-features on stellar-xdr workspace dependency #559
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Disable default-features on stellar-xdr workspace dependency..
Why
When I recently moved the dependencies to the workspace, I didn't realize that the workspace dependencies were additive in regards to features. This meant that default features, which includes the
std
feature in the stellar-xdr, are enabled unless the workspace dependency explicitly turns it off. The default features are enabled even for crates that explicitly turn them off, because features are always additive in a workspace.I've introduced a test a crate that imports the common crate, and adds a panic handler, which is a hack to detect if std was imported or not, as a way to prevent this from accidentally happening again.