8931a1
# Only x86_64 and i686 are Tier 1 platforms at this time.
79456f
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
8931a1
%global rust_arches x86_64 i686 aarch64 ppc64le s390x
8931a1
8931a1
# The channel can be stable, beta, or nightly
8931a1
%{!?channel: %global channel stable}
8931a1
2e0a74
# To bootstrap from scratch, set the channel and date from src/stage0.json
6a704c
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
8931a1
# or nightly wants some beta-YYYY-MM-DD
5737f7
%global bootstrap_version 1.61.0
5737f7
%global bootstrap_channel 1.61.0
5737f7
%global bootstrap_date 2022-05-19
8931a1
8931a1
# Only the specified arches will use bootstrap binaries.
6a704c
# NOTE: Those binaries used to be uploaded with every new release, but that was
6a704c
# a waste of lookaside cache space when they're most often unused.
6a704c
# Run "spectool -g rust.spec" after changing this and then "fedpkg upload" to
6a704c
# add them to sources. Remember to remove them again after the bootstrap build!
8931a1
#global bootstrap_arches %%{rust_arches}
8931a1
601eff
# Define a space-separated list of targets to ship rust-std-static-$triple for
601eff
# cross-compilation. The packages are noarch, but they're not fully
601eff
# reproducible between hosts, so only x86_64 actually builds it.
0e66bb
#ifarch x86_64
0e66bb
# FIX: Except on RHEL8 modules, we can't filter a noarch package from shipping
0e66bb
# on certain arches, namely s390x for its lack of lld. So we need to make it an
0e66bb
# arch-specific package only for the supported arches.
0e66bb
%ifnarch s390x
2e0a74
%if 0%{?fedora}
2e0a74
%global mingw_targets i686-pc-windows-gnu x86_64-pc-windows-gnu
2e0a74
%endif
601eff
%if 0%{?fedora} || 0%{?rhel} >= 8
2e0a74
%global wasm_targets wasm32-unknown-unknown wasm32-wasi
601eff
%endif
601eff
%endif
601eff
bbd8b7
# We need CRT files for *-wasi targets, at least as new as the commit in
bbd8b7
# src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh
5737f7
# (updated per https://github.com/rust-lang/rust/pull/96907)
bbd8b7
%global wasi_libc_url https://github.com/WebAssembly/wasi-libc
5737f7
%global wasi_libc_commit 9886d3d6200fcc3726329966860fc058707406cd
bbd8b7
%global wasi_libc_name wasi-libc-%{wasi_libc_commit}
bbd8b7
%global wasi_libc_source %{wasi_libc_url}/archive/%{wasi_libc_commit}/%{wasi_libc_name}.tar.gz
bbd8b7
%global wasi_libc_dir %{_builddir}/%{wasi_libc_name}
bbd8b7
8931a1
# Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases.
8931a1
%bcond_with llvm_static
8931a1
8931a1
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
2e0a74
# is insufficient.  Rust currently requires LLVM 12.0+.
2e0a74
%global min_llvm_version 12.0.0
5737f7
%global bundled_llvm_version 14.0.4
8931a1
%bcond_with bundled_llvm
8931a1
5737f7
# Requires stable libgit2 1.4, and not the next minor soname change.
6a704c
# This needs to be consistent with the bindings in vendor/libgit2-sys.
5737f7
%global min_libgit2_version 1.4.0
5737f7
%global next_libgit2_version 1.5.0~
5737f7
%global bundled_libgit2_version 1.4.2
5737f7
%if 0%{?fedora} >= 99
c3bb10
%bcond_with bundled_libgit2
c3bb10
%else
8931a1
%bcond_without bundled_libgit2
c3bb10
%endif
8931a1
2e0a74
# needs libssh2_userauth_publickey_frommemory
2e0a74
%global min_libssh2_version 1.6.0
8931a1
%if 0%{?rhel}
c3bb10
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
8931a1
%bcond_without disabled_libssh2
8931a1
%else
c3bb10
%bcond_with disabled_libssh2
8931a1
%endif
8931a1
c3bb10
%if 0%{?rhel} && 0%{?rhel} < 8
c3bb10
%bcond_with curl_http2
8931a1
%else
c3bb10
%bcond_without curl_http2
c3bb10
%endif
c3bb10
c3bb10
# LLDB isn't available everywhere...
c3bb10
%if 0%{?rhel} && 0%{?rhel} < 8
8931a1
%bcond_with lldb
c3bb10
%else
c3bb10
%bcond_without lldb
8931a1
%endif
8931a1
8931a1
Name:           rust
5737f7
Version:        1.62.1
2e0a74
Release:        1%{?dist}
8931a1
Summary:        The Rust Programming Language
8931a1
License:        (ASL 2.0 or MIT) and (BSD and MIT)
8931a1
# ^ written as: (rust itself) and (bundled libraries)
8931a1
URL:            https://www.rust-lang.org
8931a1
ExclusiveArch:  %{rust_arches}
8931a1
8931a1
%if "%{channel}" == "stable"
8931a1
%global rustc_package rustc-%{version}-src
8931a1
%else
8931a1
%global rustc_package rustc-%{channel}-src
8931a1
%endif
8931a1
Source0:        https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
bbd8b7
Source1:        %{wasi_libc_source}
bbd8b7
# Sources for bootstrap_arches are inserted by lua below
8931a1
601eff
# By default, rust tries to use "rust-lld" as a linker for WebAssembly.
2e0a74
Patch1:         0001-Use-lld-provided-by-system-for-wasm.patch
601eff
5737f7
# Set a substitute-path in rust-gdb for standard library sources.
5737f7
Patch2:         rustc-1.61.0-rust-gdb-substitute-path.patch
6a704c
c3bb10
### RHEL-specific patches below ###
c3bb10
5737f7
# Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
5737f7
Source100:      macros.rust-toolset
5737f7
c3bb10
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
6a704c
Patch100:       rustc-1.59.0-disable-libssh2.patch
c3bb10
c3bb10
# libcurl on RHEL7 doesn't have http2, but since cargo requests it, curl-sys
c3bb10
# will try to build it statically -- instead we turn off the feature.
5737f7
Patch101:       rustc-1.62.0-disable-http2.patch
c3bb10
c3bb10
# kernel rh1410097 causes too-small stacks for PIE.
c3bb10
# (affects RHEL6 kernels when building for RHEL7)
2e0a74
Patch102:       rustc-1.58.0-no-default-pie.patch
2e0a74
9beef6
8931a1
# Get the Rust triple for any arch.
8931a1
%{lua: function rust_triple(arch)
8931a1
  local abi = "gnu"
8931a1
  if arch == "armv7hl" then
8931a1
    arch = "armv7"
8931a1
    abi = "gnueabihf"
8931a1
  elseif arch == "ppc64" then
8931a1
    arch = "powerpc64"
8931a1
  elseif arch == "ppc64le" then
8931a1
    arch = "powerpc64le"
c3bb10
  elseif arch == "riscv64" then
c3bb10
    arch = "riscv64gc"
8931a1
  end
8931a1
  return arch.."-unknown-linux-"..abi
8931a1
end}
8931a1
8931a1
%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))}
8931a1
8931a1
%if %defined bootstrap_arches
8931a1
# For each bootstrap arch, add an additional binary Source.
8931a1
# Also define bootstrap_source just for the current target.
8931a1
%{lua: do
8931a1
  local bootstrap_arches = {}
8931a1
  for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do
8931a1
    table.insert(bootstrap_arches, arch)
8931a1
  end
6a704c
  local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}")
