diff mbox

[v3,1/2] rust-bootstrap: new package

Message ID 1468533676-10894-2-git-send-email-eric.le.bihan.dev@free.fr
State Changes Requested
Headers show

Commit Message

Eric Le Bihan July 14, 2016, 10:01 p.m. UTC
This new package fetches a binary snapshot of the Rust compiler,
suitable for the host, in order to bootstrap the Rust compiler.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/rust-bootstrap/rust-bootstrap.hash |  3 +++
 package/rust-bootstrap/rust-bootstrap.mk   | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 package/rust-bootstrap/rust-bootstrap.hash
 create mode 100644 package/rust-bootstrap/rust-bootstrap.mk

Comments

Arnout Vandecappelle Oct. 16, 2016, 11:27 a.m. UTC | #1
On 15-07-16 00:01, Eric Le Bihan wrote:
> This new package fetches a binary snapshot of the Rust compiler,
> suitable for the host, in order to bootstrap the Rust compiler.

 Annoying that we have to bootstrap from binaries, but that's the way it is.

> 
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> ---
>  package/rust-bootstrap/rust-bootstrap.hash |  3 +++
>  package/rust-bootstrap/rust-bootstrap.mk   | 24 ++++++++++++++++++++++++
>  2 files changed, 27 insertions(+)
>  create mode 100644 package/rust-bootstrap/rust-bootstrap.hash
>  create mode 100644 package/rust-bootstrap/rust-bootstrap.mk
> 
> diff --git a/package/rust-bootstrap/rust-bootstrap.hash b/package/rust-bootstrap/rust-bootstrap.hash
> new file mode 100644
> index 0000000..0a21802
> --- /dev/null
> +++ b/package/rust-bootstrap/rust-bootstrap.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256 d0704d10237c66c3efafa6f7e5570c59a1d3fe5c6d99487540f90ebb37cd84c4 rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz
> +sha256 2951dec835827974d03c7aafbf2c969f39bb530e1c200fd46f90bc01772fae39 rustc-1.9.0-i686-unknown-linux-gnu.tar.gz
> diff --git a/package/rust-bootstrap/rust-bootstrap.mk b/package/rust-bootstrap/rust-bootstrap.mk
> new file mode 100644
> index 0000000..df5fb82
> --- /dev/null
> +++ b/package/rust-bootstrap/rust-bootstrap.mk
> @@ -0,0 +1,24 @@
> +################################################################################
> +#
> +# rust-bootstrap
> +#
> +################################################################################
> +
> +RUST_BOOTSTRAP_VERSION = 1.9.0
> +RUST_BOOTSTRAP_DATE = 2016-05-24
> +
> +ifeq ($(HOSTARCH),x86_64)
> +RUST_BOOTSTRAP_ARCH = x86_64
> +else ifeq ($(HOSTARCH),x86)
> +RUST_BOOTSTRAP_ARCH = i686
> +else
> +$(error Unsupported host architecture)

 This is not good because it is evaluated even if host-rust-bootstrap is not
selected. You need to protect it somehow, which is difficult because there is no
user visible symbol that can ever select this package. So instead you could do a
check in e.g. CONFIGURE_CMDS.

 However, this is not needed, because this package can only be built if rust is
built, and rust can only be built if BR2_PACKAGE_HOST_RUST_ARCH_SUPPORTS=y, and
that one already checks for hostarch.

 IOW, just drop this check.

> +endif
> +
> +RUST_BOOTSTRAP_SITE = https://static.rust-lang.org/dist/$(RUST_BOOTSTRAP_DATE)
> +
> +RUST_BOOTSTRAP_SOURCE = rustc-$(RUST_BOOTSTRAP_VERSION)-$(RUST_BOOTSTRAP_ARCH)-unknown-linux-gnu.tar.gz
> +RUST_BOOTSTRAP_LICENSE = Apache-2.0, MIT

 Can you specify which parts or under which license?

 Regards,
 Arnout

> +RUST_BOOTSTRAP_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
> +
> +$(eval $(host-generic-package))
>
Eric Le Bihan Oct. 18, 2016, 8:47 p.m. UTC | #2
Hi!

On 16-10-16 13:27:51, Arnout Vandecappelle wrote:
>
>
> On 15-07-16 00:01, Eric Le Bihan wrote:

[...]

> > +
> > +RUST_BOOTSTRAP_VERSION = 1.9.0
> > +RUST_BOOTSTRAP_DATE = 2016-05-24
> > +
> > +ifeq ($(HOSTARCH),x86_64)
> > +RUST_BOOTSTRAP_ARCH = x86_64
> > +else ifeq ($(HOSTARCH),x86)
> > +RUST_BOOTSTRAP_ARCH = i686
> > +else
> > +$(error Unsupported host architecture)
>
>  This is not good because it is evaluated even if host-rust-bootstrap is not
> selected. You need to protect it somehow, which is difficult because there is no
> user visible symbol that can ever select this package. So instead you could do a
> check in e.g. CONFIGURE_CMDS.
>
>  However, this is not needed, because this package can only be built if rust is
> built, and rust can only be built if BR2_PACKAGE_HOST_RUST_ARCH_SUPPORTS=y, and
> that one already checks for hostarch.
>
>  IOW, just drop this check.

OK.

