All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [Patch v7 02/10] rust-bin: new package
Date: Thu, 7 Sep 2017 20:13:57 +0200	[thread overview]
Message-ID: <20170907181357.GB6001@ned> (raw)
In-Reply-To: <fc4e8074-48fc-39bc-43c2-ac38547547bb@mind.be>

Hi!

On 17-08-11 01:08:01, Arnout Vandecappelle wrote:
>
>
> On 23-07-17 10:11, Eric Le Bihan wrote:
> [snip]
> > +define HOST_RUST_BIN_INSTALL_CMDS
> > +	for exe in $$(find $(@D) -name install.sh -executable); do \
>
>  I don't like this very much. Is this one install.sh per package that you
> install here (i.e. rustc, host-rust-std and rust-std)? In that case, it will
> resolve itself when you split off rust-std in a separate package. Or is there
> really a bunch of install.sh scripts scattered around?

No, there are only three install.sh scripts, one for rustc, one for the
host library and another for the target library:

 - host-rust-bin-1.19.0/install.sh
 - host-rust-bin-1.19.0/std/rust-std-1.19.0-x86_64-unknown-linux-gnu/install.sh
 - host-rust-bin-1.19.0/std/rust-std-1.19.0-armv7-unknown-linux-gnueabihf/install.sh

