-
Notifications
You must be signed in to change notification settings - Fork 70
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
chore: remove dependency on syn_derive #318
chore: remove dependency on syn_derive #318
Conversation
0519d88
to
4a8bdbf
Compare
So if syn_derive will migrate to proc-macro-error2 there would be no problem in borsh-rs even in case of syn_derive usage? |
I just pushed an update to switch syn_derive to proc-macro-error2, but yeah I have to agree that it seems pretty silly to use syn_derive for such a small part. |
@dzmitry-lahoda yes that is correct. As per next steps is your call, my original intention opening this was basically:
So I think you can either go to |
@kayagokalp this removes 2 dependencies from dependency tree, collapse
135d134
< "syn_derive",
587,607d585
< name = "proc-macro-error-attr2"
< version = "2.0.0"
< source = "registry+https://github.com/rust-lang/crates.io-index"
< checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
< dependencies = [
< "proc-macro2",
< "quote",
< ]
<
< [[package]]
< name = "proc-macro-error2"
< version = "2.0.1"
< source = "registry+https://github.com/rust-lang/crates.io-index"
< checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
< dependencies = [
< "proc-macro-error-attr2",
< "proc-macro2",
< "quote",
< ]
<
< [[package]]
900,911d877
< ]
<
< [[package]]
< name = "syn_derive"
< version = "0.2.0"
< source = "registry+https://github.com/rust-lang/crates.io-index"
< checksum = "cdb066a04799e45f5d582e8fc6ec8e6d6896040d00898eb4e6a835196815b219"
< dependencies = [
< "proc-macro-error2",
< "proc-macro2",
< "quote",
< "syn 2.0.87",
didn't see any improvement in error location output in the variant when |
@race-of-sloths score 5 |
@dj8yfo Thank you for calling! @kayagokalp Thank you for the contribution! Join Race of Sloths by simply mentioning me in your comment/PRs description and start collecting Sloth Points through contributions to open source projects. What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
@Kyuuhachi oh, well, probably proc-macro-error2 is for reporting errors when |
@dj8yfo I would still argue that is not the case. You have ~580 crates depending on I guess this is the effect of being in a hot-path so it makes even more sense to be careful in these type of repos. On top of this added level of indirection while managing your dependencies is something else and in my opinion should also be taken into account while accessing whether to depend on something or implement it yourself. Thanks for the quick fix, and release! |
@kayagokalp only 2 mentioned ones (proc-macro-error2... )aren't depended on otherwise. Other 5 are included as dependencies anyway. it would've been worth even the small addition of 21 lines, if it didn't introduce any additional dependencies besides itself ( |
Removes dependency on
syn_derive
crate.The added dependency is saving 21 lines of code at the cost of added Cargo.lock entries for a large list of projects depending on borsh-rs. The motivation came from the fact that
proc-macro-error
crate is unmaintained and the rust ecosystem is slowly transitioning intoproc-macro-error2
(already 800k downloads) but this change did not land onsyn_derive
. This causes crates depending onborsh-rs
transtively depending onsyn_derive
and thusproc-macro-error
. Also it is generally thought as a good practice to remove external dependencies especially if they are not gaining us much to begin with.Related to https://rustsec.org/advisories/RUSTSEC-2024-0370.html