> > +endif
> > +
> > +RUST_BOOTSTRAP_SITE = https://static.rust-lang.org/dist/$(RUST_BOOTSTRAP_DATE)
> > +
> > +RUST_BOOTSTRAP_SOURCE = rustc-$(RUST_BOOTSTRAP_VERSION)-$(RUST_BOOTSTRAP_ARCH)-unknown-linux-gnu.tar.gz
> > +RUST_BOOTSTRAP_LICENSE = Apache-2.0, MIT
>
>  Can you specify which parts or under which license?

Rust is dual licensed (Apache-2.0 OR MIT). So, I'll change it to:

RUST_BOOTSTRAP_LICENSE = Dual Apache-2.0/MIT

I'll do the same for the rust package.

Thanks for the review.

Best regards,

--
ELB
Arnout Vandecappelle Oct. 18, 2016, 10:09 p.m. UTC | #3
On 18-10-16 22:47, Eric Le Bihan wrote:
> Hi!
> 
> On 16-10-16 13:27:51, Arnout Vandecappelle wrote:
>>
>>
>> On 15-07-16 00:01, Eric Le Bihan wrote:
[snip]
>>> +RUST_BOOTSTRAP_LICENSE = Apache-2.0, MIT
>>
>>  Can you specify which parts or under which license?
> 
> Rust is dual licensed (Apache-2.0 OR MIT). So, I'll change it to:
> 
> RUST_BOOTSTRAP_LICENSE = Dual Apache-2.0/MIT

 No, it should be

RUST_BOOTSTRAP_LICENSE = Apache-2.0 or MIT

See the example in the manual under the generic package infra [1].


 Regards,
 Arnout

[1] https://buildroot.org/downloads/manual/manual.html#generic-package-reference

> 
> I'll do the same for the rust package.
> 
> Thanks for the review.
> 
> Best regards,
> 
> --
> ELB
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Eric Le Bihan Oct. 19, 2016, 6:17 a.m. UTC | #4
On 16-10-19 00:09:30, Arnout Vandecappelle wrote:
>
>
> On 18-10-16 22:47, Eric Le Bihan wrote:
> > Hi!
> >
> > On 16-10-16 13:27:51, Arnout Vandecappelle wrote:
> >>
> >>
> >> On 15-07-16 00:01, Eric Le Bihan wrote:
> [snip]
> >>> +RUST_BOOTSTRAP_LICENSE = Apache-2.0, MIT
> >>
> >>  Can you specify which parts or under which license?
> >
> > Rust is dual licensed (Apache-2.0 OR MIT). So, I'll change it to:
> >
> > RUST_BOOTSTRAP_LICENSE = Dual Apache-2.0/MIT
>
>  No, it should be
>
> RUST_BOOTSTRAP_LICENSE = Apache-2.0 or MIT
>
> See the example in the manual under the generic package infra [1].

Right. I should have read the manual instead of sampling packages.
The following ones currently use "FOO_LICENSE = Dual first/second":

- libsamplerate
- nettle
- freetype

I'll send a patch to make them compliant. Looking at the manual [1], I do
not see what should be used for "proprietary" or "commercial". So, for
libsamplerate, should I use "LIBSAMPLERATE_LICENSE = GPLv2+ or COMMERCIAL"?

[1] https://buildroot.org/downloads/manual/manual.html#legal-info-list-licenses

Best regards,

--
ELB
diff mbox

Patch

diff --git a/package/rust-bootstrap/rust-bootstrap.hash b/package/rust-bootstrap/rust-bootstrap.hash
new file mode 100644
index 0000000..0a21802
--- /dev/null
+++ b/package/rust-bootstrap/rust-bootstrap.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256 d0704d10237c66c3efafa6f7e5570c59a1d3fe5c6d99487540f90ebb37cd84c4 rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz
+sha256 2951dec835827974d03c7aafbf2c969f39bb530e1c200fd46f90bc01772fae39 rustc-1.9.0-i686-unknown-linux-gnu.tar.gz
diff --git a/package/rust-bootstrap/rust-bootstrap.mk b/package/rust-bootstrap/rust-bootstrap.mk
new file mode 100644
index 0000000..df5fb82
--- /dev/null
+++ b/package/rust-bootstrap/rust-bootstrap.mk
@@ -0,0 +1,24 @@ 
+################################################################################
+#
+# rust-bootstrap
+#
+################################################################################
+
+RUST_BOOTSTRAP_VERSION = 1.9.0
+RUST_BOOTSTRAP_DATE = 2016-05-24
+
+ifeq ($(HOSTARCH),x86_64)
+RUST_BOOTSTRAP_ARCH = x86_64
+else ifeq ($(HOSTARCH),x86)
+RUST_BOOTSTRAP_ARCH = i686
+else
+$(error Unsupported host architecture)
+endif
+
+RUST_BOOTSTRAP_SITE = https://static.rust-lang.org/dist/$(RUST_BOOTSTRAP_DATE)
+
+RUST_BOOTSTRAP_SOURCE = rustc-$(RUST_BOOTSTRAP_VERSION)-$(RUST_BOOTSTRAP_ARCH)-unknown-linux-gnu.tar.gz
+RUST_BOOTSTRAP_LICENSE = Apache-2.0, MIT
+RUST_BOOTSTRAP_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
+
+$(eval $(host-generic-package))