From 4fcfb1e03f39b76106555cb31e0d4e4b755cbcb2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Dec 04 2016 07:23:46 +0000 Subject: Test 0.15.0 beta - Rewrite bootstrap logic to target specific arches. --- diff --git a/.gitignore b/.gitignore index 0de8f57..e754793 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,8 @@ /cargo-0.14.0.tar.gz /cargo-0.14.0-vendor.tar.xz /rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz +/cargo-8d6378421598cd5e0effc2216a3c5a4d9fc0f493.tar.gz +/cargo-0.15.0-vendor.tar.xz +/cargo-nightly-powerpc64le-unknown-linux-gnu.tar.gz +/cargo-nightly-powerpc64-unknown-linux-gnu.tar.gz +/cargo-nightly-s390x-unknown-linux-gnu.tar.gz diff --git a/cargo-0.14.0-release-num.patch b/cargo-0.14.0-release-num.patch deleted file mode 100644 index 9c23495..0000000 --- a/cargo-0.14.0-release-num.patch +++ /dev/null @@ -1,22 +0,0 @@ -From e035d532bf93b597216fcd11c99f2b8b6ba6eac1 Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Fri, 4 Nov 2016 15:44:46 -0700 -Subject: [PATCH] Update makefile to 0.14.0 - ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index 98d5e91c8053..08dc61626ee1 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -1,4 +1,4 @@ --CFG_RELEASE_NUM=0.13.0 -+CFG_RELEASE_NUM=0.14.0 - CFG_RELEASE_LABEL= - - OPENSSL_VERS=1.0.2j --- -1.8.3.1 - diff --git a/cargo.spec b/cargo.spec index 4ada517..d7ada82 100644 --- a/cargo.spec +++ b/cargo.spec @@ -1,29 +1,69 @@ +# Only x86_64 and i686 are Tier 1 platforms at this time. +# https://forge.rust-lang.org/platform-support.html +#global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x +%global rust_arches x86_64 i686 armv7hl aarch64 + # To bootstrap from scratch, set the date from src/snapshots.txt # e.g. 0.11.0 wants 2016-03-21 -%bcond_with bootstrap -%global bootstrap_date 2016-08-20 +%global bootstrap_date 2016-11-02 # (using a newer version than required to get vendor directories and more archs) +# Only the specified arches will use bootstrap binaries. +#global bootstrap_arches %%{rust_arches} +%global bootstrap_arches ppc64 ppc64le s390x + Name: cargo -Version: 0.14.0 -Release: 2%{?dist} +Version: 0.15.0 +Release: 0.1.beta%{?dist} Summary: Rust's package manager and build tool License: ASL 2.0 or MIT URL: https://crates.io/ +ExclusiveArch: %{rust_arches} -Source0: https://github.com/rust-lang/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +%global cargo_beta 8d6378421598cd5e0effc2216a3c5a4d9fc0f493 +Source0: https://github.com/rust-lang/%{name}/archive/%{cargo_beta}/%{name}-%{cargo_beta}.tar.gz +#Source0: https://github.com/rust-lang/%{name}/archive/%{version}/%{name}-%{version}.tar.gz # submodule, bundled for local installation only, not distributed %global rust_installer 4f994850808a572e2cc8d43f968893c8e942e9bf Source1: https://github.com/rust-lang/rust-installer/archive/%{rust_installer}/rust-installer-%{rust_installer}.tar.gz -%if %with bootstrap -%global bootstrap_dist https://static.rust-lang.org/cargo-dist -%global bootstrap_base %{bootstrap_dist}/%{bootstrap_date}/%{name}-nightly -Source10: %{bootstrap_base}-x86_64-unknown-linux-gnu.tar.gz -Source11: %{bootstrap_base}-i686-unknown-linux-gnu.tar.gz -Source12: %{bootstrap_base}-armv7-unknown-linux-gnueabihf.tar.gz -Source13: %{bootstrap_base}-aarch64-unknown-linux-gnu.tar.gz +# Get the Rust triple for any arch. +%{lua: function rust_triple(arch) + local abi = "gnu" + if arch == "armv7hl" then + arch = "armv7" + abi = "gnueabihf" + elseif arch == "ppc64" then + arch = "powerpc64" + elseif arch == "ppc64le" then + arch = "powerpc64le" + end + return arch.."-unknown-linux-"..abi +end} + +%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} + +%if %defined bootstrap_arches +# For each bootstrap arch, add an additional binary Source. +# Also define bootstrap_source just for the current target. +%{lua: do + local bootstrap_arches = {} + for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do + table.insert(bootstrap_arches, arch) + end + local base = rpm.expand("https://static.rust-lang.org/cargo-dist" + .."/%{bootstrap_date}/cargo-nightly") + local target_arch = rpm.expand("%{_target_cpu}") + for i, arch in ipairs(bootstrap_arches) do + i = i + 10 + print(string.format("Source%d: %s-%s.tar.gz\n", + i, base, rust_triple(arch))) + if arch == target_arch then + rpm.define("bootstrap_source "..i) + end + end +end} %endif # Use vendored crate dependencies so we can build offline. @@ -33,16 +73,6 @@ Source13: %{bootstrap_base}-aarch64-unknown-linux-gnu.tar.gz # FIXME: These should all eventually be packaged on their own! Source100: %{name}-%{version}-vendor.tar.xz -Patch1: cargo-0.14.0-release-num.patch - -# Only x86_64 and i686 are Tier 1 platforms at this time. -ExclusiveArch: x86_64 i686 armv7hl aarch64 -%ifarch armv7hl -%global rust_triple armv7-unknown-linux-gnueabihf -%else -%global rust_triple %{_target_cpu}-unknown-linux-gnu -%endif - BuildRequires: rust BuildRequires: make BuildRequires: cmake @@ -50,28 +80,22 @@ BuildRequires: gcc BuildRequires: python2 >= 2.7 BuildRequires: curl -%if %without bootstrap +%ifarch %{bootstrap_arches} +%global bootstrap_root cargo-nightly-%{rust_triple} +%global local_cargo %{_builddir}/%{bootstrap_root}/cargo/bin/cargo +%else BuildRequires: %{name} >= 0.13.0 %global local_cargo %{_bindir}/%{name} -%else -%global bootstrap_root cargo-nightly-%{rust_triple} -%global local_cargo %{_builddir}/%{name}-%{version}/%{bootstrap_root}/cargo/bin/cargo %endif # Indirect dependencies for vendored -sys crates above BuildRequires: libcurl-devel BuildRequires: libgit2-devel BuildRequires: libssh2-devel +BuildRequires: openssl-devel BuildRequires: zlib-devel BuildRequires: pkgconfig -%if 0%{?fedora} >= 26 -# https://bugzilla.redhat.com/show_bug.cgi?id=1383778 -BuildRequires: compat-openssl10-devel -%else -BuildRequires: openssl-devel -%endif - # Cargo is not much use without Rust Requires: rust @@ -81,17 +105,25 @@ and ensure that you'll always get a repeatable build. %prep -%setup -q -%patch1 -p1 -b .release-num +%ifarch %{bootstrap_arches} +%setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} +test -f '%{local_cargo}' +%endif + +# vendored crates +%setup -q -n %{name}-%{version}-vendor -T -b 100 + +# cargo sources +#setup -q +%setup -q -n %{name}-%{cargo_beta} # rust-installer -%setup -q -T -D -a 1 +#setup -q -T -D -a 1 +%setup -q -n %{name}-%{cargo_beta} -T -D -a 1 rmdir src/rust-installer mv rust-installer-%{rust_installer} src/rust-installer -# vendored crates -%setup -q -T -D -a 100 mkdir -p .cargo cat >.cargo/config < - 0.15.0-0.1.beta +- Test 0.15.0 beta +- Rewrite bootstrap logic to target specific arches. + * Sun Nov 13 2016 Josh Stone - 0.14.0-2 - Fix CFG_RELEASE_NUM diff --git a/sources b/sources index ef29596..e2b62e6 100644 --- a/sources +++ b/sources @@ -1,7 +1,3 @@ -d789a7785e37a1f299b24bc4b57f98ff cargo-0.14.0.tar.gz -11f4e5d2c0908e9644045ed643490a98 cargo-0.14.0-vendor.tar.xz -c7685ef02a5d8ef93f54cdfbc05db4cc cargo-nightly-aarch64-unknown-linux-gnu.tar.gz -4dc6b53822b0bbc7b8abaeda3023abb1 cargo-nightly-armv7-unknown-linux-gnueabihf.tar.gz -dfc61b5e3200b56fa8d10d89601b9461 cargo-nightly-i686-unknown-linux-gnu.tar.gz -49aee9014eadc64a5e9e386fe7981cf6 cargo-nightly-x86_64-unknown-linux-gnu.tar.gz +94b2587ae609ac75b5807f04d3dcbfa2 cargo-8d6378421598cd5e0effc2216a3c5a4d9fc0f493.tar.gz +b468e7e73a7fb10ad92972621ea8dd76 cargo-0.15.0-vendor.tar.xz a222edd3ab08779f527aafe862207027 rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz diff --git a/sources-bootstrap b/sources-bootstrap new file mode 100644 index 0000000..dd8a677 --- /dev/null +++ b/sources-bootstrap @@ -0,0 +1,10 @@ +94b2587ae609ac75b5807f04d3dcbfa2 cargo-8d6378421598cd5e0effc2216a3c5a4d9fc0f493.tar.gz +b468e7e73a7fb10ad92972621ea8dd76 cargo-0.15.0-vendor.tar.xz +ababc4969ad5153a15559e06c9569609 cargo-nightly-aarch64-unknown-linux-gnu.tar.gz +2ee726a791c60189c61d8412f4e9778f cargo-nightly-armv7-unknown-linux-gnueabihf.tar.gz +4ab57a9bcc53cddee074ce9f53c1b360 cargo-nightly-i686-unknown-linux-gnu.tar.gz +b868699c0e80696f683fd3c2bc743100 cargo-nightly-powerpc64le-unknown-linux-gnu.tar.gz +b7100472286d28632595df80b9d9971e cargo-nightly-powerpc64-unknown-linux-gnu.tar.gz +a4adb33f20be790d4f9d6a95418b6fb8 cargo-nightly-s390x-unknown-linux-gnu.tar.gz +c332f4eae49512a4c7cc969e2e99c8ba cargo-nightly-x86_64-unknown-linux-gnu.tar.gz +a222edd3ab08779f527aafe862207027 rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz