fix(caps): declare missing capabilities surfaced while debugging the HTTP panic - #11
Merged
Merged
Conversation
…ErrorOverlay BastionServer imports Bastion, which requires Cap(IO.FileRead) and Cap(IO.FileWrite); Bastion.ErrorOverlay imports Bastion.Dev, which requires Cap(IO.Mut). Neither declared the capability, so march main's capability-ceiling check now catches this as a hard error, matching the same class of gap fixed in 0d23a77 and 96c0ec8.
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.
Summary
BastionServerimportsBastion, which requiresCap(IO.FileRead)andCap(IO.FileWrite); neither was declared, so march main's capability-ceiling check hard-errors on any build that pulls this module in.Bastion.ErrorOverlayimportsBastion.Dev, which requiresCap(IO.Mut); same gap.IO.Mutfix inBastion.Dev(0d23a77, 96c0ec8) — the capability-ceiling check is being rolled out module by module and these two hadn't been hit yet.Context
Found while root-causing the reported "any HTTP request panics with
non-exhaustive pattern match" bug. That panic's actual root cause was not in bastion — it turned out to be a stale March compiler toolchain on the debugging machine whose bundledstdlib/websocket.marchstill had a duplicatetype Conn = Conn(...)declaration that a March compiler fix (upstream commit6dc58ea1) had already removed. Re-syncing that toolchain resolved the panic; there is no bastion source change for it. These two capability declarations are a genuine, separate fix thatforge check/forge buildsurfaced along the way.Also found, but not fixed in this PR (separate root cause, tracked separately): a compiled Bastion HTTP server handles the first request fine but the process dies silently starting on the second request — reproduces with bare stdlib
HttpServer.plug/listen, both threaded and sequential, so not a concurrency race. Likely a reference-counting gap where a closure's captured free variable isn't protected the same way the outer closure reference is.Test plan
forge check— 80 files, 0 errorsforge buildon a scaffolded app (forge bastion.new) depending on this branch — compiles cleancurlagainst the running server returns a real200 OKon the first request