Skip to content

test: serialize and deserialize RPC error messages - #8411

Merged
rgrinberg merged 3 commits into
ocaml:mainfrom
Alizter:ps/branch/test__serialize_and_reserialize_rpc_error_messages
Aug 26, 2023
Merged

rgrinberg merged 3 commits into
ocaml:mainfrom
Alizter:ps/branch/test__serialize_and_reserialize_rpc_error_messages

Conversation

@Alizter

@Alizter Alizter commented Aug 17, 2023

Copy link
Copy Markdown
Collaborator

We demonstrate a bug with how error messages are serialized. Currently there are two "Error:" prefixes after serializing and deserializing. This is because the prefix hasn't been stripped in the initial serialization. We should strip the prefix since the severity information is recorded elsewhere in the diagnostic data.

@Alizter
Alizter requested a review from rgrinberg August 17, 2023 01:02
@Alizter

Alizter commented Aug 17, 2023 •

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I think the correct fix for this would be to make user_message.ml remember prefixes in the type. That way we can avoid including them when serialising. Otherwise, I don't see an easy way of removing Error: short of regexing.

@Alizter Alizter changed the title test: serialize and reserialize RPC error messages test: serialize and deserialize RPC error messages Aug 17, 2023
Comment thread src/dune_engine/build_system.mli Resolved
Comment thread src/dune_rpc_impl/dune_rpc_impl.ml Resolved
@rgrinberg
rgrinberg requested a review from pmwhite August 17, 2023 10:39
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from 63281ae to 8f9d38f Compare August 17, 2023 14:18
@Alizter Alizter mentioned this pull request Aug 18, 2023
9 of 12 tasks
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from 8f9d38f to 2b46350 Compare August 19, 2023 00:29
@Alizter
Alizter requested a review from rgrinberg August 19, 2023 00:30
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch 2 times, most recently from 692876c to bac10c3 Compare August 23, 2023 11:37
@Alizter

Alizter commented Aug 23, 2023

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I've pushed another test which shows how location printing is kind of funny. I need some help scrubbing the output however.

@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from bac10c3 to b55b2e5 Compare August 23, 2023 14:41
Comment thread test/expect-tests/dune_rpc/dune Resolved
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from b55b2e5 to fd58a5d Compare August 23, 2023 21:00
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from fd58a5d to 4c93ceb Compare August 24, 2023 12:35
Comment thread otherlibs/stdune/src/stdune.ml Resolved
@Alizter

Alizter commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I've also included dyn serialisation so we can more finely compare the Pp structure that has been serialised.

Comment thread test/expect-tests/dune_rpc/dune Resolved
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from 4c93ceb to 77ce937 Compare August 24, 2023 17:47
@Alizter

Alizter commented Aug 24, 2023

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I've moved the tests now and added yet another example of an error message that changes. All these examples will be fixed by my upcoming PR.

@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch 3 times, most recently from a74d86f to 8c09cc7 Compare August 24, 2023 18:35
Comment thread src/dune_engine/build_system.mli Resolved
We demonstrate a bug with how error messages are serialized. Currently
there are two "Error:" prefixes after serializing and deserializing.
This is because the prefix hasn't been stripped in the initial
serialization. We should strip the prefix since the severity information
is recorded elsewhere in the diagnostic data.

Signed-off-by: Ali Caglayan <[email protected]>
@Alizter
Alizter force-pushed the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch from 8c09cc7 to 3c924a3 Compare August 24, 2023 20:24
@rgrinberg
rgrinberg merged commit a4d6daa into ocaml:main Aug 26, 2023
@Alizter
Alizter deleted the ps/branch/test__serialize_and_reserialize_rpc_error_messages branch August 26, 2023 16:10
@Alizter Alizter mentioned this pull request Aug 26, 2023
2 tasks done
@Alizter Alizter added this to the 3.11.0 milestone Jul 9, 2026
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.

2 participants