rpm-rs icon indicating copy to clipboard operation
rpm-rs copied to clipboard

librpmbuild-sys backend?

Open tarcieri opened this issue 5 years ago • 6 comments
trafficstars

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

  • repo: https://github.com/rpm-software-management/librpm.rs/tree/master/librpmbuild-sys
  • docs: https://rustrpm.org/librpmbuild_sys/index.html

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.

tarcieri avatar Dec 28 '19 00:12 tarcieri

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

Richterrettich avatar Jan 13 '20 23:01 Richterrettich

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.

tarcieri avatar Jan 14 '20 01:01 tarcieri

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

Richterrettich avatar Mar 12 '20 06:03 Richterrettich

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

drahnr avatar May 03 '20 19:05 drahnr

@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

tarcieri avatar May 03 '20 21:05 tarcieri

@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.

drahnr avatar May 04 '20 09:05 drahnr