Richterrettich / rpm-rs

A pure rust library for building and parsing RPM's
Other
39 stars 19 forks source link

librpmbuild-sys backend? #6

Open tarcieri opened 4 years ago

tarcieri commented 4 years ago

Just discovered this project, which looks quite interesting! I just wanted to note that there's a librpmbuild-sys crate available:

There's presently no idiomatic Rust wrapper to the librpmbuild-sys crate (or any plans to build one), but it seems like rpm-rs could potentially provide such a wrapper (e.g. as an optional feature) using its current API.

Richterrettich commented 4 years ago

Hi! so you mean that rpm-rs should have an optional feature to use librpmbuild-sys as a backend?

tarcieri commented 4 years ago

Yeah, something like that, gated under a cargo feature. I'm not sure how that'd manifest at the API layer, but maybe you could make a trait for the actual RPM builder component and allow a librpmbuild-sys backend to be swapped in somehow.

Just a thought, mostly noting that this library solves the problem of what an idiomatic Rust API for an RPM builder should look like.

Richterrettich commented 4 years ago

I am open to the idea. If you want, you can sketch a PR. I think we need some sort of a proof of concept to see if this makes sense or not

drahnr commented 4 years ago

Could somebody kindly explain the gain of adding an impl of librpmbuild-sys to me, I seem to be oblivious to them.

tarcieri commented 4 years ago

@drahnr librpmbuild is effectively the reference implementation, so if nothing else, it'd be useful to compare whether the two backends produce equivalent outputs, but also it's more fully featured if people would like to leverage features that aren't yet implemented in rpm-rs

drahnr commented 4 years ago

@tarcieri but in that case one could also compare the output of both an compare the bytes / individual sections - without the need to introduce complexity to the library. On another note, I am not sure if it is a sane approach trying to implement all features of rpm, there is a lot of legacy functionality which is effectively dead.