Re: Help packaging a "C" library written in Rust

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 07, 2022 at 08:50:24AM -0400, Stefan Hajnoczi wrote:
> On Wed, Sep 07, 2022 at 10:05:55AM +0100, Richard W.M. Jones wrote:
> > 
> > https://gitlab.com/libblkio/libblkio
> > 
> > This is a library that offers a C API.  It happens to be implemented
> > in Rust, but it's not a "Crate" or anything like that.
> > 
> > I wrote a spec file for it assuming it's a C library and it works fine
> > when building locally:
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=2124697
> > 
> > However it turns out that it downloads stuff during the build and
> > therefore won't build in Koji.  Apart from reading the Rust packaging
> > guidelines which don't seem applicable here (as this is not a Rust
> > Crate), that's as far as I've got on this one.
> > 
> > Has anyone packaged anything like this for Fedora?
> 
> I'm a relative packaging newbie but I intended to package libblkio by
> following the Rust packaging guidelines for the blkio and virtio-driver
> crates in the libblkio.git repo. These crates live in libblkio.git but
> may eventually move into their own repos. They are already published on
> crates.io:
> https://crates.io/crates/blkio
> https://crates.io/crates/virtio-driver

Interesting.  I wonder if packaging blkio & libblkio separately
conflicts with the usual requirement for 1 source == 1 package?
Of course that could be split upstream.

> Then I would treat libblkio itself (the top-level crate that builds the
> C library) like a Rust application rather than a Rust crate, because we
> need to package the .so instead of shipping the crate source code.
> 
> I was expecting to package all external dependency crates that are not
> yet available in Fedora. I haven't checked which ones are missing yet.

The missing ones are:

  concat-idents
  io-uring
  memfd

And these ones seem to be required but are presumably not used:

  winapi
  winapi-i686-pc-windows-gnu
  winapi-x86_64-pc-windows-gnu

Anyway have a look at the bug because I've got a package that actually
builds now in Koji, by using all the existing rust packages where they
exist + bundling the 6 packages above.

  https://bugzilla.redhat.com/show_bug.cgi?id=2124697

Also it fails to build on i686 which might indicate a bug.  If it's
not intended to work on i686 then we are allowed to add ExcludesArch.

> The approach I had in mind is probably more work upfront, but in the
> long term it will allow sharing of crates with other Rust
> crates/programs that use the same crates.
> 
> Maybe this is a bit ambitious though and we should follow the librsvg2
> approach?

It seems like librsvg2 bundling isn't the right model to follow.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux