You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the hugr cli tool instead. If we wish to maintain feature-parity we'll need to export an extension definition for tket2 and include it here (via git subtrees?).
Spinoff of #454
Replaces the validator python library with a small binary that calls out
to `hugr-cli validate`.
`cargo install` lets us download tools like `hugr-cli` and use them for
local development, but the support for locally scoped tools is quite
flaky. By default, tools are installed in a global directory using the
latest version available.
It can be forced to use a local target directory via an env variable /
`cargo` config (which didn't always work while I was testing it), and
version selection can only be done by passing explicit arguments to the
cmd. As there is no central `Cargo.toml` (or similar) config for it,
this relies on every usage point always passing exactly the same
arguments. Updating the tool version / patching in a git ref ends up
being quite error prone.
The solution in this PR is inspired by cargo's own `xtask-` subcrates.
These are internal crates meant to run some external tool, while
centrally defining the dependency versions and artifact paths.
The new `validator` bin crate here checks if `hugr-cli` is installed,
and calls `cargo install` with the appropriate parameters otherwise,
before running the tool. The version to install matches the one
configured in `Cargo.toml`. This ensures we control the validation in
the same way as all the other hugr dependencies (e.g. the `hugr` dep
used in `execute_llvm`).
Running `cargo run` now acts the same as executing a locally-versioned
`hugr-cli`.
drive-by: Created a cargo workspace.
note: I temporarily disabled the tests that required the "collections"
extension definition. This will get fixed once we merge #454, I just
didn't want to wire in a hacky solution that'll get dropped in the next
PR.
Closes#390
---------
Co-authored-by: Craig Roy <croyzor@users.noreply.github.com>
Co-authored-by: Agustin Borgna <agustinborgna@quantinuum.com>
Use the
hugr
cli tool instead. If we wish to maintain feature-parity we'll need to export an extension definition for tket2 and include it here (via git subtrees?).See CQCL/tket2#556
The text was updated successfully, but these errors were encountered: