facebookincubator / reindeer

Reindeer is a tool to transform Rust Cargo dependencies into generated Buck build rules
MIT License
184 stars 30 forks source link

Feature request: Fixup gallery? Or perhaps a `reindeer add` command? #19

Open photex opened 1 year ago

photex commented 1 year ago

Could there perhaps be a wiki added to this repo with a gallery of common fixups, maybe a generated table of crates with their known fixups?

Another interesting possibility is a command reindeer add that can apply known fixups... but as I write this I realize that vendor would already be a place to do this. I suppose that a reindeer add command would update your third party Cargo.toml with a dependency and then setup a know fixup for the crate (and transitives) in cases where you aren't going to vendor.

I'm willing to put a PoC of that together for discussion, but having only just started looking at all of this I'd hate to start digging around and find out there were already plans in place, or some internal convention or whatever that might soon be made public. :D

zertosh commented 1 year ago

Could there perhaps be a wiki added to this repo with a gallery of common fixups

I have it on my long TODO list to build Reindeer with buck2 OSS. That should carry with it a healthy amount of fixups.

Another idea would be to link to other Meta project's fixups:

Another interesting possibility is a command reindeer add that can apply known fixups...

I don't think that's something we want to take on and maintain. I'd be more interested in exploring cases where we can make fixups unnecessary altogether.

thoughtpolice commented 1 year ago

I don't think an add command is necessary, just a common set of fixups that are maintained and people can contribute to. Honestly, I just spent about 20 minutes combing through buck2's fixup directory, copying/pasting things from within it, and it would have been much nicer if I could have just copy-pasted a big common directory that was maybe over-approximate, but tested to work.

Is there any reason a bunch of fixups couldn't just be put under fixups/ at the root of this repo, people can contribute, and we just say it's best effort? Literally just "Copy fixups/ next to reindeer.toml, run reindeer buckify, and it might work if you're lucky. Patches welcome to add or fix things" is enough. It shouldn't even be that hard to use buck2 binaries to test the crate builds in a CI step too, but just something that's shared and re-usable would be great.

photex commented 1 year ago

Whatever makes it easier to find all the fixups people are using successfully would make adoption much easier. It is annoying to even suggest it, but in a lot of ways until an alternative to Cargo achieves some broader mindshare we're looking at a WineDB situation I think.

As it stands you have to really want an alternative to Cargo and power through. :D

I'd be more interested in exploring cases where we can make fixups unnecessary altogether. That is of course the best option. Its going to come down to a lot of crates intentionally avoiding certain bad habits from Cargo I guess.