host-cargo: select host-rustc
PATCH v3 1/2 host-cargo: select host-rustc
Buildroot documentation specifies that cargo-based package should only depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS and selects BR2_PACKAGE_HOST_CARGO but this fails with the following error:
warning: (BR2_PACKAGE_LIBRSVG) selects BR2_PACKAGE_HOST_CARGO which has unmet direct dependencies (BR2_PACKAGE_HAS_HOST_RUSTC)
Indeed, host-cargo depends onBR2_PACKAGE_HAS_HOST_RUSTC which is selected only when host-rustc is selected.
So instead of having to select both cargo and rustc in each cargo-based package, replace BR2_PACKAGE_HAS_HOST_RUSTC dependency by BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS and select BR2_PACKAGE_HOST_RUSTC
---
Changes v2 -> v3 (after review of Thomas Petazzoni)
- Give more details on what does not work in commit log
package/cargo/Config.in.host | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/cargo/Config.in.host +2 -1
@@ -1,6 +1,7 @@ config BR2_PACKAGE_HOST_CARGO bool "host cargo" - depends on BR2_PACKAGE_HAS_HOST_RUSTC + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS + select BR2_PACKAGE_HOST_RUSTC help Cargo is the package manager for the Rust programming language.
Signature · 1 line
2.14.1
PATCH v3 2/2 librsvg: bump to version 2.42.5
- Add a dependency to host-cargo
- Add a patch to set RUST_TARGET
- Add a dependency to BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
- Forward this dependency to efl svg, enlightment, gst-plugins-bad and gst1-plugins-bad
- Add hash for license file
---
Changes v2 -> v3 (after review of Thomas Petazzoni)
- Put back select BR2_PACKAGE_HOST_CARGO in Config.in (even if it is not needed) as well as first patch
Changes v1 -> v2 (after review of Baruch Siach and Thomas Petazzoni):
- Remove unneeded select BR2_PACKAGE_HOST_CARGO from Config.in and so remove the first patch of the patch's serie
- Forward BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS to gst-plugins-bad and gst1-plugins-bad
package/efl/Config.in | 1 + package/enlightenment/Config.in | 2 + package/gstreamer/gst-plugins-bad/Config.in | 1 + package/gstreamer1/gst1-plugins-bad/Config.in | 1 + .../librsvg/0001-Add-RUST_TARGET-variable.patch | 57 ++++++++++++++++++++++ package/librsvg/Config.in | 3 ++ package/librsvg/librsvg.hash | 7 ++- package/librsvg/librsvg.mk | 12 +++-- 8 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 package/librsvg/0001-Add-RUST_TARGET-variable.patch
package/efl/Config.in +1 -0
@@ -289,6 +289,7 @@ config BR2_PACKAGE_EFL_LIBRAW config BR2_PACKAGE_EFL_SVG bool "SVG loader" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS # librsvg depends on BR2_TOOLCHAIN_HAS_SYNC_4 # librsvg -> pango -> harfbuzz select BR2_PACKAGE_LIBRSVG select BR2_PACKAGE_CAIRO
package/enlightenment/Config.in +2 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_ENLIGHTENMENT bool "enlightenment" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS # efl svg -> librsvg # libevas-generic-loaders-svg -> librsvg -> glib2 / pango depends on BR2_USE_WCHAR depends on BR2_INSTALL_LIBSTDCPP
@@ -29,6 +30,7 @@ config BR2_PACKAGE_ENLIGHTENMENT http://www.enlightenment.org/ comment "enlightenment needs udev /dev management and a toolchain w/ wchar, C++, threads" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS depends on BR2_PACKAGE_EFL && BR2_PACKAGE_XORG7 && BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \ !BR2_PACKAGE_HAS_UDEV
package/gstreamer/gst-plugins-bad/Config.in +1 -0
@@ -297,6 +297,7 @@ config BR2_PACKAGE_GST_PLUGINS_BAD_PLUGIN_OPUS config BR2_PACKAGE_GST_PLUGINS_BAD_PLUGIN_RSVG bool "rsvg" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS # librsvg depends on BR2_INSTALL_LIBSTDCPP # librsvg -> pango depends on BR2_TOOLCHAIN_HAS_SYNC_4 # librsvg -> pango -> harfbuzz select BR2_PACKAGE_LIBRSVG
package/gstreamer1/gst1-plugins-bad/Config.in +1 -0
@@ -643,6 +643,7 @@ config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_OPUS config BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_RSVG bool "rsvg" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS # librsvg depends on BR2_INSTALL_LIBSTDCPP # librsvg -> pango depends on BR2_TOOLCHAIN_HAS_SYNC_4 # librsvg -> pango -> harfbuzz select BR2_PACKAGE_LIBRSVG
package/librsvg/0001-Add-RUST_TARGET-variable.patch new file +57 -0
57 lines not on this page · raw message
package/librsvg/Config.in +3 -0
@@ -1,5 +1,6 @@ config BR2_PACKAGE_LIBRSVG bool "librsvg" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS depends on BR2_USE_WCHAR # glib2 depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 depends on BR2_USE_MMU # glib2
@@ -8,6 +9,7 @@ config BR2_PACKAGE_LIBRSVG select BR2_PACKAGE_CAIRO select BR2_PACKAGE_CAIRO_PNG select BR2_PACKAGE_GDK_PIXBUF + select BR2_PACKAGE_HOST_CARGO select BR2_PACKAGE_LIBCROCO select BR2_PACKAGE_LIBGLIB2 select BR2_PACKAGE_LIBXML2
@@ -19,6 +21,7 @@ config BR2_PACKAGE_LIBRSVG https://wiki.gnome.org/Projects/LibRsvg comment "librsvg needs a toolchain w/ wchar, threads, C++" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS depends on BR2_USE_MMU depends on BR2_TOOLCHAIN_HAS_SYNC_4 depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
package/librsvg/librsvg.hash +5 -2
@@ -1,2 +1,5 @@ -# From http://ftp.gnome.org/pub/gnome/sources/librsvg/2.40/librsvg-2.40.20.sha256sum -sha256 cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b librsvg-2.40.20.tar.xz +# From http://ftp.gnome.org/pub/gnome/sources/librsvg/2.42/librsvg-2.42.5.sha256sum +sha256 d4dd51a492a2022c07dec385e22947190fe70410928c471934ff3399f20935ec librsvg-2.42.5.tar.xz + +# Hash for license file: +sha256 d7bf9d064ac3e5840f9dd02422b7eeec4f1fd03f37fadbd043602be5e882304f COPYING.LIB
package/librsvg/librsvg.mk +8 -4
@@ -4,18 +4,22 @@ # ################################################################################ -LIBRSVG_VERSION_MAJOR = 2.40 -LIBRSVG_VERSION = $(LIBRSVG_VERSION_MAJOR).20 +LIBRSVG_VERSION_MAJOR = 2.42 +LIBRSVG_VERSION = $(LIBRSVG_VERSION_MAJOR).5 LIBRSVG_SITE = http://ftp.gnome.org/pub/gnome/sources/librsvg/$(LIBRSVG_VERSION_MAJOR) LIBRSVG_SOURCE = librsvg-$(LIBRSVG_VERSION).tar.xz LIBRSVG_INSTALL_STAGING = YES LIBRSVG_CONF_OPTS = --disable-pixbuf-loader --disable-tools --enable-introspection=no HOST_LIBRSVG_CONF_OPTS = --enable-introspection=no -LIBRSVG_DEPENDENCIES = cairo host-gdk-pixbuf gdk-pixbuf libcroco libglib2 libxml2 pango \ +LIBRSVG_DEPENDENCIES = cairo host-cargo host-gdk-pixbuf gdk-pixbuf libcroco libglib2 libxml2 pango \ $(if $(BR2_PACKAGE_LIBGTK3),libgtk3) -HOST_LIBRSVG_DEPENDENCIES = host-cairo host-gdk-pixbuf host-libcroco host-libglib2 host-libxml2 host-pango +HOST_LIBRSVG_DEPENDENCIES = host-cairo host-cargo host-gdk-pixbuf host-libcroco host-libglib2 host-libxml2 host-pango LIBRSVG_LICENSE = LGPL-2.0+ LIBRSVG_LICENSE_FILES = COPYING.LIB +# We're patching configure.ac +LIBRSVG_AUTORECONF = YES +LIBRSVG_CONF_ENV = RUST_TARGET=$(RUSTC_TARGET_NAME) + $(eval $(autotools-package)) $(eval $(host-autotools-package))
Signature · 1 line
2.14.1
PATCH v3 2/2 librsvg: bump to version 2.42.5
Hello,
Quoted 8 lines · Fabrice Fontaine
- Add a dependency to host-cargo
- Add a patch to setRUST_TARGET
- Add a dependency toBR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
- Forward this dependency to efl svg, enlightment, gst-plugins-bad and gst1-plugins-bad
- Add hash for license fileSigned-off-by Fabrice Fontaine <[email protected]>
I've applied, after fixing the gst-plugins-bad and gst1-plugins-bad packages, in which you forgot to propagate the new dependency to the existing Config.in comments.
Generally speaking, I find it a bit annoying that those packages start using Rust. Not because I have anything against Rust, but because:
(1) It limits the support to a much smaller set of architectures. For example, it is not longer possible to build librsvg or its reverse dependencies on ARMv5 platforms.
(2) It adds a fair amount of build time.
But well, if that's upstream decision, there's not much we can do against it.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 2/2 librsvg: bump to version 2.42.5
Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hello,
Quoted 8 lines · Fabrice Fontaine
- Add a dependency to host-cargo
- Add a patch to setRUST_TARGET
- Add a dependency toBR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
- Forward this dependency to efl svg, enlightment, gst-plugins-bad and gst1-plugins-bad
- Add hash for license fileSigned-off-by Fabrice Fontaine <[email protected]>I've applied, after fixing the gst-plugins-bad and gst1-plugins-bad packages, in which you forgot to propagate the new dependency to the existing Config.in comments.
Generally speaking, I find it a bit annoying that those packages start using Rust. Not because I have anything against Rust, but because:
Quoted 8 lines
(1) It limits the support to a much smaller set of architectures. For example, it is not longer possible to build librsvg or its reverse dependencies on ARMv5 platforms.
(2) It adds a fair amount of build time.
But well, if that's upstream decision, there's not much we can do against it.
This also causes a number of issues for host-librsvg (which is a dependency of libgtk3 and midori) when building for architectures not supported by rust:
http://autobuild.buildroot.net/?reason=host-rustc
Care to take a look at propagating these new dependencies here?
Signature · 1 line
Bye, Peter Korsgaard
PATCH v3 2/2 librsvg: bump to version 2.42.5
Dear Peter,
2018-06-12 8:58 GMT+02:00 Peter Korsgaard <[email protected]>:
Quoted 24 lines
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hello,
Quoted 8 lines · Fabrice Fontaine
- Add a dependency to host-cargo
- Add a patch to setRUST_TARGET
- Add a dependency toBR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
- Forward this dependency to efl svg, enlightment, gst-plugins-bad and gst1-plugins-bad
- Add hash for license fileSigned-off-by Fabrice Fontaine <[email protected]>I've applied, after fixing the gst-plugins-bad and gst1-plugins-bad packages, in which you forgot to propagate the new dependency to the existing Config.in comments.
Generally speaking, I find it a bit annoying that those packages start using Rust. Not because I have anything against Rust, but because:
(1) It limits the support to a much smaller set of architectures. For example, it is not longer possible to build librsvg or its reverse dependencies on ARMv5 platforms.
Quoted 9 lines
Quoted 4 lines
(2) It adds a fair amount of build time.
But well, if that's upstream decision, there's not much we can do against it.
This also causes a number of issues for host-librsvg (which is a dependency of libgtk3 and midori) when building for architectures not supported by rust:
The issue isn't related to libgtk3 and midori as this build fails (
http://autobuild.buildroot.net/results/f33/f335ed517b402c094ed3b10a3da4cdc23620dbd6/defconfig)
even if these packages are not selected.
I'm not an expert in virtual package but it seems we try to build host-rustc even if BR2_PACKAGE_HOST_RUSTC is not selected by the user (which is allowed).
The issue is that BR2_PACKAGE_PROVIDES_HOST_RUSTC is not defined if BR2_PACKAGE_HOST_RUSTC is not set (see rustc/Config.in.host). Moreover, we define it like this:
config BR2_PACKAGE_PROVIDES_HOST_RUSTC
string
default "host-rust" if BR2_PACKAGE_HOST_RUST default "host-rust-bin" if BR2_PACKAGE_HOST_RUST_BIN
As a result, if the user does not select host-rust or host-rust-bin, then there is no provider for host-rustc.
I would like your advice on this point, should we change this definition like this:
config BR2_PACKAGE_PROVIDES_HOST_RUSTC
string
default "host-rust" if BR2_PACKAGE_HOST_RUST
default "host-rust-bin" if !BR2_PACKAGE_HOST_RUST
or do you prefer:
config BR2_PACKAGE_PROVIDES_HOST_RUSTC
string
default "host-rust" if BR2_PACKAGE_HOST_RUST default "host-rust-bin" if BR2_PACKAGE_HOST_RUST_BIN default "host-rust-bin" if !BR2_PACKAGE_HOST_RUST ||
!BR2_PACKAGE_HOST_RUST
Indeed, HOST_RUST_BIN doesn't have any dependencies
Quoted 8 lines
http://autobuild.buildroot.net/?reason=host-rustc
Care to take a look at propagating these new dependencies here?
--
Bye, Peter Korsgaard
Best Regards,
Fabrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180612/5f989c6f/attachment.html>
PATCH v3 2/2 librsvg: bump to version 2.42.5
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
Hi,
Quoted 7 lines
Quoted 4 lines
This also causes a number of issues for host-librsvg (which is a dependency of libgtk3 and midori) when building for architectures not supported by rust:
The issue isn't related to libgtk3 and midori as this build fails (
http://autobuild.buildroot.net/results/f33/f335ed517b402c094ed3b10a3da4cdc23620dbd6/defconfig)
even if these packages are not selected.
It is a bit more tricky than that because it can also be about host-libgtk3. For this configuration it is adwaita-icon-theme which pulls in host-libgtk3 -> host-librsvg -> host-cargo -> host-rustc
Quoted 3 lines
I'm not an expert in virtual package but it seems we try to build host-rustc even if
BR2_PACKAGE_HOST_RUSTCis not selected by the user (which is allowed).
Indeed.
Quoted 11 lines
The issue is that
BR2_PACKAGE_PROVIDES_HOST_RUSTCis not defined ifBR2_PACKAGE_HOST_RUSTCis not set (see rustc/Config.in.host). Moreover, we define it like this:config
BR2_PACKAGE_PROVIDES_HOST_RUSTC
string
default "host-rust" ifBR2_PACKAGE_HOST_RUSTdefault "host-rust-bin" ifBR2_PACKAGE_HOST_RUST_BINAs a result, if the user does not select host-rust or host-rust-bin, then there is no provider for host-rustc.
But that is expected. host-rustc is a mix of a host utility and data specific to a target, so we really cannot use it if we are not on a supported host system AND building for a supported target.
Quoted 8 lines
config
BR2_PACKAGE_PROVIDES_HOST_RUSTC
string
default "host-rust" ifBR2_PACKAGE_HOST_RUSTdefault "host-rust-bin" ifBR2_PACKAGE_HOST_RUST_BINdefault "host-rust-bin" if !BR2_PACKAGE_HOST_RUST ||
!BR2_PACKAGE_HOST_RUSTIndeed,
HOST_RUST_BINdoesn't have any dependencies
It does, in the sense that it downloads the following files:
HOST_RUST_BIN_EXTRA_DOWNLOADS = \
rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz \
rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME).tar.xzAnd those files are only available for specific RUSTC_HOST_NAME and RUSTC_TARGET_NAME values.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v3 2/2 librsvg: bump to version 2.42.5
Hello,
Quoted 11 lines · Peter Korsgaard
Quoted 7 lines
Quoted 4 lines
This also causes a number of issues for host-librsvg (which is a dependency of libgtk3 and midori) when building for architectures not supported by rust:
The issue isn't related to libgtk3 and midori as this build fails (
http://autobuild.buildroot.net/results/f33/f335ed517b402c094ed3b10a3da4cdc23620dbd6/defconfig)
even if these packages are not selected.It is a bit more tricky than that because it can also be about host-libgtk3. For this configuration it is adwaita-icon-theme which pulls in host-libgtk3 -> host-librsvg -> host-cargo -> host-rustc
I think there is an issue in how we handle rust in fact. Indeed, the BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS option indicates if the Rust compiler is capable to act as a cross-compiler for the selected target.
But we haven't accounted for the fact that the Rust compiler can also do native builds, like it does for host-librsvg. In the case of native builds, we don't care whether Rust has support for the target
architecture: we care about it having support for the host architecture.
So basically, the fact that Rust is both a native compiler and a cross-compiler is not properly accounted today.
Perhaps we need to have two separate BR2_PACKAGE_HOST_RUSTC_something_ARCH_SUPPORTS options, to use depending on whether you need Rust support for the target, or Rust support for the host ?
Eric, what do you think ?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 2/2 librsvg: bump to version 2.42.5
In reply to Fabrice FontaineHello,
Quoted 7 lines · Fabrice Fontaine
- Add a dependency to host-cargo
- Add a patch to setRUST_TARGET
- Add a dependency toBR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
- Forward this dependency to efl svg, enlightment, gst-plugins-bad and gst1-plugins-bad
- Add hash for license file
Quoted 5 lines
Signed-off-by Fabrice Fontaine <[email protected]>---
Changes v2 -> v3 (after review of Thomas Petazzoni)
- Put back selectBR2_PACKAGE_HOST_CARGOin Config.in (even if it is not needed) as well as first patch
This commit was causing many build failures in the autobuilders, due to the Rust issue Peter and I have discussed in this thread. It's bit more than a month, and nobody stepped up to fix the Rust issues, so for now, the safe thing to do is to revert the librsvg bump.
I'll be happy to merge it again once the Rust issues are resolved.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
Thomas Petazzoni
AppliedPATCH v3 1/2 host-cargo: select host-rustc
In reply to Fabrice FontaineHello,
Quoted 16 lines · Fabrice Fontaine
Buildroot documentation specifies that cargo-based package should only depends on
BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTSand selectsBR2_PACKAGE_HOST_CARGObut this fails with the following error:warning: (
BR2_PACKAGE_LIBRSVG) selectsBR2_PACKAGE_HOST_CARGOwhich has unmet direct dependencies (BR2_PACKAGE_HAS_HOST_RUSTC)Indeed, host-cargo depends on
BR2_PACKAGE_HAS_HOST_RUSTCwhich is selected only when host-rustc is selected.So instead of having to select both cargo and rustc in each cargo-based package, replace
BR2_PACKAGE_HAS_HOST_RUSTCdependency byBR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTSand selectBR2_PACKAGE_HOST_RUSTC
Quoted 4 lines
Signed-off-by Fabrice Fontaine <[email protected]>---
Changes v2 -> v3 (after review of Thomas Petazzoni)
- Give more details on what does not work in commit log
Applied to master, thanks. I have also applied a follow-up patch that removes BR2_PACKAGE_HAS_HOST_RUSTC entirely, since it was no longer used anywhere.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com