I used a loop instead of defining
$(HOST_RUST_BIN_INSTALL_{RUSTC,LIBSTD_HOST,LIBSTD_TARGET), which may
have been more explicit. But with a rust-std-bin package, this would of
course, disappear.

> > +		$${exe} \
> > +			--prefix=$(HOST_DIR) \
> > +			--docdir=$(HOST_DIR)/share/doc/rust \
>
>  Would it be possible to avoid installing docs completely?
>
> > +			--libdir=$(HOST_DIR)/lib \
> > +			--mandir=$(HOST_DIR)/share/man \
>
>  Same here.

In fact, only --prefix=$(HOST_DIR) is usefull. The others can be removed.

> > +			--disable-ldconfig; \
> > +	done
> > +endef
> > +
> > +$(eval $(host-generic-package))
> > diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
> > index fef78a7..7f2c276 100644
> > --- a/package/rustc/Config.in.host
> > +++ b/package/rustc/Config.in.host
> > @@ -1,5 +1,46 @@
> > +config BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
> > +	bool
> > +	default y
> > +	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
> > +	depends on  BR2_i386 || BR2_x86_64 \
> > +		|| BR2_arm  || BR2_aarch64 \
> > +		|| BR2_powerpc  || BR2_powerpc64 \
> > +		|| BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
> > +	depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
> > +	depends on !BR2_MIPS_NABI32
> > +	depends on BR2_TOOLCHAIN_USES_GLIBC
>
>  Ah, it depends on glibc... That voids my earlier questions about TARGET_OS,
> LIBC and ABI support.
>
>  This entire piece should be kept together with the part in the first patch that
> defines RUST_TARGET_NAME etc. Unlike Joerg, I kind of like this stuff to already
> be done in the patch that adds the virtual package, but either way works.

OK. I'll move it to the patch declaring the virtual package.

> > +
> > +config BR2_PACKAGE_HOST_RUSTC
> > +	bool "host rustc"
> > +	depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
> > +	help
> > +	  Select the desired provider for the Rust compiler.
>
>  This help text is not relevant, should rather be something like "Compiler for
> the Rust language".

OK.

> > +
> > +	  http://www.rust-lang.org
> > +
> > +if BR2_PACKAGE_HOST_RUSTC
> > +
> > +choice
> > +	prompt "Rust compiler variant"
> > +	default BR2_PACKAGE_HOST_RUST_BIN
> > +	help
> > +	  Choose a provider for the Rust compiler.
> > +
> > +config BR2_PACKAGE_HOST_RUST_BIN
> > +	bool "host rust (pre-built)"
> > +	select BR2_PACKAGE_HAS_HOST_RUSTC
> > +	help
> > +	  This package will install pre-built versions of the compiler
> > +	  for the host and the Rust standard library for the target.
>
>  When rust-std{,-bin} becomes a separate package, I do think that it should be a
> hidden package, i.e. selected automatically when host-rust-bin is selected. So
> this help text is OK as it is even when rust-std-bin is a separate package.

If the standard library is to be split from rust-bin, then rust-bin
should be renamed to rustc-bin, as it will only install the binary
version of the Rust compiler.

The new package rust-std-bin should install the host standard library as
well as the target standard library (handling, of course, the case where
$(HOSTARCH) == $(ARCH)).

Some things are not clear to me, though:

- should rust-std-bin be a hidden package, or would it benefit the user
  to allow selecting it via menuconfig?
- if rust-std-bin is a hidden package, then rustc-bin should select it,
  right?
- as the rust package builds rustc and the standard library, should
  another virtual package named rust-std be added, with two providers
  rust-std-bin and rust? If such a package existed, then host-cargo
  would depend on host-rustc and host-rust-std.

--
ELB

  reply	other threads:[~2017-09-07 18:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-23  8:11 [Buildroot] [Patch v7 00/10] Add support for the Rust programming language Eric Le Bihan
2017-07-23  8:11 ` [Buildroot] [Patch v7 01/10] rustc: new virtual package Eric Le Bihan
2017-07-23 13:14   ` Jörg Krause
2017-08-10 22:34   ` Arnout Vandecappelle
2017-09-07 17:02     ` Eric Le Bihan
2017-07-23  8:11 ` [Buildroot] [Patch v7 02/10] rust-bin: new package Eric Le Bihan
2017-07-23 13:44   ` Jörg Krause
2017-07-23 14:00   ` Jörg Krause
2017-08-10 23:08   ` Arnout Vandecappelle
2017-09-07 18:13     ` Eric Le Bihan [this message]
2017-07-23  8:11 ` [Buildroot] [Patch v7 03/10] rustc: expose host variant in menuconfig Eric Le Bihan
2017-08-10 23:09   ` Arnout Vandecappelle
2017-07-23  8:12 ` [Buildroot] [Patch v7 04/10] rust-bootstrap: new package Eric Le Bihan
2017-08-10 23:13   ` Arnout Vandecappelle
2017-09-07 19:33     ` Eric Le Bihan
2017-07-23  8:12 ` [Buildroot] [Patch v7 05/10] cargo-bootstrap: " Eric Le Bihan
2017-07-23  8:12 ` [Buildroot] [Patch v7 06/10] rust: " Eric Le Bihan
2017-08-10 23:38   ` Arnout Vandecappelle
2017-09-07 19:58     ` Eric Le Bihan
2017-07-23  8:12 ` [Buildroot] [Patch v7 07/10] libssh2: add host variant Eric Le Bihan
2017-07-23  8:19   ` Baruch Siach
2017-08-10 23:40     ` Arnout Vandecappelle
2017-07-23  8:12 ` [Buildroot] [Patch v7 08/10] libhttpparser: " Eric Le Bihan
2017-08-10 23:41   ` Arnout Vandecappelle
2017-07-23  8:12 ` [Buildroot] [Patch v7 09/10] libcurl: " Eric Le Bihan
2017-08-10 23:45   ` Arnout Vandecappelle
2017-07-23  8:12 ` [Buildroot] [Patch v7 10/10] cargo: new package Eric Le Bihan
2017-08-10 23:58   ` Arnout Vandecappelle
2017-09-07 20:20     ` Eric Le Bihan
2017-08-10 23:59 ` [Buildroot] [Patch v7 00/10] Add support for the Rust programming language Arnout Vandecappelle
2017-09-07 20:22   ` Eric Le Bihan

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

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

  git send-email \
    --in-reply-to=20170907181357.GB6001@ned \
    --to=eric.le.bihan.dev@free.fr \
    --cc=buildroot@busybox.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.