Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] syn-solidity Semver Incompatibility #736

Closed
ratankaliani opened this issue Sep 12, 2024 · 1 comment
Closed

[Bug] syn-solidity Semver Incompatibility #736

ratankaliani opened this issue Sep 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ratankaliani
Copy link

Component

syn-solidity

What version of Alloy are you on?

0.8.0

Operating System

None

Describe the bug

Background
The syn-solidity crate recently introduced a breaking change in version 0.8.3, which was not reflected in its semantic versioning. This change has caused compilation issues for downstream consumers, highlighting the importance of adhering to Semver principles.

Issue Details
Alloy crates were at version 0.8.0
Cargo automatically bumped syn-solidity to version 0.8.3
Version 0.8.3 introduced a breaking change in the API for indexed_by_hash
This change was implemented in PR: #735

The error logs can be seen here:

error[E0061]: this method takes 1 argument but 0 arguments were supplied
   --> /Users/ratankaliani/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alloy-sol-macro-expander-0.8.0/src/expand/event.rs:84:14
    |
84  |         if p.indexed_as_hash() {
    |              ^^^^^^^^^^^^^^^-- an argument is missing
    |
note: method defined here
   --> /Users/ratankaliani/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-solidity-0.8.3/src/item/event.rs:259:12
    |
259 |     pub fn indexed_as_hash(&self, custom_is_value_type: impl Fn(&SolPath) -> bool) -> bool {
    |            ^^^^^^^^^^^^^^^
help: provide the argument
    |
84  |         if p.indexed_as_hash(/* custom_is_value_type */) {
    |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Compiling alloy-trie v0.5.1
error[E0599]: no method named `is_abi_dynamic` found for reference `&EventParameter` in the current scope
   --> /Users/ratankaliani/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alloy-sol-macro-expander-0.8.0/src/expand/event.rs:228:14
    |
228 |     if param.is_abi_dynamic() {
    |              ^^^^^^^^^^^^^^ method not found in `&EventParameter`
    |
help: one of the expressions' fields has a method of the same name
    |
228 |     if param.ty.is_abi_dynamic() {
    |              +++

error[E0061]: this method takes 1 argument but 0 arguments were supplied
   --> /Users/ratankaliani/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alloy-sol-macro-expander-0.8.0/src/expand/event.rs:242:23
    |
242 |     let ty = if param.indexed_as_hash() {
    |                       ^^^^^^^^^^^^^^^-- an argument is missing
    |
note: method defined here
   --> /Users/ratankaliani/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-solidity-0.8.3/src/item/event.rs:259:12
    |
259 |     pub fn indexed_as_hash(&self, custom_is_value_type: impl Fn(&SolPath) -> bool) -> bool {
    |            ^^^^^^^^^^^^^^^
help: provide the argument
    |
242 |     let ty = if param.indexed_as_hash(/* custom_is_value_type */) {

Impact
The Semver incompatibility has resulted in compilation failures for projects that depend on syn-solidity and Alloy. This situation forces downstream consumers to manually intervene and precisely downgrade syn-solidity which is a bad developer experience. I'd recommend using a tool like https://github.com/MarcoIeni/release-plz to catch API breaking changes.

@ratankaliani ratankaliani added the bug Something isn't working label Sep 12, 2024
@ratankaliani ratankaliani changed the title [Bug] Semver Incompatibility [Bug] syn-solidity Semver Incompatibility Sep 12, 2024
@DaniPopes
Copy link
Member

Bumping a single alloy crate is generally not supported, especially when it's a crate that's tightly coupled with others, and when the breakage is for a bug fix

@DaniPopes DaniPopes closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants