This repository was archived by the owner on Mar 24, 2022. It is now read-only.
move lucet-validate into lucetc crate#575
Merged
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
lucet-validatewas creating more trouble as a separate crate than it was worth. And, to fix some design problems, I ended up rewriting it piece-by-piece.lucet-validatecrate is gone. What is left of it and its tests are merged intolucetc. This eliminates a dev-dependencies loop that caused us problems withcargo publish.lucetc::validatenow uses a builder interface for construction, which is more flexible than before. It supports both wasi commands and reactors, though we don't do anything with reactors at the moment (lucet-runtime doesnt know what to do with them yet).Validator, once constructed, gets itsregister_importandregister_exportmethods called by theModuleInfostruct'sModuleEnvironmentimpl. This means that ascranelift_wasm::translate_moduleparses the wasm module, we are validating each function import and export. Previously,lucet-validatehad aModuleTypestruct that was constructed by a totally separate parsing pass on the wasm module; this was never a great design, it was just the quick and dirty version.Validatorcollects all of its errors internally. Aftertranslate_moduleis complete, we get the whole set of validation errors out ofValidatorand, if there are any, report them all and stop compilation.The PR is arranged as a series of commits that transform the
lucet-validatecode into the final form step by step, with tests passing at each commit, if you want to read it that way.This PR closes #438: now all validation errors are reported, with positive and negative tests.