All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust
@ 2020-05-08 15:27 Romain Naour
  2020-05-16  2:35 ` Sam Voss
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Romain Naour @ 2020-05-08 15:27 UTC (permalink / raw)
  To: buildroot

As reported on bugzilla [1], the host-rust package fail when
the target architecture or the target libc is not supported.

The error is the following:
failed to parse TOML configuration 'config.toml': expected a table key, found a right bracket at line 15

In such case BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is
not set thus RUSTC_TARGET_NAME is also not set [2].

But RUSTC_TARGET_NAME is needed to generate the file config.toml [3]

Add BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS in the host-rust
dependency.

The commit [4] that allowed to select host-rust when the target
architecture or the target libc is not supported, should have
allowed to select only host-rustc-bin.

Fixes:
Bug #12691

[1] https://bugs.busybox.net/show_bug.cgi?id=12691
[2] https://git.buildroot.net/buildroot/tree/package/rustc/rustc.mk?h=2020.05-rc1#n10
[3] https://git.buildroot.net/buildroot/tree/package/rust/rust.mk?h=2020.05-rc1#n41
[4] 025b863e6facb7b219b82ee6ee7a7916c2c3c47e

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Sam Voss <sam.voss@gmail.com>
---
 package/rustc/Config.in.host | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
index d595efbc6f..1df25ae326 100644
--- a/package/rustc/Config.in.host
+++ b/package/rustc/Config.in.host
@@ -49,6 +49,9 @@ choice
 
 config BR2_PACKAGE_HOST_RUST
 	bool "host rust"
+	# RUSTC_TARGET_NAME must be set for building host-rust
+	# otherwise config.toml is broken.
+	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
 	# triggers ICE on trunc_int_for_mode, at explow.c:56
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_aarch64
 	help
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust
  2020-05-08 15:27 [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust Romain Naour
@ 2020-05-16  2:35 ` Sam Voss
  2020-05-17 19:30 ` Thomas Petazzoni
  2020-05-29 21:14 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Sam Voss @ 2020-05-16  2:35 UTC (permalink / raw)
  To: buildroot

Romain,

On Fri, May 8, 2020 at 10:27 AM Romain Naour <romain.naour@gmail.com> wrote:
>
> As reported on bugzilla [1], the host-rust package fail when
> the target architecture or the target libc is not supported.
>
> The error is the following:
> failed to parse TOML configuration 'config.toml': expected a table key, found a right bracket at line 15
>
> In such case BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is
> not set thus RUSTC_TARGET_NAME is also not set [2].
>
> But RUSTC_TARGET_NAME is needed to generate the file config.toml [3]
>
> Add BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS in the host-rust
> dependency.
>
> The commit [4] that allowed to select host-rust when the target
> architecture or the target libc is not supported, should have
> allowed to select only host-rustc-bin.

Thanks for fixing this, looks good to me.

>
> Fixes:
> Bug #12691
>
> [1] https://bugs.busybox.net/show_bug.cgi?id=12691
> [2] https://git.buildroot.net/buildroot/tree/package/rustc/rustc.mk?h=2020.05-rc1#n10
> [3] https://git.buildroot.net/buildroot/tree/package/rust/rust.mk?h=2020.05-rc1#n41
> [4] 025b863e6facb7b219b82ee6ee7a7916c2c3c47e
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>

Reviewed-by: Sam Voss <sam.voss@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust
  2020-05-08 15:27 [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust Romain Naour
  2020-05-16  2:35 ` Sam Voss
@ 2020-05-17 19:30 ` Thomas Petazzoni
  2020-05-29 21:14 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2020-05-17 19:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  8 May 2020 17:27:39 +0200
Romain Naour <romain.naour@gmail.com> wrote:

> As reported on bugzilla [1], the host-rust package fail when
> the target architecture or the target libc is not supported.
> 
> The error is the following:
> failed to parse TOML configuration 'config.toml': expected a table key, found a right bracket at line 15
> 
> In such case BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is
> not set thus RUSTC_TARGET_NAME is also not set [2].
> 
> But RUSTC_TARGET_NAME is needed to generate the file config.toml [3]
> 
> Add BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS in the host-rust
> dependency.
> 
> The commit [4] that allowed to select host-rust when the target
> architecture or the target libc is not supported, should have
> allowed to select only host-rustc-bin.
> 
> Fixes:
> Bug #12691
> 
> [1] https://bugs.busybox.net/show_bug.cgi?id=12691
> [2] https://git.buildroot.net/buildroot/tree/package/rustc/rustc.mk?h=2020.05-rc1#n10
> [3] https://git.buildroot.net/buildroot/tree/package/rust/rust.mk?h=2020.05-rc1#n41
> [4] 025b863e6facb7b219b82ee6ee7a7916c2c3c47e
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Sam Voss <sam.voss@gmail.com>
> ---
>  package/rustc/Config.in.host | 3 +++
>  1 file changed, 3 insertions(+)

I have applied to master, because it's the most obvious workaround, but
I'm not sure to be entirely happy about it.

Indeed, the whole point of commit
025b863e6facb7b219b82ee6ee7a7916c2c3c47e was to ensure we could use
Rust as a host-only tool, even when the target architecture is not
supported by rust. This would allow to support building some host tools
that are written in Rust.

This is properly supported by the host-rust-bin package, which does not
install the target Rust library when
BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is false.

Shouldn't the host-rust package be changed to also build just a host
compiler (without cross-compilation capabilities) ? Or is host-rust
anyway using host-rust-bin as the host compiler ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust
  2020-05-08 15:27 [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust Romain Naour
  2020-05-16  2:35 ` Sam Voss
  2020-05-17 19:30 ` Thomas Petazzoni
@ 2020-05-29 21:14 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2020-05-29 21:14 UTC (permalink / raw)
  To: buildroot

>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:

 > As reported on bugzilla [1], the host-rust package fail when
 > the target architecture or the target libc is not supported.

 > The error is the following:
 > failed to parse TOML configuration 'config.toml': expected a table key, found a right bracket at line 15

 > In such case BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS is
 > not set thus RUSTC_TARGET_NAME is also not set [2].

 > But RUSTC_TARGET_NAME is needed to generate the file config.toml [3]

 > Add BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS in the host-rust
 > dependency.

 > The commit [4] that allowed to select host-rust when the target
 > architecture or the target libc is not supported, should have
 > allowed to select only host-rustc-bin.

 > Fixes:
 > Bug #12691

 > [1] https://bugs.busybox.net/show_bug.cgi?id=12691
 > [2] https://git.buildroot.net/buildroot/tree/package/rustc/rustc.mk?h=2020.05-rc1#n10
 > [3] https://git.buildroot.net/buildroot/tree/package/rust/rust.mk?h=2020.05-rc1#n41
 > [4] 025b863e6facb7b219b82ee6ee7a7916c2c3c47e

 > Signed-off-by: Romain Naour <romain.naour@gmail.com>
 > Cc: Sam Voss <sam.voss@gmail.com>

Committed to 2020.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-29 21:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 15:27 [Buildroot] [PATCH] package/rustc: RUSTC_TARGET_NAME is needed to build host-rust Romain Naour
2020-05-16  2:35 ` Sam Voss
2020-05-17 19:30 ` Thomas Petazzoni
2020-05-29 21:14 ` Peter Korsgaard

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.