6a704c
  local channel = rpm.expand("%{bootstrap_channel}")
8931a1
  local target_arch = rpm.expand("%{_target_cpu}")
8931a1
  for i, arch in ipairs(bootstrap_arches) do
5737f7
    i = 1000 + i * 3
6a704c
    local suffix = channel.."-"..rust_triple(arch)
6a704c
    print(string.format("Source%d: %s/cargo-%s.tar.xz\n", i, base, suffix))
6a704c
    print(string.format("Source%d: %s/rustc-%s.tar.xz\n", i+1, base, suffix))
6a704c
    print(string.format("Source%d: %s/rust-std-%s.tar.xz\n", i+2, base, suffix))
8931a1
    if arch == target_arch then
6a704c
      rpm.define("bootstrap_source_cargo "..i)
6a704c
      rpm.define("bootstrap_source_rustc "..i+1)
6a704c
      rpm.define("bootstrap_source_std "..i+2)
6a704c
      rpm.define("bootstrap_suffix "..suffix)
8931a1
    end
8931a1
  end
8931a1
end}
8931a1
%endif
8931a1
8931a1
%ifarch %{bootstrap_arches}
6a704c
%global local_rust_root %{_builddir}/rust-%{bootstrap_suffix}
6a704c
Provides:       bundled(%{name}-bootstrap) = %{bootstrap_version}
8931a1
%else
6a704c
BuildRequires:  cargo >= %{bootstrap_version}
c3bb10
%if 0%{?rhel} && 0%{?rhel} < 8
6a704c
BuildRequires:  %{name} >= %{bootstrap_version}
8931a1
BuildConflicts: %{name} > %{version}
c3bb10
%else
6a704c
BuildRequires:  (%{name} >= %{bootstrap_version} with %{name} <= %{version})
8931a1
%endif
8931a1
%global local_rust_root %{_prefix}
8931a1
%endif
8931a1
8931a1
BuildRequires:  make
8931a1
BuildRequires:  gcc
8931a1
BuildRequires:  gcc-c++
8931a1
BuildRequires:  ncurses-devel
c3bb10
# explicit curl-devel to avoid httpd24-curl (rhbz1540167)
c3bb10
BuildRequires:  curl-devel
8931a1
BuildRequires:  pkgconfig(libcurl)
8931a1
BuildRequires:  pkgconfig(liblzma)
8931a1
BuildRequires:  pkgconfig(openssl)
8931a1
BuildRequires:  pkgconfig(zlib)
8931a1
2e0a74
%if %{without bundled_libgit2}
6a704c
BuildRequires:  (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(libgit2) < %{next_libgit2_version})
8931a1
%endif
8931a1
79456f
%if %{without disabled_libssh2}
2e0a74
BuildRequires:  pkgconfig(libssh2) >= %{min_libssh2_version}
8931a1
%endif
8931a1
2e0a74
%if 0%{?rhel} == 8
2e0a74
BuildRequires:  platform-python
2e0a74
%else
2e0a74
BuildRequires:  python3
2e0a74
%endif
2e0a74
BuildRequires:  python3-rpm-macros
8931a1
8931a1
%if %with bundled_llvm
c74a88
BuildRequires:  cmake3 >= 3.13.4
bbd8b7
BuildRequires:  ninja-build
2e0a74
Provides:       bundled(llvm) = %{bundled_llvm_version}
8931a1
%else
8931a1
BuildRequires:  cmake >= 2.8.11
c3bb10
%if 0%{?epel} == 7
2e0a74
%global llvm llvm13
8931a1
%endif
8931a1
%if %defined llvm
8931a1
%global llvm_root %{_libdir}/%{llvm}
8931a1
%else
8931a1
%global llvm llvm
8931a1
%global llvm_root %{_prefix}
8931a1
%endif
2e0a74
BuildRequires:  %{llvm}-devel >= %{min_llvm_version}
8931a1
%if %with llvm_static
8931a1
BuildRequires:  %{llvm}-static
8931a1
BuildRequires:  libffi-devel
8931a1
%endif
8931a1
%endif
8931a1
2e0a74
# make check needs "ps" for src/test/ui/wait-forked-but-failed-child.rs
8931a1
BuildRequires:  procps-ng
8931a1
8931a1
# debuginfo-gdb tests need gdb
8931a1
BuildRequires:  gdb
8931a1
5737f7
# For src/test/run-make/static-pie
5737f7
BuildRequires:  glibc-static
5737f7
8931a1
# Virtual provides for folks who attempt "dnf install rustc"
8931a1
Provides:       rustc = %{version}-%{release}
8931a1
Provides:       rustc%{?_isa} = %{version}-%{release}
8931a1
8931a1
# Always require our exact standard library
8931a1
Requires:       %{name}-std-static%{?_isa} = %{version}-%{release}
8931a1
8931a1
# The C compiler is needed at runtime just for linking.  Someday rustc might
8931a1
# invoke the linker directly, and then we'll only need binutils.
8931a1
# https://github.com/rust-lang/rust/issues/11937
8931a1
Requires:       /usr/bin/cc
8931a1
601eff
%if 0%{?epel} == 7
601eff
%global devtoolset_name devtoolset-9
2e0a74
BuildRequires:  %{devtoolset_name}-binutils
601eff
BuildRequires:  %{devtoolset_name}-gcc
601eff
BuildRequires:  %{devtoolset_name}-gcc-c++
2e0a74
%global devtoolset_bindir /opt/rh/%{devtoolset_name}/root/usr/bin
2e0a74
%global __cc     %{devtoolset_bindir}/gcc
2e0a74
%global __cxx    %{devtoolset_bindir}/g++
2e0a74
%global __ar     %{devtoolset_bindir}/ar
2e0a74
%global __ranlib %{devtoolset_bindir}/ranlib
2e0a74
%global __strip  %{devtoolset_bindir}/strip
2e0a74
%else
2e0a74
%global __ranlib %{_bindir}/ranlib
601eff
%endif
601eff
8931a1
# ALL Rust libraries are private, because they don't keep an ABI.
8931a1
%global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.*
8931a1
%global __provides_exclude ^(%{_privatelibs})$
8931a1
%global __requires_exclude ^(%{_privatelibs})$
8931a1
%global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
8931a1
%global __requires_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$
8931a1
8931a1
# While we don't want to encourage dynamic linking to Rust shared libraries, as
8931a1
# there's no stable ABI, we still need the unallocated metadata (.rustc) to
c3bb10
# support custom-derive plugins like #[proc_macro_derive(Foo)].
c3bb10
%if 0%{?rhel} && 0%{?rhel} < 8
c3bb10
# eu-strip is very eager by default, so we have to limit it to -g, only debugging symbols.
8931a1
%global _find_debuginfo_opts -g
8931a1
%undefine _include_minidebuginfo
c3bb10
%else
c3bb10
# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997
c3bb10
%global _find_debuginfo_opts --keep-section .rustc
8931a1
%endif
8931a1
8931a1
%if %{without bundled_llvm}
8931a1
%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1}
8931a1
%global llvm_has_filecheck 1
8931a1
%endif
8931a1
%endif
8931a1
601eff
# We're going to override --libdir when configuring to get rustlib into a
601eff
# common path, but we'll fix the shared libraries during install.
601eff
%global common_libdir %{_prefix}/lib
601eff
%global rustlibdir %{common_libdir}/rustlib
601eff
2e0a74
%if %defined mingw_targets
2e0a74
BuildRequires:  mingw32-filesystem >= 95
2e0a74
BuildRequires:  mingw64-filesystem >= 95
6a704c
BuildRequires:  mingw32-crt
6a704c
BuildRequires:  mingw64-crt
2e0a74
BuildRequires:  mingw32-gcc
2e0a74
BuildRequires:  mingw64-gcc
6a704c
BuildRequires:  mingw32-winpthreads-static
6a704c
BuildRequires:  mingw64-winpthreads-static
2e0a74
%endif
2e0a74
2e0a74
%if %defined wasm_targets
bbd8b7
BuildRequires:  clang
6a704c
BuildRequires:  lld
601eff
# brp-strip-static-archive breaks the archive index for wasm
601eff
%global __os_install_post \
601eff
%__os_install_post \
6a704c
find '%{buildroot}%{rustlibdir}'/wasm*/lib -type f -regex '.*\\.\\(a\\|rlib\\)' -print -exec '%{llvm_root}/bin/llvm-ranlib' '{}' ';' \
601eff
%{nil}
601eff
%endif
601eff
8931a1
%description
8931a1
Rust is a systems programming language that runs blazingly fast, prevents
8931a1
segfaults, and guarantees thread safety.
8931a1
8931a1
This package includes the Rust compiler and documentation generator.
8931a1
8931a1
8931a1
%package std-static
8931a1
Summary:        Standard library for Rust
2e0a74
Requires:       %{name} = %{version}-%{release}
2e0a74
Requires:       glibc-devel%{?_isa} >= 2.11
8931a1
8931a1
%description std-static
8931a1
This package includes the standard libraries for building applications
8931a1
written in Rust.
8931a1
2e0a74
%if %defined mingw_targets
601eff
%{lua: do
2e0a74
  for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do
601eff
    local subs = {
601eff
      triple = triple,
2e0a74
      name = rpm.expand("%{name}"),
2e0a74
      verrel = rpm.expand("%{version}-%{release}"),
2e0a74
      mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64",
2e0a74
    }
2e0a74
    local s = string.gsub([[
2e0a74
2e0a74
%package std-static-{{triple}}
2e0a74
Summary:        Standard library for Rust {{triple}}
2e0a74
BuildArch:      noarch
2e0a74
Provides:       {{mingw}}-rust = {{verrel}}
2e0a74
Provides:       {{mingw}}-rustc = {{verrel}}
2e0a74
Requires:       {{mingw}}-crt
2e0a74
Requires:       {{mingw}}-gcc
2e0a74
Requires:       {{mingw}}-winpthreads-static
2e0a74
Requires:       {{name}} = {{verrel}}
2e0a74
2e0a74
%description std-static-{{triple}}
2e0a74
This package includes the standard libraries for building applications
2e0a74
written in Rust for the MinGW target {{triple}}.
2e0a74
2e0a74
]], "{{(%w+)}}", subs)
2e0a74
    print(s)
2e0a74
  end
2e0a74
end}
2e0a74
%endif
2e0a74
2e0a74
%if %defined wasm_targets
2e0a74
%{lua: do
2e0a74
  for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do
2e0a74
    local subs = {
2e0a74
      triple = triple,
2e0a74
      name = rpm.expand("%{name}"),
bbd8b7
      verrel = rpm.expand("%{version}-%{release}"),
bbd8b7
      wasi = string.find(triple, "-wasi") and 1 or 0,
601eff
    }
601eff
    local s = string.gsub([[
bbd8b7
601eff
%package std-static-{{triple}}
2e0a74
Summary:        Standard library for Rust {{triple}}
0e66bb
# FIX: we can't be noarch while excluding s390x for lack of lld
0e66bb
# BuildArch:      noarch
2e0a74
Requires:       {{name}} = {{verrel}}
bbd8b7
Requires:       lld >= 8.0
bbd8b7
%if {{wasi}}
bbd8b7
Provides:       bundled(wasi-libc)
bbd8b7
%endif
601eff
601eff
%description std-static-{{triple}}
601eff
This package includes the standard libraries for building applications
2e0a74
written in Rust for the WebAssembly target {{triple}}.
bbd8b7
601eff
]], "{{(%w+)}}", subs)
601eff
    print(s)
601eff
  end
601eff
end}
601eff
%endif
601eff
8931a1
8931a1
%package debugger-common
8931a1
Summary:        Common debugger pretty printers for Rust
8931a1
BuildArch:      noarch
8931a1
8931a1
%description debugger-common
8931a1
This package includes the common functionality for %{name}-gdb and %{name}-lldb.
8931a1
8931a1
8931a1
%package gdb
8931a1
Summary:        GDB pretty printers for Rust
8931a1
BuildArch:      noarch
8931a1
Requires:       gdb
8931a1
Requires:       %{name}-debugger-common = %{version}-%{release}
8931a1
8931a1
%description gdb
8931a1
This package includes the rust-gdb script, which allows easier debugging of Rust
8931a1
programs.
8931a1
8931a1
8931a1
%if %with lldb
8931a1
8931a1
%package lldb
8931a1
Summary:        LLDB pretty printers for Rust
8931a1
BuildArch:      noarch
8931a1
Requires:       lldb
2e0a74
Requires:       python3-lldb
8931a1
Requires:       %{name}-debugger-common = %{version}-%{release}
8931a1
8931a1
%description lldb
8931a1
This package includes the rust-lldb script, which allows easier debugging of Rust
8931a1
programs.
8931a1
8931a1
%endif
8931a1
8931a1
8931a1
%package doc
8931a1
Summary:        Documentation for Rust
8931a1
# NOT BuildArch:      noarch
8931a1
# Note, while docs are mostly noarch, some things do vary by target_arch.
8931a1
# Koji will fail the build in rpmdiff if two architectures build a noarch
8931a1
# subpackage differently, so instead we have to keep its arch.
8931a1
8931a1
%description doc
8931a1
This package includes HTML documentation for the Rust programming language and
8931a1
its standard library.
8931a1
8931a1
8931a1
%package -n cargo
8931a1
Summary:        Rust's package manager and build tool
8931a1
%if %with bundled_libgit2
2e0a74
Provides:       bundled(libgit2) = %{bundled_libgit2_version}
8931a1
%endif
8931a1
# For tests:
2e0a74
BuildRequires:  git-core
8931a1
# Cargo is not much use without Rust
2e0a74
Requires:       %{name}
8931a1
8931a1
# "cargo vendor" is a builtin command starting with 1.37.  The Obsoletes and
8931a1
# Provides are mostly relevant to RHEL, but harmless to have on Fedora/etc. too
8931a1
Obsoletes:      cargo-vendor <= 0.1.23
8931a1
Provides:       cargo-vendor = %{version}-%{release}
8931a1
8931a1
%description -n cargo
8931a1
Cargo is a tool that allows Rust projects to declare their various dependencies
8931a1
and ensure that you'll always get a repeatable build.
8931a1
8931a1
8931a1
%package -n cargo-doc
8931a1
Summary:        Documentation for Cargo
8931a1
BuildArch:      noarch
8931a1
# Cargo no longer builds its own documentation
8931a1
# https://github.com/rust-lang/cargo/pull/4904
2e0a74
Requires:       %{name}-doc = %{version}-%{release}
8931a1
8931a1
%description -n cargo-doc
8931a1
This package includes HTML documentation for Cargo.
8931a1
8931a1
8931a1
%package -n rustfmt
8931a1
Summary:        Tool to find and fix Rust formatting issues
8931a1
Requires:       cargo
8931a1
8931a1
# The component/package was rustfmt-preview until Rust 1.31.
8931a1
Obsoletes:      rustfmt-preview < 1.0.0
8931a1
Provides:       rustfmt-preview = %{version}-%{release}
8931a1
8931a1
%description -n rustfmt
8931a1
A tool for formatting Rust code according to style guidelines.
8931a1
8931a1
8931a1
%package -n rls
8931a1
Summary:        Rust Language Server for IDE integration
8931a1
%if %with bundled_libgit2
2e0a74
Provides:       bundled(libgit2) = %{bundled_libgit2_version}
8931a1
%endif
2e0a74
Requires:       %{name}-analysis
8931a1
# /usr/bin/rls is dynamically linked against internal rustc libs
8931a1
Requires:       %{name}%{?_isa} = %{version}-%{release}
8931a1
8931a1
# The component/package was rls-preview until Rust 1.31.
8931a1
Obsoletes:      rls-preview < 1.31.6
8931a1
Provides:       rls-preview = %{version}-%{release}
8931a1
8931a1
%description -n rls
8931a1
The Rust Language Server provides a server that runs in the background,
8931a1
providing IDEs, editors, and other tools with information about Rust programs.
8931a1
It supports functionality such as 'goto definition', symbol search,
8931a1
reformatting, and code completion, and enables renaming and refactorings.
8931a1
8931a1
8931a1
%package -n clippy
8931a1
Summary:        Lints to catch common mistakes and improve your Rust code
8931a1
Requires:       cargo
8931a1
# /usr/bin/clippy-driver is dynamically linked against internal rustc libs
8931a1
Requires:       %{name}%{?_isa} = %{version}-%{release}
8931a1
8931a1
# The component/package was clippy-preview until Rust 1.31.
8931a1
Obsoletes:      clippy-preview <= 0.0.212
8931a1
Provides:       clippy-preview = %{version}-%{release}
8931a1
8931a1
%description -n clippy
8931a1
A collection of lints to catch common mistakes and improve your Rust code.
8931a1
8931a1
8931a1
%package src
8931a1
Summary:        Sources for the Rust standard library
8931a1
BuildArch:      noarch
8931a1
8931a1
%description src
8931a1
This package includes source files for the Rust standard library.  It may be
8931a1
useful as a reference for code completion tools in various editors.
8931a1
8931a1
8931a1
%package analysis
8931a1
Summary:        Compiler analysis data for the Rust standard library
2e0a74
Requires:       %{name}-std-static%{?_isa} = %{version}-%{release}
8931a1
8931a1
%description analysis
8931a1
This package contains analysis data files produced with rustc's -Zsave-analysis
8931a1
feature for the Rust standard library. The RLS (Rust Language Server) uses this
8931a1
data to provide information about the Rust standard library.
8931a1
8931a1
5737f7
%if 0%{?rhel} && 0%{?rhel} >= 8
5737f7
5737f7
%package toolset
5737f7
Summary:        Rust Toolset
5737f7
Requires:       rust%{?_isa} = %{version}-%{release}
5737f7
Requires:       cargo%{?_isa} = %{version}-%{release}
5737f7
5737f7
%description toolset
5737f7
This is the metapackage for Rust Toolset, bringing in the Rust compiler,
5737f7
the Cargo package manager, and a few convenience macros for rpm builds.
5737f7
5737f7
%endif
5737f7
5737f7
8931a1
%prep
8931a1
8931a1
%ifarch %{bootstrap_arches}
6a704c
rm -rf %{local_rust_root}
6a704c
%setup -q -n cargo-%{bootstrap_suffix} -T -b %{bootstrap_source_cargo}
6a704c
./install.sh --prefix=%{local_rust_root} --disable-ldconfig
6a704c
%setup -q -n rustc-%{bootstrap_suffix} -T -b %{bootstrap_source_rustc}
6a704c
./install.sh --prefix=%{local_rust_root} --disable-ldconfig
6a704c
%setup -q -n rust-std-%{bootstrap_suffix} -T -b %{bootstrap_source_std}
6a704c
./install.sh --prefix=%{local_rust_root} --disable-ldconfig
8931a1
test -f '%{local_rust_root}/bin/cargo'
8931a1
test -f '%{local_rust_root}/bin/rustc'
8931a1
%endif
8931a1
2e0a74
%if %defined wasm_targets
bbd8b7
%setup -q -n %{wasi_libc_name} -T -b 1
bbd8b7
%endif
bbd8b7
8931a1
%setup -q -n %{rustc_package}
8931a1
c74a88
%patch1 -p1
6a704c
%patch2 -p1
c74a88
8931a1
%if %with disabled_libssh2
c3bb10
%patch100 -p1
c3bb10
%endif
c3bb10
c3bb10
%if %without curl_http2
c3bb10
%patch101 -p1
c3bb10
rm -rf vendor/libnghttp2-sys/
8931a1
%endif
8931a1
c3bb10
%if 0%{?rhel} && 0%{?rhel} < 8
79456f
%patch102 -p1
c3bb10
%endif
c3bb10
2e0a74
# Use our explicit python3 first
2e0a74
sed -i.try-python -e '/^try python3 /i try "%{__python3}" "$@"' ./configure
8931a1
5737f7
# Set a substitute-path in rust-gdb for standard library sources.
5737f7
sed -i.rust-src -e "s#@BUILDDIR@#$PWD#" ./src/etc/rust-gdb
5737f7
8931a1
%if %without bundled_llvm
8931a1
rm -rf src/llvm-project/
79456f
mkdir -p src/llvm-project/libunwind/
8931a1
%endif
8931a1
8931a1
# Remove other unused vendored libraries
8931a1
rm -rf vendor/curl-sys/curl/
5737f7
rm -rf vendor/*jemalloc-sys*/jemalloc/
5737f7
rm -rf vendor/libmimalloc-sys/c_src/mimalloc/
79456f
rm -rf vendor/libssh2-sys/libssh2/
8931a1
rm -rf vendor/libz-sys/src/zlib/
79456f
rm -rf vendor/libz-sys/src/zlib-ng/
8931a1
rm -rf vendor/lzma-sys/xz-*/
8931a1
rm -rf vendor/openssl-src/openssl/
8931a1
8931a1
%if %without bundled_libgit2
8931a1
rm -rf vendor/libgit2-sys/libgit2/
8931a1
%endif
8931a1
8931a1
%if %with disabled_libssh2
8931a1
rm -rf vendor/libssh2-sys/
8931a1
%endif
8931a1
8931a1
# This only affects the transient rust-installer, but let it use our dynamic xz-libs
8931a1
sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs
8931a1
c3bb10
%if %{with bundled_llvm} && 0%{?epel} == 7
8931a1
mkdir -p cmake-bin
8931a1
ln -s /usr/bin/cmake3 cmake-bin/cmake
8931a1
%global cmake_path $PWD/cmake-bin
8931a1
%endif
8931a1
8931a1
%if %{without bundled_llvm} && %{with llvm_static}
8931a1
# Static linking to distro LLVM needs to add -lffi
8931a1
# https://github.com/rust-lang/rust/issues/34486
8931a1
sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
8931a1
  src/librustc_llvm/lib.rs
