Repository navigation
Keep debug log messages trimmable - #58
Open
quinnj-bot[bot] wants to merge 2 commits into
Open
quinnj-bot[bot] wants to merge 2 commits into
quinnj-bot[bot] wants to merge 2 commits into
Conversation
Three `debug && @info` messages interpolated values that cannot be printed without dynamic dispatch: the message parts tuple and the md5 salt bytes. A JuliaC build that compiles log records into a trimmed program (instead of compiling them out) then fails `--trim=safe` on those messages. Pass the parts as a log keyword, and print the salt with `bytes2hex`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CI jobs that use md5 authentication do not upload coverage, so the md5 branch of `authRequest` never counted. Drive it through a `Base.BufferStream` standing in for the socket, and check the hex salt in the debug record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Three debug messages could not be built in a trimmed program.
debug && @info "sending message: $code, $parts"(in_write_message_to_bufferand_writemessage_parts) interpolates the message's parts tuple, anddebug && @info "md5 salt: $salt"interpolates aVector{UInt8}. Printing either one goes throughshowmethods that dispatch at run time.JuliaC currently compiles every log call out of a trimmed program, so this never showed. A JuliaC change that keeps log records in trimmed programs (so a trimmed server can report its warnings and errors) makes
--trim=safecheck these messages, and they fail. LeagueEasy's server hit this.Change
sending messagerecords passpartsas a log keyword. Under the JIT, the logger still shows the parts in full. A trimmed program shows the type.bytes2hex.Testing
r"sending message", is unchanged.authRequestthrough md5 authentication over aBase.BufferStreamand checks formd5 salt: 01020304. The md5 CI jobs don't upload coverage, so this is what covers that branch._write_message_to_buffer(IOBuffer(), true, ('Q', "SELECT 1"))logssending message: Qwith apartskeyword (@test_logs).--trim=safewith this commit on 2.8.0 (jq/trimmable-debug-logs-2.8.0) and the JuliaC change. The first build with only the JuliaC change failed on these three messages (18 verifier errors). With this commit it passes with 0.[generated via AI]