13 |
# To bootstrap from scratch, set the channel and date from src/stage0.json |
# To bootstrap from scratch, set the channel and date from src/stage0.json |
14 |
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 |
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13 |
15 |
# or nightly wants some beta-YYYY-MM-DD |
# or nightly wants some beta-YYYY-MM-DD |
16 |
# Note that cargo matches the program version here, not its crate version. |
%global bootstrap_version 1.59.0 |
17 |
%global bootstrap_version 1.58.0 |
%global bootstrap_channel 1.59.0 |
18 |
%global bootstrap_channel 1.58.0 |
%global bootstrap_date 2022-02-24 |
|
%global bootstrap_date 2022-01-13 |
|
19 |
|
|
20 |
# Only the specified arches will use bootstrap binaries. |
# Only the specified arches will use bootstrap binaries. |
21 |
# NOTE: Those binaries used to be uploaded with every new release, but that was |
# NOTE: Those binaries used to be uploaded with every new release, but that was |
22 |
# a waste of lookaside cache space when they're most often unused. |
# a waste of lookaside cache space when they're most often unused. |
23 |
# Run "spectool -g rust.spec" after changing this and then "fedpkg upload" to |
# Run "spectool -g rust.spec" after changing this and then "fedpkg upload" to |
24 |
# add them to sources. Remember to remove them again after the bootstrap build! |
# add them to sources. Remember to remove them again after the bootstrap build! |
25 |
#global bootstrap_arches %%{rust_arches} |
#global bootstrap_arches %%{rust_arches} |
26 |
|
|
27 |
# To bootstrap a compiler for a Tier 2 platform, we first need to build a |
# To bootstrap a compiler for a Tier 2 platform, we first need to build a |
61 |
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM |
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM |
62 |
# is insufficient. Rust currently requires LLVM 12.0+. |
# is insufficient. Rust currently requires LLVM 12.0+. |
63 |
%global min_llvm_version 12.0.0 |
%global min_llvm_version 12.0.0 |
64 |
%global bundled_llvm_version 13.0.0 |
%global bundled_llvm_version 14.0.0 |
65 |
%bcond_with bundled_llvm |
%bcond_with bundled_llvm |
66 |
# (akien) Hacks below are needed on mga's buildsystem when we have to rebootstrap llvm. |
# (akien) Hacks below are needed on mga's buildsystem when we have to rebootstrap llvm. |
67 |
## Bundled LLVM has underlinking issues: |
## Bundled LLVM has underlinking issues: |
72 |
#%%endif |
#%%endif |
73 |
|
|
74 |
# Requires stable libgit2 1.3, and not the next minor soname change. |
# Requires stable libgit2 1.3, and not the next minor soname change. |
75 |
|
# This needs to be consistent with the bindings in vendor/libgit2-sys. |
76 |
%global min_libgit2_version 1.3.0 |
%global min_libgit2_version 1.3.0 |
77 |
%global next_libgit2_version 1.4.0~ |
%global next_libgit2_version 1.4.0~ |
78 |
%global bundled_libgit2_version 1.3.0 |
%global bundled_libgit2_version 1.3.0 |
110 |
%endif |
%endif |
111 |
|
|
112 |
Name: rust |
Name: rust |
113 |
Version: 1.59.0 |
Version: 1.60.0 |
114 |
Release: %mkrel 3 |
Release: %mkrel 1 |
115 |
Summary: The Rust Programming Language |
Summary: The Rust Programming Language |
116 |
%if 0%{?mageia} |
%if 0%{?mageia} |
117 |
Group: Development/Other |
Group: Development/Other |
135 |
|
|
136 |
# This regressed in 1.59, hanging builds on s390x, rhbz#2058803 |
# This regressed in 1.59, hanging builds on s390x, rhbz#2058803 |
137 |
# https://github.com/rust-lang/rust/pull/94505 |
# https://github.com/rust-lang/rust/pull/94505 |
138 |
Patch2: rust-pr94505-mono-item-sort-local.patch |
Patch2: rust-pr94505-mono-item-sort-local.patch |
139 |
|
|
140 |
|
# Clang 14 adds new builtin macros that wasi-libc doesn't expect yet |
141 |
|
# See https://github.com/WebAssembly/wasi-libc/pull/265 |
142 |
|
Patch3: wasi-libc-clang-14-compat.patch |
143 |
|
|
144 |
# (akien) Those tests fail on armv7 - on Fedora too, and jistone ignores them |
# (akien) Those tests fail on armv7 - on Fedora too, and jistone ignores them |
145 |
# https://github.com/rust-lang/rust/issues/83453 |
# https://github.com/rust-lang/rust/issues/83453 |
152 |
|
|
153 |
# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys |
# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys |
154 |
# will try to build it statically -- instead we turn off the feature. |
# will try to build it statically -- instead we turn off the feature. |
155 |
Patch101: rustc-1.59.0-disable-http2.patch |
Patch101: rustc-1.60.0-disable-http2.patch |
156 |
|
|
157 |
# kernel rh1410097 causes too-small stacks for PIE. |
# kernel rh1410097 causes too-small stacks for PIE. |
158 |
# (affects RHEL6 kernels when building for RHEL7) |
# (affects RHEL6 kernels when building for RHEL7) |
344 |
BuildRequires: mingw32-filesystem >= 95 |
BuildRequires: mingw32-filesystem >= 95 |
345 |
BuildRequires: mingw64-filesystem >= 95 |
BuildRequires: mingw64-filesystem >= 95 |
346 |
BuildRequires: mingw32-crt |
BuildRequires: mingw32-crt |
347 |
BuildRequires: mingw64-crt |
BuildRequires: mingw64-crt |
348 |
BuildRequires: mingw32-gcc |
BuildRequires: mingw32-gcc |
349 |
BuildRequires: mingw64-gcc |
BuildRequires: mingw64-gcc |
350 |
BuildRequires: mingw32-winpthreads-static |
BuildRequires: mingw32-winpthreads-static |
351 |
BuildRequires: mingw64-winpthreads-static |
BuildRequires: mingw64-winpthreads-static |
352 |
%endif |
%endif |
353 |
|
|
354 |
%if %defined wasm_targets |
%if %defined wasm_targets |
598 |
|
|
599 |
%if %defined wasm_targets |
%if %defined wasm_targets |
600 |
%setup -q -n %{wasi_libc_name} -T -b 1 |
%setup -q -n %{wasi_libc_name} -T -b 1 |
601 |
|
%patch3 -p1 |
602 |
%endif |
%endif |
603 |
|
|
604 |
%setup -q -n %{rustc_package} |
%setup -q -n %{rustc_package} |
709 |
ncpus="$max_cpus" |
ncpus="$max_cpus" |
710 |
fi |
fi |
711 |
|
|
|
%define target_config %{shrink: |
|
|
--set target.%{rust_triple}.linker=%{__cc} |
|
|
--set target.%{rust_triple}.cc=%{__cc} |
|
|
--set target.%{rust_triple}.cxx=%{__cxx} |
|
|
--set target.%{rust_triple}.ar=%{__ar} |
|
|
--set target.%{rust_triple}.ranlib=%{__ranlib} |
|
|
} |
|
|
|
|
712 |
%if %defined mingw_targets |
%if %defined mingw_targets |
713 |
%{lua: do |
%{lua: do |
714 |
local cfg = "" |
local cfg = "" |
717 |
triple = triple, |
triple = triple, |
718 |
mingw = string.find(rpm.expand("%{ix86}"), string.sub(triple, 1, 4)) and "mingw32" or "mingw64", |
mingw = string.find(rpm.expand("%{ix86}"), string.sub(triple, 1, 4)) and "mingw32" or "mingw64", |
719 |
} |
} |
720 |
local s = string.gsub([[%{shrink: |
local s = string.gsub([[ |
721 |
--set target.{{triple}}.linker=%{{{mingw}}_cc} |
--set target.{{triple}}.linker=%{{{mingw}}_cc} |
722 |
--set target.{{triple}}.cc=%{{{mingw}}_cc} |
--set target.{{triple}}.cc=%{{{mingw}}_cc} |
723 |
--set target.{{triple}}.ar=%{{{mingw}}_ar} |
--set target.{{triple}}.ar=%{{{mingw}}_ar} |
724 |
--set target.{{triple}}.ranlib=%{{{mingw}}_ranlib} |
--set target.{{triple}}.ranlib=%{{{mingw}}_ranlib} |
725 |
}]], "{{(%w+)}}", subs) |
]], "{{(%w+)}}", subs) |
726 |
cfg = cfg .. " " .. s |
cfg = cfg .. " " .. s |
727 |
end |
end |
728 |
|
cfg = string.gsub(cfg, "%s+", " ") |
729 |
rpm.define("mingw_target_config " .. cfg) |
rpm.define("mingw_target_config " .. cfg) |
730 |
end} |
end} |
731 |
%endif |
%endif |
747 |
%configure --disable-option-checking \ |
%configure --disable-option-checking \ |
748 |
--libdir=%{common_libdir} \ |
--libdir=%{common_libdir} \ |
749 |
--build=%{rust_triple} --host=%{rust_triple} --target=%{target_triple} \ |
--build=%{rust_triple} --host=%{rust_triple} --target=%{target_triple} \ |
750 |
%{target_config} \ |
--set target.%{target_triple}.linker=%{__cc} \ |
751 |
|
--set target.%{target_triple}.cc=%{__cc} \ |
752 |
|
--set target.%{target_triple}.cxx=%{__cxx} \ |
753 |
|
--set target.%{target_triple}.ar=%{__ar} \ |
754 |
|
--set target.%{target_triple}.ranlib=%{__ranlib} \ |
755 |
%{?mingw_target_config} \ |
%{?mingw_target_config} \ |
756 |
%{?wasm_target_config} \ |
%{?wasm_target_config} \ |
757 |
--python=%{__python3} \ |
--python=%{__python3} \ |
758 |
--local-rust-root=%{local_rust_root} \ |
--local-rust-root=%{local_rust_root} \ |
759 |
|
--set build.rustfmt=/bin/true \ |
760 |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ |
761 |
%{!?llvm_has_filecheck: --disable-codegen-tests} \ |
%{!?llvm_has_filecheck: --disable-codegen-tests} \ |
762 |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
871 |
env RUSTC=%{buildroot}%{_bindir}/rustc \ |
env RUSTC=%{buildroot}%{_bindir}/rustc \ |
872 |
LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ |
LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \ |
873 |
%{buildroot}%{_bindir}/cargo build --manifest-path build/hello-world/Cargo.toml --target=$triple |
%{buildroot}%{_bindir}/cargo build --manifest-path build/hello-world/Cargo.toml --target=$triple |
874 |
done |
done |
875 |
|
|
876 |
# The results are not stable on koji, so mask errors and just log it. |
# The results are not stable on koji, so mask errors and just log it. |
877 |
# Some of the larger test artifacts are manually cleaned to save space. |
# Some of the larger test artifacts are manually cleaned to save space. |