8931a1
%endif
8931a1
8931a1
# The configure macro will modify some autoconf-related files, which upsets
8931a1
# cargo when it tries to verify checksums in those files.  If we just truncate
8931a1
# that file list, cargo won't have anything to complain about.
8931a1
find vendor -name .cargo-checksum.json \
8931a1
  -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
8931a1
8931a1
# Sometimes Rust sources start with #![...] attributes, and "smart" editors think
8931a1
# it's a shebang and make them executable. Then brp-mangle-shebangs gets upset...
8931a1
find -name '*.rs' -type f -perm /111 -exec chmod -v -x '{}' '+'
8931a1
c3bb10
# Set up shared environment variables for build/install/check
2e0a74
%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"}
c3bb10
%if 0%{?cmake_path:1}
2e0a74
%global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH"
8931a1
%endif
79456f
%if %without disabled_libssh2
8931a1
# convince libssh2-sys to use the distro libssh2
2e0a74
%global rust_env %{?rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1
8931a1
%endif
2e0a74
%global export_rust_env %{?rust_env:export %{rust_env}}
8931a1
c3bb10
c3bb10
%build
2e0a74
%{export_rust_env}
8931a1
8931a1
%ifarch %{arm} %{ix86} s390x
8931a1
# full debuginfo is exhausting memory; just do libstd for now
8931a1
# https://github.com/rust-lang/rust/issues/45854
c3bb10
%if 0%{?rhel} && 0%{?rhel} < 8
8931a1
# Older rpmbuild didn't work with partial debuginfo coverage.
8931a1
%global debug_package %{nil}
8931a1
%define enable_debuginfo --debuginfo-level=0
8931a1
%else
8931a1
%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
8931a1
%endif
8931a1
%else
8931a1
%define enable_debuginfo --debuginfo-level=2
8931a1
%endif
8931a1
75225e
# Some builders have relatively little memory for their CPU count.
75225e
# At least 2GB per CPU is a good rule of thumb for building rustc.
75225e
ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN)
75225e
max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 ))
75225e
if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then
75225e
  ncpus="$max_cpus"
