Skip to content

Keep debug log messages trimmable - #58

Open
quinnj-bot[bot] wants to merge 2 commits into
mainfrom
jq/trimmable-debug-logs
Open

quinnj-bot[bot] wants to merge 2 commits into
mainfrom
jq/trimmable-debug-logs

Conversation

@quinnj-bot

@quinnj-bot quinnj-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Three debug messages could not be built in a trimmed program. debug && @info "sending message: $code, $parts" (in _write_message_to_buffer and _writemessage_parts) interpolates the message's parts tuple, and debug && @info "md5 salt: $salt" interpolates a Vector{UInt8}. Printing either one goes through show methods 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=safe check these messages, and they fail. LeagueEasy's server hit this.

Change

  • The two sending message records pass parts as a log keyword. Under the JIT, the logger still shows the parts in full. A trimmed program shows the type.
  • The md5 salt prints with bytes2hex.

Testing

  • The existing debug test, which matches r"sending message", is unchanged.
  • A new test drives authRequest through md5 authentication over a Base.BufferStream and checks for md5 salt: 01020304. The md5 CI jobs don't upload coverage, so this is what covers that branch.
  • Under the JIT, _write_message_to_buffer(IOBuffer(), true, ('Q', "SELECT 1")) logs sending message: Q with a parts keyword (@test_logs).
  • LeagueEasy's trimmed server passes --trim=safe with 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]

quinnj and others added 2 commits November 24, 2026 17:27
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

No deployments
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.

1 participant