unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: guix-devel@gnu.org, Martin Becze <mjbecze@riseup.net>
Subject: Re: Compiling rust things without cargo (super WIP POC)
Date: Fri, 01 Apr 2022 11:10:11 +0200	[thread overview]
Message-ID: <87lewpnp8s.fsf@gnu.org> (raw)
In-Reply-To: <36c1a8dcb363f8780b45156058ea606d0dd50854.camel@telenet.be> (Maxime Devos's message of "Thu, 31 Mar 2022 22:06:10 +0200")

Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

> I invite you to take a look at <https://notabug.org/maximed/cargoless-rust-experiments>.
> It contains a minimal rust library (libhello) and a minimal 'hello
> world'-style application that uses 'libhello'.
>
> To simulate how Guix compiles C software (but here applied to Rust), 
> the Makefile does the following:
>
>   * Run 'rustc --crate-type=lib libhello/hello.rs -o out/libhello/lib/libhello.rlib',
>     to compile the library and install it in 'out/libhello/lib/libhello.rlib'
>     (cf. /gnu/store/...-libhello.../lib/hello.so).
>
>   * Run 'rustc -Lout/libhello/lib hello-app/main.rs -o out/hello-oxygen/bin/hello'
>     to compile the application.  By default, rustc will fail because it cannot find
>     the library.  However, if -Lout/libhello/lib is passed, then it does find it!
>
>     (cf. LIBRARY_PATH=/gnu/store/.../lib & gcc -L/gnu/store/.../lib)
>
> This is a rather basic example (no transitive dependencies, no test dependencies,
> no macros ...), but it seems like there are some possibilities here ...

Interesting.

> As a next step, maybe I could try writing a Guix package definition for libhello
> and hello-oxygen, gradually making things more complicated (macros, transitive
> dependencies, some non-toy Rust dependencies, a Guix build system ...)?

I guess the whole question is whether that technique can be made to work
for the vast majority of Rust packages.  I’d suggest working in that
direction: writing a build system as a first step, using it in all the
Rust packages, and analyzing the kinds of problems encountered, with the
goal of estimating the effort it would take to make it work for every
single package.  Easier said than done, I guess.

Overall, I’m afraid Rust packaging is getting out of hands and we’re all
looking elsewhere.  For example, that Rust packages live in their own
separate world means there’s no tooling available, leading to poor QA, a
proliferation of versions of the same packages that never get removed,
and so on.  I think addressing that, for instance with something as I
proposed in <https://issues.guix.gnu.org/53127>, should be high
priority.

Thoughts?

Ludo’.


  parent reply	other threads:[~2022-04-01  9:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 11:55 Removing #:skip-build? from the crate importer? Maxime Devos
2022-03-31 19:47 ` Hartmut Goebel
2022-03-31 20:06   ` Compiling rust things without cargo (super WIP POC) Maxime Devos
2022-04-01  6:58     ` Brendan Tildesley
2022-04-01  9:10     ` Ludovic Courtès [this message]
2022-04-01 10:05       ` Maxime Devos
2022-04-01 10:08       ` Maxime Devos
2022-04-02 15:01         ` Hartmut Goebel
2022-04-02  9:29     ` Maxime Devos
2022-04-05 12:08       ` Ludovic Courtès
2022-04-02 15:18     ` Building hexyl (a rust app) without cargo, with antioxidant-build-system Maxime Devos
2022-04-05 16:10       ` Maxime Devos
2022-04-06 15:49         ` Hartmut Goebel
2022-04-06 16:06           ` Maxime Devos
2022-05-30  8:23       ` Efraim Flashner
2022-05-30 13:37         ` raingloom
2022-05-30 15:15         ` Maxime Devos
2022-04-02 15:19     ` Compiling rust things without cargo (super WIP POC) Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lewpnp8s.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=maximedevos@telenet.be \
    --cc=mjbecze@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).