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

Remove proc-macro-error as an abandonware dependency #83

Open
johngigantic opened this issue Oct 16, 2023 · 3 comments
Open

Remove proc-macro-error as an abandonware dependency #83

johngigantic opened this issue Oct 16, 2023 · 3 comments

Comments

@johngigantic
Copy link

I ran into an error in my CI/CD testing. I am performing a test where I compile all crate dependencies using the minimum valid version numbers. The bilge-impl crate fails to compile - although the error is in its dependency, the proc-macro-error crate. The proc-macro-error crate has a bug in version 1.0.0 which is fixed in its latest version, 1.0.4. However, because bilge-impl specifies the minimum proc-macro-error version as 1.0 instead of ^1.0.4, this error shows up when I do the minimum-version test.

The quick and easy fix is to specify the version number, and just change the bilge-impl Cargo.toml file dependency to proc-macro-error = { version = "1.0.4", default-features = false }

I think that the quick fix would be wrong, however - it's clear that the proc-macro-error crate is abandoned. It doesn't have any updates since 3 years ago, its owner has no git history over the last year, and it is failing to keep up with some critical libraries - syn 2.0, for example.

To finish this out, I think that
(1) any proc-macro-error usage should be taken out of the codebase.
(2) this library should also implement a similar minimum version CI/CD test.

I'd be happy to help with both and submit a PR.

@johngigantic
Copy link
Author

My compile error, shown in my CI/CD pipeline

cargo check --all-features --locked
...
   Compiling bilge-impl v0.2.0
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `::`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bilge-impl-0.2.0/src/try_from_bits.rs:35:9
   |
35 | ...   emit_call_site_warning!("enum fills its bitsize"; help = "you can use `#[derive(FromBits)]` instead, rust will provide `TryFrom` for you (so you don't necessarily have to update call-sites)...
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator
   |
   = note: this error originates in the macro `emit_call_site_warning` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `bilge-impl` (lib) due to previous error
Error: Process completed with exit code 101.

@johngigantic
Copy link
Author

johngigantic commented Oct 16, 2023

Steps to replicate:

  • Get in the bilge-impl directory
  • Set the compiler to use the nightly toolchain - the next step depends on this.
  • Run cargo generate-lockfile -Z minimal-versions to generate a lockfile with the minimum possible version numbers
  • (Alternatively, edit the cargo.toml file to specifically pin proc-macro-error V1.0.0)
  • Run cargo build

@hecatia-elegua
Copy link
Owner

hecatia-elegua commented Oct 16, 2023

will see what they're doing and maybe fork or find a fork, thank you for the heads-up!
There are some forks already.

(for later use, this is the original:)
https://crates.io/crates/proc-macro-error/1.0.4
https://gitlab.com/CreepySkeleton/proc-macro-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants