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.
Lots of issues here:
Engine enum is duplicated for no reason
The Zig build system supports passing an enum type to options natively, with much nicer output:
and
buildOptions()
is fallible for no reason after using the right options APIEverything after
@hasDecl(build_opts, "engine")
is dead code, this is always trueEven if the intention was to check value for its null state (also defaulted here,
build_opts.engine orelse "v8"
) the build system already adds v8 to the build graph due toOptions.engine
being non-nullable with a fallback valueIf all of this worked correctly and you could specify the engine via a root declaration, it could not return a value in its
engine()
function due toEngineType
being an exhaustive enum hardcoded in the libraryOverall that last part is a nice idea but obviously it's not been tested. It can be added back with all the above in mind at a later point. (e.g. explicit
-Dengine=custom
to not pull in v8 deps, non-exhaustive enum for custom values, etc)