75225e
fi
75225e
2e0a74
%if %defined mingw_targets
2e0a74
%{lua: do
2e0a74
  local cfg = ""
2e0a74
  for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do
2e0a74
    local subs = {
2e0a74
      triple = triple,
2e0a74
      mingw = string.sub(triple, 1, 4) == "i686" and "mingw32" or "mingw64",
2e0a74
    }
6a704c
    local s = string.gsub([[
2e0a74
      --set target.{{triple}}.linker=%{{{mingw}}_cc}
2e0a74
      --set target.{{triple}}.cc=%{{{mingw}}_cc}
2e0a74
      --set target.{{triple}}.ar=%{{{mingw}}_ar}
2e0a74
      --set target.{{triple}}.ranlib=%{{{mingw}}_ranlib}
6a704c
    ]], "{{(%w+)}}", subs)
2e0a74
    cfg = cfg .. " " .. s
2e0a74
  end
6a704c
  cfg = string.gsub(cfg, "%s+", " ")
2e0a74
  rpm.define("mingw_target_config " .. cfg)
2e0a74
end}
2e0a74
%endif
2e0a74
2e0a74
%if %defined wasm_targets
5737f7
%make_build --quiet -C %{wasi_libc_dir} CC=clang AR=llvm-ar NM=llvm-nm
bbd8b7
%{lua: do
bbd8b7
  local wasi_root = rpm.expand("%{wasi_libc_dir}") .. "/sysroot"
2e0a74
  local cfg = ""
2e0a74
  for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do
bbd8b7
    if string.find(triple, "-wasi") then
2e0a74
      cfg = cfg .. " --set target." .. triple .. ".wasi-root=" .. wasi_root
bbd8b7
    end
bbd8b7
  end
2e0a74
  rpm.define("wasm_target_config "..cfg)
bbd8b7
end}
bbd8b7
%endif
bbd8b7
8931a1
%configure --disable-option-checking \
8931a1
  --libdir=%{common_libdir} \
