feat: add dx print command, drive hotpatching engine directly. #4602
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.
dx print
Adds a
printcommand for printing the cargo args we pass off to the build system.It supports a number of output formats to make it easy to integrate with 3rd-party build systems.
By default, it prints a runnable command which you can simply echo into your current shell and get a build running.
It's designed so you can print either the client or the server with two different commands (client-args, server-args).
A number of output styles are available:
For json, you can use the jq tool to pull out fields in a structured format.
I had to make a few changes to request to support this.
direct hotpaching engine drive
This PR also adds the ability to drive the hotpatching engine directly from the CLI without any watcher setup. This delegates the file watching, filtering, etc to the calling tool, but makes it much easier to use the subsecond engine directly. The point of this usecase is to wire up the docsite playground for hotpatching, though I imagine other CLIs might want to use it too.