-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# What's wrong For Pavex to work as expected, the version of the CLI used when compiling a project with `cargo px [...]` must match the version of the `pavex` library crate used in the project. Currently, there's no mechanism to ensure this is the case. As a result, you'll get version mismatches, resulting in confusing errors (see @m1guelpf in #131). The problem is even worse if you have multiple Pavex projects, each using a different library version: you'd have to juggle multiple CLI versions on your own since they can't all be in the `PATH`. # The solution To eliminate the problem, this PR reworks the `pavex` CLI: it is now a _version manager_. All the meaty functionality (server SDK generation, project generation) is moved into another binary, `pavexc` (**pavex** **c**ompiler). `pavex` introduces the concept of toolchains, in the same vein of `rustup`. There can be multiple toolchains installed and it'll pick the most appropriate one for each command: - For `new`, it'll check the default toolchain. If none has been defined, it'll use the corresponding version of `pavexc`. - For `generate`, it'll match the version of `pavex` (the library) used in the project. If the corresponding `pavexc` toolchain is not installed, it'll be installed on the fly. ## Missing pieces The `pavex` CLI needs to grow a few commands to manage toolchains: `pavex toolchain default set`, `pavex toolchain default show`, `pavex toolchain list` and something for removal. Since they are only relevant for `pavex new`, that's deferred to a later PR.
- Loading branch information
1 parent
f21fd49
commit 325626f
Showing
56 changed files
with
2,638 additions
and
234 deletions.
There are no files selected for viewing
This file contains 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
23 changes: 20 additions & 3 deletions
23
doc_examples/guide/dependency_injection/cookbook/project/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
31 changes: 20 additions & 11 deletions
31
doc_examples/guide/middleware/core_concepts/project/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 20 additions & 3 deletions
23
doc_examples/guide/request_data/buffered_body/project/Cargo.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.