8931a1
  --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
6a704c
  --set target.%{rust_triple}.linker=%{__cc} \
6a704c
  --set target.%{rust_triple}.cc=%{__cc} \
6a704c
  --set target.%{rust_triple}.cxx=%{__cxx} \
6a704c
  --set target.%{rust_triple}.ar=%{__ar} \
6a704c
  --set target.%{rust_triple}.ranlib=%{__ranlib} \
2e0a74
  %{?mingw_target_config} \
2e0a74
  %{?wasm_target_config} \
2e0a74
  --python=%{__python3} \
8931a1
  --local-rust-root=%{local_rust_root} \
6a704c
  --set build.rustfmt=/bin/true \
8931a1
  %{!?with_bundled_llvm: --llvm-root=%{llvm_root} \
8931a1
    %{!?llvm_has_filecheck: --disable-codegen-tests} \
8931a1
    %{!?with_llvm_static: --enable-llvm-link-shared } } \
5737f7
  --disable-llvm-static-stdcpp \
8931a1
  --disable-rpath \
8931a1
  %{enable_debuginfo} \
601eff
  --set rust.codegen-units-std=1 \
8931a1
  --enable-extended \
75225e
  --tools=analysis,cargo,clippy,rls,rustfmt,src \
8931a1
  --enable-vendor \
8931a1
  --enable-verbose-tests \
bbd8b7
  --dist-compression-formats=gz \
c74a88
  --release-channel=%{channel} \
c74a88
  --release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}"
8931a1
2e0a74
%{__python3} ./x.py build -j "$ncpus" --stage 2
2e0a74
%{__python3} ./x.py doc --stage 2
8931a1
2e0a74
for triple in %{?mingw_targets} %{?wasm_targets}; do
2e0a74
  %{__python3} ./x.py build --stage 2 --target=$triple std
601eff
done
8931a1
8931a1
%install
2e0a74
%{export_rust_env}
8931a1
2e0a74
DESTDIR=%{buildroot} %{__python3} ./x.py install
8931a1
2e0a74
for triple in %{?mingw_targets} %{?wasm_targets}; do
2e0a74
  DESTDIR=%{buildroot} %{__python3} ./x.py install --target=$triple std
601eff
done
601eff
0e66bb
# These are transient files used by x.py dist and install
0e66bb
rm -rf ./build/dist/ ./build/tmp/
0e66bb
8931a1
# Make sure the shared libraries are in the proper libdir
8931a1
%if "%{_libdir}" != "%{common_libdir}"
8931a1
mkdir -p %{buildroot}%{_libdir}
8931a1
find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \
8931a1
  -exec mv -v -t %{buildroot}%{_libdir} '{}' '+'
8931a1
%endif
8931a1
8931a1
# The shared libraries should be executable for debuginfo extraction.
8931a1
find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
8931a1
  -exec chmod -v +x '{}' '+'
8931a1
8931a1
# The libdir libraries are identical to those under rustlib/.  It's easier on
8931a1
# library loading if we keep them in libdir, but we do need them in rustlib/
8931a1
# to support dynamic linking for compiler plugins, so we'll symlink.
8931a1
(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
8931a1
 find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
8931a1
 while read lib; do
8931a1
   if [ -f "${lib##*/}" ]; then
8931a1
     # make sure they're actually identical!
8931a1
     cmp "$lib" "${lib##*/}"
8931a1
     ln -v -f -s -t . "$lib"
8931a1
   fi
8931a1
 done)
