On Mon, 2017-01-30 at 12:46 +0000, Fabio Valentini wrote:
On Mon, Jan 30, 2017 at 12:11 PM Igor Gnatenko <
ignatenkobrain(a)fedoraproject.org> wrote:
> On Mon, 2017-01-30 at 11:06 +0000, Fabio Valentini wrote:
> > On Mon, Jan 30, 2017 at 11:19 AM Igor Gnatenko <
> > ignatenkobrain(a)fedoraproject.org> wrote:
> >
> > > On Mon, 2017-01-30 at 09:29 +0000, Fabio Valentini wrote:
> > > > Hi Guys,
> > > >
> > > > I've been interested in Rust for some time now (and even
> > > > more,
> > > > now
> > > > that
> > > > I've learned about functional programming and studied the
> > > > lambda
> > > > calculus
> > > > at university ;)
> > > >
> > > > I have 2 questions regarding the state and future of Rust on
> > > > fedora:
> > > >
> > > > 1) Is there support for building and distributing rust
> > > > libraries
> > > > as
> > > > shared
> > > > libraries (.so files), if the crate supports it?
> > >
> > > As far as I know at this moment it doesn't really work properly
> > > and
> > > it
> > > is also hard to support "features" because either you should
> > > build
> > > shared library with support for all features or you build with
> > > minimal
> > > and it seems not good idea.
> > > >
> > > > If not, this could lead to at least one problem ... any
> > > > software
> > > > package
> > > > using a rust library via a FFI (as described at [0]) would
> > > > have
> > > > to
> > > > build
> > > > the crate itself and bundle the library. I don't think this
> > > > is
> > > > feasible in
> > > > the long run (every package having to build the create itself
> > > > and
> > > > every
> > > > package having to include the .so file looks like a lot of
> > > > wasted
> > > > work,
> > > > time and space to me).
> > > >
> > > > Additionally, I generally dislike linking everything
> > > > statically
> > > > (like
> > > > golang does), and would much prefer if fedora supported
> > > > building
> > > > and
> > > > distributing rust libraries from the start. ;)
> > > >
> > > >
> > > > 2) Is there a tool for generating .spec files / srpms from
> > > > crates
> > > > (like
> > > > gofed, but nicer), and is such a tool planned?
> > >
> > > Not yet and probably it will be very simple since I want to
> > > have
> > > all
> > > BuildRequires/Requires/Provides generation in RPM and not in
> > > some
> > > external tools. So work on this tool will be just get version,
> > > summary
> > > and create spec from very simple template.
> > >
> >
> > How can RPM generate BuildRequires - solely from the source
> > archive?
> > Even if that could work (in the future?), doing it that way would
> > be
> > make
> > the whole process too opaque to packagers in my opinion ...
>
> Same way as for generating Requires - it's opaque for packagers.
> It's
> really a shame that we don't generate BuildRequires for
> python/ruby/etc. automatically.
>
With the difference that Requires are generated after the build and
are
needed after the build - BuildRequires would be generated FROM the
build
and needed before the build, so that is kind of a bootstrap problem,
if the
process is not changed (split into two phases).
BuildRequires are read from .spec and installed before %prep is
executed,
so not even an unpacked (and maybe patched) source is available at
that
point.
I don't see how auto-generating BuildRequires could work without
invasive
changes in the way RPMs are built, for example needing two phases of
installing BuildRequires installs instead of one (Install Phase 1:
the BRs
explicitly specified in the .spec file are installed, then the
sources are
unpacked and processed, and Install Phase 2: install phase with the
determined BRs?).
Don't worry, we discussed this with RPM developers and they
are aware
of this and feel free to read rpm-ecosystem@ about any further
discussions about this.
> Though there is no support in RPM for generating BuildRequires at
> this
> point, but I'm discussing it with RPM maintainers and looks like
> that
> they (at least Florian) like this idea[0].
> [0]
http://lists.rpm.org/pipermail/rpm-ecosystem/2017-January/00044
> 8.ht
> ml <
http://lists.rpm.org/pipermail/rpm-ecosystem/2017-January/00044
> 8.html>
> --
> -Igor Gnatenko
--
-Igor Gnatenko