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.
I'm bored at an airport, so here's an unfinished snapshot of a system to build ESP (and dependent libraries) with Bazel. It's mostly intended for comments and a way to start unpicking the source code rather than a serious proposal to include it (although as a build system Bazel is awesome, and way more suited for correct, fast, complex builds than make). It works, but it's full of warnings. Do this to build:
Things for comment:
I would be very much inclined to just drop all the Tools/include/compat stuff --- systems these days are much more standardised than they were back then, and it's just complex and problematic. I spent a while trying to, for example, unpick compat/assert.h so that I wouldn't get an implicit definition warning on
assert
and failed.There are 64-bit violations everywhere --- casting pointers to ints and back again. I've changed some of them to intptr_t, but I'm sure there's some I've fixed. I'm particularly suspicious of the Tools/utils/malloc.c. Can this just be replaced with the system malloc? They used to be terrible, and back in the day the place I worked would routinely replace the system malloc with a custom, much faster one, but not any more.
There are a lot of generated files which are checked in; parse.[ch] are built with yacc from parse.y. I've removed parse.[ch] and invoke as part of the build --- there should only be a single source of truth for any source file.
ESP uses tables generated by gperf a lot, and the source gperf files are missing, and the generated source uses obsolete inline semantics, which involved hacking to work around. Ideally we need new gperf files and then the build system generates the tables on the fly. (Recreating the gperf files shouldn't be hard.)
Warnings! Everywhere! I fixed a bunch, but there's way more to go.
I fixed a genuine bug! The scanner code to detect the start of strings is wrong --- it does
c=='"' || c=='\'' && !in_string
, to try and detect a quotation mark when it's not in a string, except&&
has a higher priority than||
. I actually think I remember finding this bug in GOC way back in the day.The source really ought to be run through clang-format... is there a standard coding style?