Gentoo Archives: gentoo-commits

From: Doug Goldstein <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/files/, dev-lang/rust/
Date: Mon, 24 Oct 2016 05:27:53
Message-Id: 1477286837.d63d593dfdc5fb7dd1256663daac7b978aa892af.cardoe@gentoo
1 commit: d63d593dfdc5fb7dd1256663daac7b978aa892af
2 Author: Doug Goldstein <cardoe <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 24 05:26:05 2016 +0000
4 Commit: Doug Goldstein <cardoe <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 24 05:27:17 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d63d593d
7
8 dev-lang/rust: fix network-less builds
9
10 When building without a network connection or FEATURES=network-sandbox
11 the build would fail due to the build process reaching out to the
12 internet to fetch down some files that the package manager already got
13 for it. This neuters that network access and uses the existing files.
14
15 Signed-off-by: Doug Goldstein <cardoe <AT> gentoo.org>
16
17 .../rust-1.12.0-disable-fetching-stage0.patch | 36 ++++++++++++++++++++++
18 dev-lang/rust/rust-1.12.0.ebuild | 2 ++
19 dev-lang/rust/rust-1.12.1.ebuild | 2 ++
20 3 files changed, 40 insertions(+)
21
22 diff --git a/dev-lang/rust/files/rust-1.12.0-disable-fetching-stage0.patch b/dev-lang/rust/files/rust-1.12.0-disable-fetching-stage0.patch
23 new file mode 100644
24 index 00000000..14d0b32
25 --- /dev/null
26 +++ b/dev-lang/rust/files/rust-1.12.0-disable-fetching-stage0.patch
27 @@ -0,0 +1,36 @@
28 +From b6a4c78ef7b4bc6c32145f27e8a679d5baf36f90 Mon Sep 17 00:00:00 2001
29 +From: Doug Goldstein <cardoe@××××××.com>
30 +Date: Mon, 24 Oct 2016 00:01:37 -0500
31 +Subject: [PATCH] disable fetching stage0 and use whats there
32 +
33 +In Gentoo and Yocto alike we do not allow build environments network
34 +access and as a result the package manager is responsible for fetching
35 +down all the files necessary. In both they are configured to fetch down
36 +the compiler and unpack it and place the stage0 tarball inside of the
37 +'dl' directory for the build system to use. Unfortunately it
38 +unconditionally attempts to fetch down the files and ignores what is
39 +already available so this avoids that behavior and just uses what's in
40 +the 'dl' directory.
41 +
42 +Upstream-Status: Not upstreamable
43 +Signed-off-by: Doug Goldstein <cardoe@××××××.com>
44 +---
45 + src/etc/get-stage0.py | 2 +-
46 + 1 file changed, 1 insertion(+), 1 deletion(-)
47 +
48 +diff --git a/src/etc/get-stage0.py b/src/etc/get-stage0.py
49 +index 127251c..2889c07 100644
50 +--- a/src/etc/get-stage0.py
51 ++++ b/src/etc/get-stage0.py
52 +@@ -31,7 +31,7 @@ def main(triple):
53 + filename = 'rustc-{}-{}.tar.gz'.format(channel, triple)
54 + url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename)
55 + dst = dl_dir + '/' + filename
56 +- bootstrap.get(url, dst)
57 ++ #bootstrap.get(url, dst)
58 +
59 + stage0_dst = triple + '/stage0'
60 + if os.path.exists(stage0_dst):
61 +--
62 +2.7.3
63 +
64
65 diff --git a/dev-lang/rust/rust-1.12.0.ebuild b/dev-lang/rust/rust-1.12.0.ebuild
66 index ca00a6b..e608fbd 100644
67 --- a/dev-lang/rust/rust-1.12.0.ebuild
68 +++ b/dev-lang/rust/rust-1.12.0.ebuild
69 @@ -55,6 +55,8 @@ PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425"
70
71 S="${WORKDIR}/${MY_P}"
72
73 +PATCHES=("${FILESDIR}/rust-1.12.0-disable-fetching-stage0.patch")
74 +
75 src_unpack() {
76 unpack "rustc-${PV}-src.tar.gz" || die
77 mkdir "${MY_P}/dl" || die
78
79 diff --git a/dev-lang/rust/rust-1.12.1.ebuild b/dev-lang/rust/rust-1.12.1.ebuild
80 index ca00a6b..e608fbd 100644
81 --- a/dev-lang/rust/rust-1.12.1.ebuild
82 +++ b/dev-lang/rust/rust-1.12.1.ebuild
83 @@ -55,6 +55,8 @@ PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425"
84
85 S="${WORKDIR}/${MY_P}"
86
87 +PATCHES=("${FILESDIR}/rust-1.12.0-disable-fetching-stage0.patch")
88 +
89 src_unpack() {
90 unpack "rustc-${PV}-src.tar.gz" || die
91 mkdir "${MY_P}/dl" || die