8931a1
8931a1
# Remove installer artifacts (manifests, uninstall scripts, etc.)
8931a1
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
8931a1
8931a1
# Remove backup files from %%configure munging
8931a1
find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
8931a1
8931a1
# https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
8931a1
# We don't actually need to ship any of those python scripts in rust-src anyway.
8931a1
find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
8931a1
8931a1
# FIXME: __os_install_post will strip the rlibs
8931a1
# -- should we find a way to preserve debuginfo?
8931a1
8931a1
# Remove unwanted documentation files (we already package them)
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/README.md
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
8931a1
rm -f %{buildroot}%{_docdir}/%{name}/*.old
8931a1
8931a1
# Sanitize the HTML documentation
8931a1
find %{buildroot}%{_docdir}/%{name}/html -empty -delete
8931a1
find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
8931a1
8931a1
# Create the path for crate-devel packages
8931a1
mkdir -p %{buildroot}%{_datadir}/cargo/registry
8931a1
8931a1
# Cargo no longer builds its own documentation
8931a1
# https://github.com/rust-lang/cargo/pull/4904
8931a1
mkdir -p %{buildroot}%{_docdir}/cargo
8931a1
ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
8931a1
8931a1
%if %without lldb
8931a1
rm -f %{buildroot}%{_bindir}/rust-lldb
c3bb10
rm -f %{buildroot}%{rustlibdir}/etc/lldb_*
8931a1
%endif
8931a1
c74a88
# We don't want Rust copies of LLVM tools (rust-lld, rust-llvm-dwp)
c74a88
rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll*
c74a88
5737f7
%if 0%{?rhel} && 0%{?rhel} >= 8
5737f7
# This allows users to build packages using Rust Toolset.
5737f7
%{__install} -D -m 644 %{S:100} %{buildroot}%{rpmmacrodir}/macros.rust-toolset
5737f7
%endif
5737f7
8931a1
8931a1
%check
2e0a74
%{export_rust_env}
8931a1
bbd8b7
# Sanity-check the installed binaries, debuginfo-stripped and all.
bbd8b7
%{buildroot}%{_bindir}/cargo new build/hello-world
bbd8b7
env RUSTC=%{buildroot}%{_bindir}/rustc \
bbd8b7
    LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \
bbd8b7
    %{buildroot}%{_bindir}/cargo run --manifest-path build/hello-world/Cargo.toml
bbd8b7
6a704c
# Try a build sanity-check for other targets
6a704c
for triple in %{?mingw_targets} %{?wasm_targets}; do
6a704c
  env RUSTC=%{buildroot}%{_bindir}/rustc \
6a704c
      LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" \
6a704c
      %{buildroot}%{_bindir}/cargo build --manifest-path build/hello-world/Cargo.toml --target=$triple
6a704c
done
6a704c
8931a1
# The results are not stable on koji, so mask errors and just log it.
0e66bb
# Some of the larger test artifacts are manually cleaned to save space.
2e0a74
%{__python3} ./x.py test --no-fail-fast --stage 2 || :
0e66bb
rm -rf "./build/%{rust_triple}/test/"
0e66bb
2e0a74
%{__python3} ./x.py test --no-fail-fast --stage 2 cargo || :
0e66bb
rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
0e66bb
2e0a74
%{__python3} ./x.py test --no-fail-fast --stage 2 clippy || :
bbd8b7
bbd8b7
env RLS_TEST_WAIT_FOR_AGES=1 \
2e0a74
%{__python3} ./x.py test --no-fail-fast --stage 2 rls || :
bbd8b7
2e0a74
%{__python3} ./x.py test --no-fail-fast --stage 2 rustfmt || :
8931a1
8931a1
8931a1
%ldconfig_scriptlets
8931a1
8931a1
8931a1
%files
8931a1
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT
8931a1
%doc README.md
8931a1
%{_bindir}/rustc
8931a1
%{_bindir}/rustdoc
8931a1
%{_libdir}/*.so
8931a1
%{_mandir}/man1/rustc.1*
8931a1
%{_mandir}/man1/rustdoc.1*
8931a1
%dir %{rustlibdir}
8931a1
%dir %{rustlibdir}/%{rust_triple}
8931a1
%dir %{rustlibdir}/%{rust_triple}/lib
8931a1
%{rustlibdir}/%{rust_triple}/lib/*.so
8931a1
8931a1
8931a1
%files std-static
8931a1
%dir %{rustlibdir}
8931a1
%dir %{rustlibdir}/%{rust_triple}
8931a1
%dir %{rustlibdir}/%{rust_triple}/lib
8931a1
%{rustlibdir}/%{rust_triple}/lib/*.rlib
8931a1
8931a1
2e0a74
%if %defined mingw_targets
601eff
%{lua: do
2e0a74
  for triple in string.gmatch(rpm.expand("%{mingw_targets}"), "%S+") do
2e0a74
    local subs = {
2e0a74
      triple = triple,
2e0a74
      rustlibdir = rpm.expand("%{rustlibdir}"),
2e0a74
    }
2e0a74
    local s = string.gsub([[
2e0a74
2e0a74
%files std-static-{{triple}}
2e0a74
%dir {{rustlibdir}}
2e0a74
%dir {{rustlibdir}}/{{triple}}
2e0a74
%dir {{rustlibdir}}/{{triple}}/lib
2e0a74
{{rustlibdir}}/{{triple}}/lib/*.rlib
2e0a74
{{rustlibdir}}/{{triple}}/lib/rs*.o
2e0a74
%exclude {{rustlibdir}}/{{triple}}/lib/*.dll
2e0a74
%exclude {{rustlibdir}}/{{triple}}/lib/*.dll.a
2e0a74
%exclude {{rustlibdir}}/{{triple}}/lib/self-contained
2e0a74
2e0a74
]], "{{(%w+)}}", subs)
2e0a74
    print(s)
2e0a74
  end
2e0a74
end}
2e0a74
%endif
2e0a74
2e0a74
2e0a74
%if %defined wasm_targets
2e0a74
%{lua: do
2e0a74
  for triple in string.gmatch(rpm.expand("%{wasm_targets}"), "%S+") do
601eff
    local subs = {
601eff
      triple = triple,
601eff
      rustlibdir = rpm.expand("%{rustlibdir}"),
bbd8b7
      wasi = string.find(triple, "-wasi") and 1 or 0,
601eff
    }
601eff
    local s = string.gsub([[
bbd8b7
601eff
%files std-static-{{triple}}
601eff
%dir {{rustlibdir}}
601eff
%dir {{rustlibdir}}/{{triple}}
601eff
%dir {{rustlibdir}}/{{triple}}/lib
601eff
{{rustlibdir}}/{{triple}}/lib/*.rlib
bbd8b7
%if {{wasi}}
bbd8b7
%dir {{rustlibdir}}/{{triple}}/lib/self-contained
bbd8b7
{{rustlibdir}}/{{triple}}/lib/self-contained/crt*.o
2e0a74
{{rustlibdir}}/{{triple}}/lib/self-contained/libc.a
bbd8b7
%endif
bbd8b7
601eff
]], "{{(%w+)}}", subs)
601eff
    print(s)
601eff
  end
601eff
end}
601eff
%endif
601eff
601eff
8931a1
%files debugger-common
8931a1
%dir %{rustlibdir}
8931a1
%dir %{rustlibdir}/etc
c3bb10
%{rustlibdir}/etc/rust_*.py*
8931a1
8931a1
8931a1
%files gdb
8931a1
%{_bindir}/rust-gdb
c3bb10
%{rustlibdir}/etc/gdb_*
8931a1
%exclude %{_bindir}/rust-gdbgui
8931a1
8931a1
8931a1
%if %with lldb
8931a1
%files lldb
8931a1
%{_bindir}/rust-lldb
c3bb10
%{rustlibdir}/etc/lldb_*
8931a1
%endif
8931a1
8931a1
8931a1
%files doc
8931a1
%docdir %{_docdir}/%{name}
8931a1
%dir %{_docdir}/%{name}
8931a1
%dir %{_docdir}/%{name}/html
8931a1
%{_docdir}/%{name}/html/*/
8931a1
%{_docdir}/%{name}/html/*.html
8931a1
%{_docdir}/%{name}/html/*.css
8931a1
%{_docdir}/%{name}/html/*.js
8931a1
%{_docdir}/%{name}/html/*.png
8931a1
%{_docdir}/%{name}/html/*.svg
c74a88
%{_docdir}/%{name}/html/*.woff2
8931a1
%license %{_docdir}/%{name}/html/*.txt
8931a1
%license %{_docdir}/%{name}/html/*.md
8931a1
8931a1
8931a1
%files -n cargo
8931a1
%license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY
8931a1
%doc src/tools/cargo/README.md
8931a1
%{_bindir}/cargo
c74a88
%{_libexecdir}/cargo*
8931a1
%{_mandir}/man1/cargo*.1*
8931a1
%{_sysconfdir}/bash_completion.d/cargo
8931a1
%{_datadir}/zsh/site-functions/_cargo
8931a1
%dir %{_datadir}/cargo
8931a1
%dir %{_datadir}/cargo/registry
8931a1
8931a1
8931a1
%files -n cargo-doc
8931a1
%docdir %{_docdir}/cargo
8931a1
%dir %{_docdir}/cargo
8931a1
%{_docdir}/cargo/html
8931a1
8931a1
8931a1
%files -n rustfmt
8931a1
%{_bindir}/rustfmt
8931a1
%{_bindir}/cargo-fmt
8931a1
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
8931a1
%license src/tools/rustfmt/LICENSE-{APACHE,MIT}
8931a1
8931a1
8931a1
%files -n rls
8931a1
%{_bindir}/rls
8931a1
%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
8931a1
%license src/tools/rls/LICENSE-{APACHE,MIT}
8931a1
8931a1
8931a1
%files -n clippy
8931a1
%{_bindir}/cargo-clippy
8931a1
%{_bindir}/clippy-driver
8931a1
%doc src/tools/clippy/{README.md,CHANGELOG.md}
8931a1
%license src/tools/clippy/LICENSE-{APACHE,MIT}
8931a1
8931a1
8931a1
%files src
8931a1
%dir %{rustlibdir}
8931a1
%{rustlibdir}/src
8931a1
8931a1
8931a1
%files analysis
8931a1
%{rustlibdir}/%{rust_triple}/analysis/
8931a1
8931a1
5737f7
%if 0%{?rhel} && 0%{?rhel} >= 8
5737f7
%files toolset
5737f7
%{rpmmacrodir}/macros.rust-toolset
5737f7
%endif
5737f7
5737f7
8931a1
%changelog
5737f7
* Tue Jul 19 2022 Josh Stone <jistone@redhat.com> - 1.62.1-1
5737f7
- Update to 1.62.1.
5737f7
5737f7
* Wed Jul 13 2022 Josh Stone <jistone@redhat.com> - 1.62.0-2
5737f7
- Prevent unsound coercions from functions with opaque return types.
5737f7
5737f7
* Thu Jun 30 2022 Josh Stone <jistone@redhat.com> - 1.62.0-1
5737f7
- Update to 1.62.0.
5737f7
5737f7
* Fri Jun 03 2022 Josh Stone <jistone@redhat.com> - 1.61.0-1
5737f7
- Update to 1.61.0.
5737f7
- Add rust-toolset as a subpackage.
5737f7
6a704c
* Wed Apr 20 2022 Josh Stone <jistone@redhat.com> - 1.60.0-1
6a704c
- Update to 1.60.0.
6a704c
6a704c
* Tue Apr 19 2022 Josh Stone <jistone@redhat.com> - 1.59.0-1
6a704c
- Update to 1.59.0.
6a704c
2e0a74
* Thu Jan 20 2022 Josh Stone <jistone@redhat.com> - 1.58.1-1
2e0a74
- Update to 1.58.1.
2e0a74
2e0a74
* Thu Jan 13 2022 Josh Stone <jistone@redhat.com> - 1.58.0-1
2e0a74
- Update to 1.58.0.
2e0a74
2e0a74
* Wed Dec 15 2021 Josh Stone <jistone@redhat.com> - 1.57.0-1
2e0a74
- Update to 1.57.0.
2e0a74
bbd8b7
* Thu Dec 02 2021 Josh Stone <jistone@redhat.com> - 1.56.1-2
bbd8b7
- Add rust-std-static-wasm32-wasi
bbd8b7
  Resolves: rhbz#1980080
bbd8b7
bbd8b7
* Tue Nov 02 2021 Josh Stone <jistone@redhat.com> - 1.56.0-1
bbd8b7
- Update to 1.56.1.
bbd8b7
bbd8b7
* Fri Oct 29 2021 Josh Stone <jistone@redhat.com> - 1.55.0-1
bbd8b7
- Update to 1.55.0.
bbd8b7
- Backport support for LLVM 13.
bbd8b7
0e66bb
* Tue Aug 17 2021 Josh Stone <jistone@redhat.com> - 1.54.0-2
0e66bb
- Make std-static-wasm* arch-specific to avoid s390x.
0e66bb
0e66bb
* Thu Jul 29 2021 Josh Stone <jistone@redhat.com> - 1.54.0-1
0e66bb
- Update to 1.54.0.
0e66bb
df79d1
* Tue Jul 20 2021 Josh Stone <jistone@redhat.com> - 1.53.0-2
df79d1
- Use llvm-ranlib to fix wasm archives.
df79d1
601eff
* Mon Jun 21 2021 Josh Stone <jistone@redhat.com> - 1.53.0-1
601eff
- Update to 1.53.0.
601eff
601eff
* Tue Jun 15 2021 Josh Stone <jistone@redhat.com> - 1.52.1-2
601eff
- Set rust.codegen-units-std=1 for all targets again.
601eff
- Add rust-std-static-wasm32-unknown-unknown.
601eff
c74a88
* Tue May 25 2021 Josh Stone <jistone@redhat.com> - 1.52.1-1
c74a88
- Update to 1.52.1. Includes security fixes for CVE-2020-36323,
c74a88
  CVE-2021-28876, CVE-2021-28878, CVE-2021-28879, and CVE-2021-31162.
c74a88
c74a88
* Mon May 24 2021 Josh Stone <jistone@redhat.com> - 1.51.0-1
c74a88
- Update to 1.51.0. Update to 1.51.0. Includes security fixes for
c74a88
  CVE-2021-28875 and CVE-2021-28877.
c74a88
c74a88
* Mon May 24 2021 Josh Stone <jistone@redhat.com> - 1.50.0-1
c74a88
- Update to 1.50.0.
c74a88
79456f
* Wed Jan 13 2021 Josh Stone <jistone@redhat.com> - 1.49.0-1
79456f
- Update to 1.49.0.
79456f
79456f
* Tue Jan 12 2021 Josh Stone <jistone@redhat.com> - 1.48.0-1
79456f
- Update to 1.48.0.
79456f
c3bb10
* Thu Oct 22 2020 Josh Stone <jistone@redhat.com> - 1.47.0-1
c3bb10
- Update to 1.47.0.
c3bb10
c3bb10
* Wed Oct 14 2020 Josh Stone <jistone@redhat.com> - 1.46.0-1
c3bb10
- Update to 1.46.0.
c3bb10
9beef6
* Tue Aug 04 2020 Josh Stone <jistone@redhat.com> - 1.45.2-1
9beef6
- Update to 1.45.2.
9beef6
75225e
* Thu Jul 16 2020 Josh Stone <jistone@redhat.com> - 1.45.0-1
75225e
- Update to 1.45.0.
75225e
75225e
* Tue Jul 14 2020 Josh Stone <jistone@redhat.com> - 1.44.1-1
75225e
- Update to 1.44.1.
75225e
8931a1
* Thu May 07 2020 Josh Stone <jistone@redhat.com> - 1.43.1-1
8931a1
- Update to 1.43.1.
8931a1
8931a1
* Thu Apr 23 2020 Josh Stone <jistone@redhat.com> - 1.43.0-1
8931a1
- Update to 1.43.0.
8931a1
8931a1
* Thu Mar 12 2020 Josh Stone <jistone@redhat.com> - 1.42.0-1
8931a1
- Update to 1.42.0.
8931a1
8931a1
* Thu Feb 27 2020 Josh Stone <jistone@redhat.com> - 1.41.1-1
8931a1
- Update to 1.41.1.
8931a1
8931a1
* Thu Jan 30 2020 Josh Stone <jistone@redhat.com> - 1.41.0-1
8931a1
- Update to 1.41.0.
8931a1
8931a1
* Thu Jan 16 2020 Josh Stone <jistone@redhat.com> - 1.40.0-1
8931a1
- Update to 1.40.0.
8931a1
- Fix compiletest with newer (local-rebuild) libtest
8931a1
- Build compiletest with in-tree libtest
8931a1
- Fix ARM EHABI unwinding
8931a1
8931a1
* Tue Nov 12 2019 Josh Stone <jistone@redhat.com> - 1.39.0-2
8931a1
- Fix a couple build and test issues with rustdoc.
8931a1
8931a1
* Thu Nov 07 2019 Josh Stone <jistone@redhat.com> - 1.39.0-1
8931a1
- Update to 1.39.0.
8931a1
8931a1
* Thu Sep 26 2019 Josh Stone <jistone@redhat.com> - 1.38.0-1
8931a1
- Update to 1.38.0.
8931a1
8931a1
* Thu Aug 15 2019 Josh Stone <jistone@redhat.com> - 1.37.0-1
8931a1
- Update to 1.37.0.
8931a1
- Disable libssh2 (git+ssh support).
8931a1
8931a1
* Thu Jul 04 2019 Josh Stone <jistone@redhat.com> - 1.36.0-1
8931a1
- Update to 1.36.0.
8931a1
8931a1
* Wed May 29 2019 Josh Stone <jistone@redhat.com> - 1.35.0-2
8931a1
- Fix compiletest for rebuild testing.
8931a1
8931a1
* Thu May 23 2019 Josh Stone <jistone@redhat.com> - 1.35.0-1
8931a1
- Update to 1.35.0.
8931a1
8931a1
* Tue May 14 2019 Josh Stone <jistone@redhat.com> - 1.34.2-1
8931a1
- Update to 1.34.2 -- fixes CVE-2019-12083.
8931a1
8931a1
* Thu May 09 2019 Josh Stone <jistone@redhat.com> - 1.34.1-1
8931a1
- Update to 1.34.1.
8931a1
8931a1
* Thu Apr 11 2019 Josh Stone <jistone@redhat.com> - 1.34.0-1
8931a1
- Update to 1.34.0.
8931a1
8931a1
* Wed Apr 10 2019 Josh Stone <jistone@redhat.com> - 1.33.0-1
8931a1
- Update to 1.33.0.
8931a1
8931a1
* Tue Apr 09 2019 Josh Stone <jistone@redhat.com> - 1.32.0-1
8931a1
- Update to 1.32.0.
8931a1
8931a1
* Fri Dec 14 2018 Josh Stone <jistone@redhat.com> - 1.31.0-5
8931a1
- Restore rust-lldb.
8931a1
8931a1
* Thu Dec 13 2018 Josh Stone <jistone@redhat.com> - 1.31.0-4
8931a1
- Backport fixes for rls.
8931a1
8931a1
* Thu Dec 13 2018 Josh Stone <jistone@redhat.com> - 1.31.0-3
8931a1
- Update to 1.31.0 -- Rust 2018!
8931a1
- clippy/rls/rustfmt are no longer -preview
8931a1
8931a1
* Wed Dec 12 2018 Josh Stone <jistone@redhat.com> - 1.30.1-2
8931a1
- Update to 1.30.1.
8931a1
8931a1
* Tue Nov 06 2018 Josh Stone <jistone@redhat.com> - 1.29.2-1
8931a1
- Update to 1.29.2.
8931a1
8931a1
* Thu Nov 01 2018 Josh Stone <jistone@redhat.com> - 1.28.0-1
8931a1
- Update to 1.28.0.
8931a1
8931a1
* Thu Nov 01 2018 Josh Stone <jistone@redhat.com> - 1.27.2-1
8931a1
- Update to 1.27.2.
8931a1
8931a1
* Wed Oct 10 2018 Josh Stone <jistone@redhat.com> - 1.26.2-12
8931a1
- Fix "fp" target feature for AArch64 (#1632880)
8931a1
8931a1
* Mon Oct 08 2018 Josh Stone <jistone@redhat.com> - 1.26.2-11
8931a1
- Security fix for str::repeat (pending CVE).
8931a1
8931a1
* Fri Oct 05 2018 Josh Stone <jistone@redhat.com> - 1.26.2-10
8931a1
- Rebuild without bootstrap binaries.
8931a1
8931a1
* Thu Oct 04 2018 Josh Stone <jistone@redhat.com> - 1.26.2-9
8931a1
- Bootstrap without SCL packaging. (rhbz1635067)
8931a1
8931a1
* Tue Aug 28 2018 Tom Stellard <tstellar@redhat.com> - 1.26.2-8
8931a1
- Use python3 prefix for lldb Requires
8931a1
8931a1
* Mon Aug 13 2018 Josh Stone <jistone@redhat.com> - 1.26.2-7
8931a1
- Build with platform-python
8931a1
8931a1
* Tue Aug 07 2018 Josh Stone <jistone@redhat.com> - 1.26.2-6
8931a1
- Exclude rust-src from auto-requires
8931a1
8931a1
* Thu Aug 02 2018 Josh Stone <jistone@redhat.com> - 1.26.2-5
8931a1
- Rebuild without bootstrap binaries.
8931a1
8931a1
* Tue Jul 31 2018 Josh Stone <jistone@redhat.com> - 1.26.2-4
8931a1
- Bootstrap as a module.
8931a1
8931a1
* Mon Jun 04 2018 Josh Stone <jistone@redhat.com> - 1.26.2-3
8931a1
- Update to 1.26.2.
8931a1
8931a1
* Wed May 30 2018 Josh Stone <jistone@redhat.com> - 1.26.1-2
8931a1
- Update to 1.26.1.
8931a1
8931a1
* Fri May 18 2018 Josh Stone <jistone@redhat.com> - 1.26.0-1
8931a1
- Update to 1.26.0.
8931a1
8931a1
* Tue Apr 10 2018 Josh Stone <jistone@redhat.com> - 1.25.0-2
8931a1
- Filter codegen-backends from Provides too.
8931a1
8931a1
* Tue Apr 03 2018 Josh Stone <jistone@redhat.com> - 1.25.0-1
8931a1
- Update to 1.25.0.
8931a1
- Add rustfmt-preview as a subpackage.
8931a1
8931a1
* Thu Feb 22 2018 Josh Stone <jistone@redhat.com> - 1.24.0-1
8931a1
- Update to 1.24.0.
8931a1
8931a1
* Tue Jan 16 2018 Josh Stone <jistone@redhat.com> - 1.23.0-2
8931a1
- Rebuild without bootstrap binaries.
8931a1
8931a1
* Mon Jan 15 2018 Josh Stone <jistone@redhat.com> - 1.23.0-1
8931a1
- Bootstrap 1.23 on el8.