Skip to content

fix(http): build natively again with the cookie jar - #242

Merged
paymog merged 1 commit into
mainfrom
issue-241-http-native
Sep 28, 2026
Merged

paymog merged 1 commit into
mainfrom
issue-241-http-native

Conversation

@paymog

@paymog paymog commented Sep 28, 2026

Copy link
Copy Markdown
Owner

A program that imports bend-kit-http builds natively again. With 0.22.0.0, bend app.bend -o app failed with Error: an arity over 247 even for a program that only calls Http.get; 0.21.1.0 built.

Cause

Time.Instant holds an Int.I64, a Word(64n), which the C backend flattens to 64 one-word cells. The cookie parser's Cav record held two Maybe<Time.Instant> fields, and cookie.av.put kept a Cav, now, and a new time live together, past the 247-word segment limit (bendlang/bend#1069). fetch reaches the cookie parser through the redirect loop, so every client program hit it.

Cav now keeps Expires as the date sent and Max-Age as capped seconds. cookie.make turns them into times from now. The jar behaves as before: Max-Age still wins over Expires, and both are still capped at 400 days.

The changed helpers (Cav, cookie.max_age, cookie.av.put, cookie.av, cookie.avs, cookie.make) are internal, but every def is public, so the version goes to 0.23.0.0.

Validation

  • A program that calls only Http.get builds natively against this http.bend; against 0.22.0.0 it fails with the arity error.
  • bend PROOF.bend: all terms check, including the cookie laws.
  • bend check.bend: every line ok, including the live cookie-jar checks.
  • Checked with Bend 2.0.31, the CI pin.

Fixes #241

A program that imported http 0.22.0.0 failed bend -o with an arity over 247
(bendlang/bend#1069). Cav held two Maybe<Time.Instant> fields, and each
Instant flattens to 65 words, so cookie.av.put held too many live words.
Cav now keeps Expires as the date sent and Max-Age as seconds; cookie.make
turns them into times from now.

Fixes #241
@paymog
paymog merged commit 7bd95b0 into main Sep 28, 2026
3 checks passed
@paymog
paymog deleted the issue-241-http-native branch September 28, 2026 13:05
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.

http 0.22.0.0 does not build natively: an arity over 247

1 participant