I rarely make PRs to rust-lang/rust, because the nature of my contribution to the Rust project rarely requires it. My penultimate PR was made in September 2018. I made a PR over the last few months and I've found it orders of magnitude more difficult than in 2018, enough that I will actively avoid making code contributions if I can help it in the future.
I am an extremely informed user, who understands the language, the project's processes, etc very intimately. Therefore, if I find it this daunting, I can only imagine that this is a problem for other would-be small contributors. Since I understand the Rust project would like to be accessible for new and infrequent contributors, I wanted to write about my experience to hopefully give useful feedback to the people who maintain the rust-lang/rust repository.
The fundamental issue is time: everything stems from the fact that I did not want to spend the many hours required to do a complete set up, to run tests locally, etc. My contribution was a small addition to the standard library, purely additive, which I could compile and check separately from the main library.
Ultimately I managed to make my contribution without doing a full bootstrap, but even git operations took unreasonably long. My initial clone took around 2 minutes (the repo is now nearly 500 MB), instantiating submodules took 10.
To avoid bootstrapping, I compiled my additions as their own library outside of the Rust repo. I believed this would accurately predict the status of CI builds because I knew no impls added would've been covered by the orphan rules, so I knew it was analogous to the actual code I would add. However, I was not prepared for the rust repo's tidy check.
Here are the changes that tidy demanded in order to pass CI. Please judge for yourself whether it was appropriate to block CI on these diffs:
-use core::task::{Waker, RawWaker, RawWakerVTable};
+use core::task::{RawWaker, RawWakerVTable, Waker};
-///
+///
(There was a trailing space in the first line)
- unsafe {
- Waker::from_raw(raw_waker(waker))
- }
+ unsafe { Waker::from_raw(raw_waker(waker)) }
- RawWaker::new(Arc::into_raw(waker) as *const (), &RawWakerVTable::new(
- clone_waker::<W>,
- wake::<W>,
- wake_by_ref::<W>,
- drop_waker::<W>,
- ))
+ RawWaker::new(
+ Arc::into_raw(waker) as *const (),
+ &RawWakerVTable::new(clone_waker::<W>, wake::<W>, wake_by_ref::<W>, drop_waker::<W>),
+ )
(In my opinion this last one has actively made the code much worse!)
It's very easy to lose sight of the experience new and infrequent contributors have when you are a maintainer and regular contributor to a repository. Contributing to the rust repository now requires hours of set up and significantly expensive checks to write code which passes CI. I am afraid the project is becoming encloistered by the size of its repository, the time it takes to set up, and practices which don't consider the experience for people who do not have a current environment already on their machines.