Repository navigation
net/http: fix the amalgamation for csrf and the file transport - #718
Merged
Merged
Conversation
burrow-gen puts a source file in the package of the first burrow header it includes. http_csrf.c and http_filetransport.c started with core.h and chan.h, which have no burrow:package line, so the amalgamation and the docs examples job failed. Include net/http.h first, and drop http_csrf.c's own S macro, which clashes with core.h's.
23 of 27 tasks
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.
The problem
The "docs examples (macos-latest)" job on #716 failed before it built anything. The log shows:
burrow-gen puts each source file in the package of the first burrow header it includes.
http_csrf.c(#711) started withcore.h, andhttp_filetransport.c(#713) started withchan.h. Neither header has a package line. Both PRs were merged before their CI finished, so main has had this since then.The fix
src/net/http_csrf.cburrow/net/http.hfirst, in a block of its own so clang-format keeps it there. It also drops its own#define S, sincecore.hdefinesSunderBURROW_SHORTand the amalgamation would undefine it after the file. It usesBURROW_Snow.src/net/http_filetransport.cburrow/net/http.hfirst.Checks
I ran
tools/burrow-gen amalgamatelocally on this branch. Before the fix it stopped on each problem in turn:http_csrf.c's package, thenhttp_filetransport.c's, then theSmacro. With the fix it printsburrow-gen: 355 headers and 595 sources to .... Both files pass the syntax check with-Wall -Wextraand clang-format. Nothing was built or run on the servers, because none of them has 5G free.