Skip to content

Incompatbile versions between alloy and forge bindings #9844

Closed
@alxiong

Description

@alxiong

I encountered a slight annoyance when using both alloy and forge bind --alloy.

  • forge bind --alloy-version "v0.11.0" would depend on git+https://github.com/alloy-rs/alloy?rev=v0.11.0#f4d34d4039270b9e2da2b62cc84351f1145ef3a5
  • alloy = 0.11.0 would depend on the one artifacts on crates-io

and cargo will treat them as two versions as you will see two entries in Cargo.lock:

name = "alloy"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5295219c9bc87cfa2497131423921e8ea136ee7e2ab338967078995168431d5"

name = "alloy"
version = "0.11.0"
source = "git+https://github.com/alloy-rs/alloy?rev=v0.11.0#f4d34d4039270b9e2da2b62cc84351f1145ef3a5"

This will have many compiler complains about type incompatibility.
While I can live with alloy = { git = "https://github.com/alloy-rs/alloy", rev = "v0.11.0" } explicitly in my crates for now. It's not ideal.

Proposal

update forge bind behavior so that the populated Cargo.toml file declare its alloy dependency

  • --alloy-version will use version instead of rev.
  • add a separate flags --alloy-rev to mean rev

Metadata

Metadata

Assignees

Labels

C-forgeCommand: forgeCmd-forge-bindCommand: forge bindT-bugType: bugfirst issueA good way to start contributing

Type

No type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions