Skip to content

Write cookie attributes one value per call in stringify - #1350

Merged
quinnj merged 2 commits into
masterfrom
trim-cookie-stringify
Aug 16, 2026
Merged

Write cookie attributes one value per call in stringify#1350
quinnj merged 2 commits into
masterfrom
trim-cookie-stringify

Conversation

@quinnj

@quinnj quinnj commented Aug 15, 2026

Copy link
Copy Markdown
Member

One small change so an HTTP.jl server compiled with juliac --trim=safe verifies cleanly, found while trimming a Servo application on Julia nightly (JuliaCon 2026 workshop prep).

Base's varargs write(io, x1, xs...) iterates a heterogeneous tuple and dispatches each element dynamically, which the trim verifier cannot resolve (a 5-line program writing write(io, "a", '=', "b") fails verification on nightly). Cookie stringify used it in four places; splitting them into single-value writes produces byte-identical output and compiles to direct calls.

The companion change on the server request path (rebuilds through the positional constructor) already landed in #1349 — an earlier draft of this PR duplicated it and has been trimmed down. Together with #1349, HTTP contributes zero verify errors to that app's --trim=safe build.

Tests: http_cookie_tests.jl passes locally (rerun on this rebased branch), and the core/h1 wire suites passed with the same cookie change before the rebase.

🤖 Generated with Claude Code

Review follow-up

  • Add exact request and response cookie rendering coverage.
  • Add a trim workload that builds and runs the public cookie stringify path.

Validation: focused cookie tests pass. The new trim executable builds and runs with zero verifier errors.

Co-authored by Codex

Base's varargs write(io, x1, xs...) iterates a heterogeneous tuple and
dispatches each element dynamically, which juliac --trim=safe cannot
statically resolve. Cookie stringify used it in four places; writing one
value per call is byte-identical in output and compiles to direct calls.

The server-side Request rebuild half of this work already landed via
#1349. Found trimming a Servo app on Julia nightly (JuliaCon 2026
workshop); together with #1349 this clears the last HTTP-owned verify
errors there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quinnj
quinnj force-pushed the trim-cookie-stringify branch from 2fe6b51 to b314a06 Compare August 15, 2026 13:37
@quinnj quinnj changed the title Avoid dynamic dispatch in cookie stringify and server request rebuilds Write cookie attributes one value per call in stringify Aug 15, 2026
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.55%. Comparing base (444b92b) to head (70c46a2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1350      +/-   ##
==========================================
+ Coverage   88.53%   88.55%   +0.02%     
==========================================
  Files          31       31              
  Lines       11961    11974      +13     
==========================================
+ Hits        10590    10604      +14     
+ Misses       1371     1370       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@quinnj
quinnj merged commit fe81363 into master Aug 16, 2026
8 checks passed
@quinnj
quinnj deleted the trim-cookie-stringify branch August 16, 2026 09:25
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