Replies: 1 comment
-
|
Closing this in favor of #2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following is a comment I posted in the DevRel repo, which isn't public, so I'm reposting it here for discussion within the context of
midenup. The context of the discussion preceding my comment was about unifying the Miden toolchain under a single CLI tool, calledmiden, which would have some kind of basic install process, e.g.cargo install miden. That discussion was started in parallel with our design ofmidenup, and I think bothmidenupandmidenare essentially two sides of the same coin - one handling installation/updates/toolchain management, and one handling usage of a selected toolchain, by surfacing all of the toolchain components using a single entrypoint,miden.I definitely think we should avoid trying to combine everything literally into a single CLI (as opposed to a Git-style porcelain approach). There are multiple reasons for that:
cargo-midenis maintained within the compiler repo, as part of our regular development process).As an aside, I think we should avoid conflating two closely related activities:
With that in mind, I think our approach should be comprised of two tools,
midenupandmiden, as follows:midenupfor toolchain management. This would involve a user runningcargo install midenup && midenup initto walk through configuring their environment and installing the desired set of initial components. Updating the currently installed toolchain components would be as simple as runningmidenup update. Themidenuptool gets information about available toolchains, and their components, by fetching it from GitHub (published as JSON via GitHub Pages). Thus new versions and components can be made available without having to release a new version ofmidenupitself.stable, or explicit versions. Toolchain versions I think could be based on the Miden VM version initially, since it is currently the most foundational component, and the one most likely to break compatibility; but we can also version toolchains independently, so that we can more accurately represent changes between toolchain versions. Channels are a way of staying up to date with latest versions of all components without pinning a version. For example, thestablechannel would always reflect the latest versions of all components, and runningmidenup update stablewould update to those latest versions, even if there are breaking changes since the last time you updated it. A channel corresponding to a specific Miden version, e.g.0.15.0, would always reflect the latest versions of all components compatible with that toolchain version, i.e. if a new version of the Miden node is released, but it isn't backwards-compatible with0.15.0, then runningmidenup update 0.15.0would ignore that new version.midenupCLI would provide shell integration so that switching to a directory with amiden-toolchain.tomlfile would activate the toolchain specified in that file. If the toolchain is not currently installed,midenupwould do so the first timemidenis run. Toolchains are activated at a low-level by settingMIDEN_SYSROOTto the appropriate toolchain root directory, and prepending$MIDEN_SYSROOT/binto the currentPATH, making all of the executables of that toolchain available for use.midenexecutable which is a thin wrapper around the set of binaries installed bymidenup, and integrates withmidenupwhen necessary. Themidenexecutable would be installed bymidenup init. This executable would consist of any number of subcommands implemented as one of the following:midenbinary. It is unlikely that there would be many of these, but things related to global settings and such might be appropriate for this kind of subcommand.PATH, and which requires no pre-processing of its arguments. When invoking this type of subcommand, themidenCLI would execute the external tool as a subprocess, forwarding all of the arguments. For example,miden foo [ARGS..]would expect an executable in the currentPATHcalledmiden-foo, which would be invoked asmiden-foo [ARGS..]. Ifmiden-foois not found, we could either inform the user that they need to install that component; prompt them if they'd like to install it; or automatically install it.miden. For example,miden sendmight correspond to something likemiden-client transaction send. This form of subcommand essentially converts/forwards its arguments to whatever is expected by the underlying executable, as if it had been invoked as a regular external subcommand.Putting all of this together, we get the following:
midenup updatewhen they wish to pick up updates that are compatible with their current channel/toolchain.Work on
midenuphas already started here (the repo was just created today, so it may be a few days before the repo where prototyping started gets merged in, but that's where things will live going forward). The immediate goal is to build an MVP of themidenupfunctionality, i.e. bootstrapping thestabletoolchain with a subset of the Miden components, namely the VM, compiler,cargo-miden, and standard and transaction kernel libraries.From there, the next step is to define the
midenCLI as described above. Following that, we'll want to create/rename all of the executables that we wish to expose viamidenwherever they live today (e.g.midenexecutables in the VM and client repos would be renamed tomiden-run(my suggestion) andmiden-clientrespectively). Once that's done, we can expose more components for installation viamidenup. Further improvements to bothmidenupandmidencan be identified and implemented from there./cc @igaray @greenhat
Beta Was this translation helpful? Give feedback.
All reactions