Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: pep8

pep8 (1.7.1-9ubuntu1) focal; urgency=medium * Revert "Drop transitional pep8 package" -- Julian Andres Klode <juliank@ubuntu.com> Wed, 29 Jan 2020 15:19:09 +0100

Modifications :
  1. Download patch debian/pep8.manpages

    --- 1.7.1-9/debian/pep8.manpages 1970-01-01 00:00:00.000000000 +0000 +++ 1.7.1-9ubuntu1/debian/pep8.manpages 2020-01-29 14:19:09.000000000 +0000 @@ -0,0 +1 @@ +debian/pep8.1
  2. Download patch debian/control

    --- 1.7.1-9/debian/control 2020-01-25 04:26:56.000000000 +0000 +++ 1.7.1-9ubuntu1/debian/control 2020-01-29 14:19:09.000000000 +0000 @@ -4,7 +4,8 @@ Priority: optional Uploaders: David Watson <dwatson@debian.org>, Sylvestre Ledru <sylvestre@debian.org> -Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> Build-Depends: debhelper-compat (= 12), dh-python, @@ -15,6 +16,18 @@ Homepage: https://pypi.python.org/pypi/p Vcs-Git: https://salsa.debian.org/python-team/modules/pep8.git Vcs-Browser: https://salsa.debian.org/python-team/modules/pep8 +Package: pep8 +Section: oldlibs +Architecture: all +Multi-Arch: foreign +Depends: + pycodestyle, + ${misc:Depends} +Description: Python PEP 8 code style checker - transitional package + pep8 script was renamed to pycodestyle. + . + This is transitional package which provides symlink for pep8 script + Package: python3-pep8 Architecture: all Depends:
  3. Download patch debian/pep8.links
  4. Download patch debian/pep8.1

    --- 1.7.1-9/debian/pep8.1 1970-01-01 00:00:00.000000000 +0000 +++ 1.7.1-9ubuntu1/debian/pep8.1 2020-01-29 14:19:09.000000000 +0000 @@ -0,0 +1,79 @@ +.TH PEP8 "1" "July 2014" "pep8 1.5.7" "User Commands" +.SH NAME +pep8 \- A tool to check your Python code against some of the style conventions in PEP 8. +.SH SYNOPSIS +.B pep8 +[\fIoptions\fR] \fIinput \fR... +.SH OPTIONS +.TP +\fB\-\-version\fR +show program's version number and exit +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-v\fR, \fB\-\-verbose\fR +print status messages, or debug with \fB\-vv\fR +.TP +\fB\-q\fR, \fB\-\-quiet\fR +report only file names, or nothing with \fB\-qq\fR +.TP +\fB\-\-exclude\fR=\fIpatterns\fR +exclude files or directories which match these comma separated patterns (default: .svn,CVS,.bzr,.hg,.git,__pycache__) +.TP +\fB\-\-filename\fR=\fIpatterns\fR +when parsing directories, only check filenames matching these comma separated patterns (default: *.py) +.TP +\fB\-\-select\fR=\fIerrors\fR +select errors and warning (e.g. E,W6) +.TP +\fB\-\-ignore\fR=\fIerrors\fR +skip errors and warnings (e.g. E4,W) +.TP +\fB\-\-first\fR +show first occurrence of each error +.TP +\fB\-r\fR, \fB\-\-repeat\fR +(obsolete) show all occurrences of the same error +.TP +\fB\-\-show\-source\fR +show source code for each error +.TP +\fB\-\-show\-pep8\fR +show text of PEP 8 for each error (implies \-\-first) +.TP +\fB\-\-statistics\fR +count errors and warnings +.TP +\fB\-\-count\fR +print total number of errors and warnings to standard error and set exit code to 1 if total is not null +.TP +\fB\-\-max\-line\-length\fR=\fIn\fR +set maximum allowed line length (default: 79) +.TP +\fB\-\-hang-closing\fR +hang closing bracket instead of matching indentation of opening bracket's line +.TP +\fB\-\-format\fR=\fIformat\fR +set the error format [default|pylint|<custom>] +.TP +\fB\-\-diff\fR +report only lines changed according to the unified diff received on STDIN +.TP +\fB\-\-benchmark\fR +measure processing speed +.TP +\fB\-\-config\fR=\fIpath\fR +user config file location (default: $HOME/.config/pep8) +.TP +.SH "USAGE EXAMPLES" +.TP +Display how often each error was found: +.sp +% pep8 \-\-statistics \-qq example/lib/ +.TP +Show source code and more verbose explanation from PEP 8: +.sp +% pep8 \-\-show-source \-\-show-pep8 foo.py +.SH AUTHOR +This manual page was written by David Watson <dwatson@debian.org> and Michael Prokop <mika@debian.org>.

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: rust-uuid

rust-uuid (0.8.1-2ubuntu2) focal; urgency=medium * No-change rebuild with fixed binutils on arm64. -- Matthias Klose <doko@ubuntu.com> Sat, 08 Feb 2020 11:19:52 +0000 rust-uuid (0.8.1-2ubuntu1) focal; urgency=medium * Merge from Debian unstable; remaining changes: - Don't build librust-uuid+wasm-bindgen-dev on ppc64el -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 10 Jan 2020 16:07:07 -0800

Modifications :
  1. Download patch debian/control

    --- 0.8.1-2/debian/control 2019-12-29 10:54:22.000000000 +0000 +++ 0.8.1-2ubuntu2/debian/control 2020-01-11 00:07:07.000000000 +0000 @@ -6,7 +6,8 @@ Build-Depends: debhelper (>= 11), cargo:native <!nocheck>, rustc:native <!nocheck>, libstd-rust-dev <!nocheck> -Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> Uploaders: Sylvestre Ledru <sylvestre@debian.org> Standards-Version: 4.2.0 @@ -178,7 +179,7 @@ Description: Generate and parse UUIDs - in any additional dependencies needed by that feature. Package: librust-uuid+wasm-bindgen-dev -Architecture: any +Architecture: amd64 arm64 armhf s390x Multi-Arch: same Depends: ${misc:Depends},

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: rustc

rustc (1.41.0+dfsg1+llvm-0ubuntu2) focal; urgency=medium * Add riscv64 support: - Add more rustc patches from Debian. - Apply relevant llvm-toolchain-9 patches to the embedded llvm. - debian/patches/riscv64-vendor-cc.diff: Update one last rustc lp64 ABI reference to lp64d. - Avoid the LDFLAGS -latomic hacks from llvm-toolchain-9: - debian/patches/riscv64-atomic-fixes.patch: Fix libatomic detection for riscv64. - debian/patches/dsymutil-atomic.patch: Link dsymutil with -latomic. -- William Grant <wgrant@ubuntu.com> Wed, 08 Apr 2020 10:18:39 +1000 rustc (1.41.0+dfsg1+llvm-0ubuntu1) focal; urgency=medium * New upstream version (LP: #1856851) * Cherry-pick several commits from https://salsa.debian.org/rust-team/rust/-/merge_requests/4, thanks Fabian Grünbichler: - convert orig Cargo.lock to v1 format - d/patches: update for 1.41.0 import - Update Files-Excluded for new upstream version 1.41.0 - d/update-version.sh: fix python3 compat - drop patches which were applied upstream - rebase and update patches - don't attempt to install llvm codegen so - update d/copyright - update changelog and versions - (adjusted somewhat by me) -- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Mon, 02 Mar 2020 21:22:50 +0100 rustc (1.40.0+dfsg1+llvm-5ubuntu1) focal; urgency=medium * Merge from Debian unstable (LP #1856851). Remaining changes: - Use the bundled llvm to avoid having to do llvm updates in order to deliver rust updates - update debian/config.toml.in - update debian/control - update debian/copyright - update debian/rules - Build-Depend on libc6-dbg on armhf, to workaround a crash in ld.so during some debuginfo tests - update debian/control - Add a hack to ensure the stage0 compiler is extracted to the correct location - update debian/make_orig-stage0_tarball.sh - Scrub -g from CFLAGS and CXXFLAGS in order to let rustbuild control whether LLVM is compiled with debug symbols - update debian/rules - On i386, only build debuginfo for libstd - update debian/rules - Ignore all test failures on every architecture - update debian/rules - Version the Build-Conflict on gdb-minimal as gdb now Provides it - update debian/control - Adjust the rustc Breaks/Replaces libstd-rust-dev version to fix an upgrade issue - update debian/control - Adjust debian/watch to include +llvm in upstream version. - update debian/watch - Add Build-Depends-Indep: libssl-dev * Dropped change, now fixed in Debian: - Run build scripts with Python 3. -- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Sat, 29 Feb 2020 16:21:22 +0000

Modifications :
  1. Download patch src/ci/docker/x86_64-gnu-tools/checktools.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/x86_64-gnu-tools/checktools.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/x86_64-gnu-tools/checktools.sh 2020-01-27 15:34:02.000000000 +0000 @@ -3,18 +3,6 @@ set -eu X_PY="$1" -TOOLSTATE_FILE="$(realpath -m $2)" -OS="$3" -COMMIT="$(git rev-parse HEAD)" -CHANGED_FILES="$(git diff --name-status HEAD HEAD^)" -SIX_WEEK_CYCLE="$(( ($(date +%s) / 86400 - 20) % 42 ))" -# ^ Number of days after the last promotion of beta. -# Its value is 41 on the Tuesday where "Promote master to beta (T-2)" happens. -# The Wednesday after this has value 0. -# We track this value to prevent regressing tools in the last week of the 6-week cycle. - -mkdir -p "$(dirname $TOOLSTATE_FILE)" -touch "$TOOLSTATE_FILE" # Try to test all the tools and store the build/test success in the TOOLSTATE_FILE @@ -34,106 +22,4 @@ python2.7 "$X_PY" test --no-fail-fast \ set -e -cat "$TOOLSTATE_FILE" -echo - -# This function checks if a particular tool is *not* in status "test-pass". -check_tool_failed() { - grep -vq '"'"$1"'":"test-pass"' "$TOOLSTATE_FILE" -} - -# This function checks that if a tool's submodule changed, the tool's state must improve -verify_submodule_changed() { - echo "Verifying status of $1..." - if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]$2$"; then - echo "This PR updated '$2', verifying if status is 'test-pass'..." - if check_tool_failed "$1"; then - echo - echo "⚠️ We detected that this PR updated '$1', but its tests failed." - echo - echo "If you do intend to update '$1', please check the error messages above and" - echo "commit another update." - echo - echo "If you do NOT intend to update '$1', please ensure you did not accidentally" - echo "change the submodule at '$2'. You may ask your reviewer for the" - echo "proper steps." - exit 3 - fi - fi -} - -# deduplicates the submodule check and the assertion that on beta some tools MUST be passing. -# $1 should be "submodule_changed" to only check tools that got changed by this PR, -# or "beta_required" to check all tools that have $2 set to "beta". -check_dispatch() { - if [ "$1" = submodule_changed ]; then - # ignore $2 (branch id) - verify_submodule_changed $3 $4 - elif [ "$2" = beta ]; then - echo "Requiring test passing for $3..." - if check_tool_failed "$3"; then - exit 4 - fi - fi -} - -# List all tools here. -# This function gets called with "submodule_changed" for each PR that changed a submodule, -# and with "beta_required" for each PR that lands on beta/stable. -# The purpose of this function is to *reject* PRs if a tool is not "test-pass" and -# (a) the tool's submodule has been updated, or (b) we landed on beta/stable and the -# tool has to "test-pass" on that branch. -status_check() { - check_dispatch $1 beta book src/doc/book - check_dispatch $1 beta nomicon src/doc/nomicon - check_dispatch $1 beta reference src/doc/reference - check_dispatch $1 beta rust-by-example src/doc/rust-by-example - check_dispatch $1 beta edition-guide src/doc/edition-guide - check_dispatch $1 beta rls src/tools/rls - check_dispatch $1 beta rustfmt src/tools/rustfmt - check_dispatch $1 beta clippy-driver src/tools/clippy - # These tools are not required on the beta/stable branches, but they *do* cause - # PRs to fail if a submodule update does not fix them. - # They will still cause failure during the beta cutoff week, unless `checkregression.py` - # exempts them from that. - check_dispatch $1 nightly miri src/tools/miri - check_dispatch $1 nightly embedded-book src/doc/embedded-book - check_dispatch $1 nightly rustc-guide src/doc/rustc-guide -} - -# If this PR is intended to update one of these tools, do not let the build pass -# when they do not test-pass. - -status_check "submodule_changed" - -CHECK_NOT="$(readlink -f "$(dirname $0)/checkregression.py")" -# This callback is called by `commit_toolstate_change`, see `repo.sh`. -change_toolstate() { - # only update the history - if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then - echo 'Toolstate is not changed. Not updating.' - else - if [ $SIX_WEEK_CYCLE -ge 35 ]; then - # Reject any regressions during the week before beta cutoff. - python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed - fi - sed -i "1 a\\ -$COMMIT\t$(cat "$TOOLSTATE_FILE") -" "history/$OS.tsv" - fi -} - -if [ "$RUST_RELEASE_CHANNEL" = nightly ]; then - if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then - . "$(dirname $0)/repo.sh" - MESSAGE_FILE=$(mktemp -t msg.XXXXXX) - echo "($OS CI update)" > "$MESSAGE_FILE" - commit_toolstate_change "$MESSAGE_FILE" change_toolstate - rm -f "$MESSAGE_FILE" - fi - exit 0 -fi - -# abort compilation if an important tool doesn't build -# (this code is reachable if not on the nightly channel) -status_check "beta_required" +python2.7 "$X_PY" test check-tools
  2. Download patch src/ci/scripts/run-build-from-ci.sh

    --- 1.40.0+dfsg1-5/src/ci/scripts/run-build-from-ci.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/scripts/run-build-from-ci.sh 2020-01-27 15:34:02.000000000 +0000 @@ -0,0 +1,21 @@ +#!/bin/bash +# Start the CI build. You shouldn't run this locally: call either src/ci/run.sh +# or src/ci/docker/run.sh instead. + +set -euo pipefail +IFS=$'\n\t' + +source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" + +export CI="true" +export SRC=. + +# Remove any preexisting rustup installation since it can interfere +# with the cargotest step and its auto-detection of things like Clippy in +# the environment +rustup self uninstall -y || true +if [ -z "${IMAGE+x}" ]; then + src/ci/run.sh +else + src/ci/docker/run.sh "${IMAGE}" +fi
  3. Download patch src/ci/docker/mingw-check/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/mingw-check/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/mingw-check/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -19,7 +19,10 @@ RUN apt-get update && apt-get install -y COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh +COPY mingw-check/validate-toolstate.sh /scripts/ + ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1 ENV SCRIPT python2.7 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \ python2.7 ../x.py build --stage 0 src/tools/build-manifest && \ - python2.7 ../x.py test --stage 0 src/tools/compiletest + python2.7 ../x.py test --stage 0 src/tools/compiletest && \ + /scripts/validate-toolstate.sh
  4. Download patch src/ci/docker/dist-various-1/install-mipsel-musl.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-various-1/install-mipsel-musl.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-various-1/install-mipsel-musl.sh 2020-01-27 15:34:02.000000000 +0000 @@ -5,7 +5,7 @@ mkdir /usr/local/mipsel-linux-musl # Note that this originally came from: # https://downloads.openwrt.org/snapshots/trunk/malta/generic/ # OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 -URL="https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc" +URL="https://ci-mirrors.rust-lang.org/rustc" FILE="OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2" curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mipsel-linux-musl --strip-components=2
  5. Download patch src/ci/docker/x86_64-gnu-tools/checkregression.py

    --- 1.40.0+dfsg1-5/src/ci/docker/x86_64-gnu-tools/checkregression.py 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/x86_64-gnu-tools/checkregression.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -## This script has two purposes: detect any tool that *regressed*, which is used -## during the week before the beta branches to reject PRs; and detect any tool -## that *changed* to see if we need to update the toolstate repo. - -import sys -import json - -# Regressions for these tools during the beta cutoff week do not cause failure. -# See `status_check` in `checktools.sh` for tools that have to pass on the -# beta/stable branches. -REGRESSION_OK = ["rustc-guide", "miri", "embedded-book"] - -if __name__ == '__main__': - os_name = sys.argv[1] - toolstate_file = sys.argv[2] - current_state = sys.argv[3] - verb = sys.argv[4] # 'regressed' or 'changed' - - with open(toolstate_file, 'r') as f: - toolstate = json.load(f) - with open(current_state, 'r') as f: - current = json.load(f) - - regressed = False - for cur in current: - tool = cur['tool'] - state = cur[os_name] - new_state = toolstate.get(tool, '') - if verb == 'regressed': - updated = new_state < state - elif verb == 'changed': - updated = new_state != state - else: - print('Unknown verb {}'.format(updated)) - sys.exit(2) - if updated: - print( - 'The state of "{}" has {} from "{}" to "{}"' - .format(tool, verb, state, new_state) - ) - if not (verb == 'regressed' and tool in REGRESSION_OK): - regressed = True - - if regressed: - sys.exit(1)
  6. Download patch debian/patches/d-dont-download-stage0.patch

    --- 1.40.0+dfsg1-5/debian/patches/d-dont-download-stage0.patch 2019-04-29 23:15:49.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/d-dont-download-stage0.patch 2020-03-02 12:47:04.000000000 +0000 @@ -38,12 +38,12 @@ This patch header follows DEP-3: http:// delete_if_present(temp_path, verbose) -@@ -373,7 +374,7 @@ +@@ -401,7 +401,7 @@ url = "{}/dist/{}".format(self._download_url, self.date) tarball = os.path.join(rustc_cache, filename) - if not os.path.exists(tarball): + if True: get("{}/{}".format(url, filename), tarball, verbose=self.verbose) - unpack(tarball, self.bin_root(), match=pattern, verbose=self.verbose) + unpack(tarball, tarball_suffix, self.bin_root(), match=pattern, verbose=self.verbose)
  7. Download patch src/ci/run.sh

    --- 1.40.0+dfsg1-5/src/ci/run.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/run.sh 2020-01-27 15:34:02.000000000 +0000 @@ -23,9 +23,7 @@ fi ci_dir=`cd $(dirname $0) && pwd` source "$ci_dir/shared.sh" -branch_name=$(getCIBranch) - -if [ ! isCI ] || [ "$branch_name" = "auto" ] || [ "$branch_name" = "try" ]; then +if ! isCI || isCiBranch auto || isCiBranch beta; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests" fi
  8. Download patch debian/patches/u-riscv64-compiletest.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-compiletest.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-compiletest.patch 2020-04-08 00:12:30.000000000 +0000 @@ -0,0 +1,10 @@ +--- a/src/tools/compiletest/src/util.rs ++++ b/src/tools/compiletest/src/util.rs +@@ -67,6 +67,7 @@ + ("powerpc", "powerpc"), + ("powerpc64", "powerpc64"), + ("powerpc64le", "powerpc64"), ++ ("riscv64gc", "riscv64"), + ("s390x", "s390x"), + ("sparc", "sparc"), + ("sparc64", "sparc64"),
  9. Download patch debian/patches/riscv64-dsymutil-atomic.patch

    --- 1.40.0+dfsg1-5/debian/patches/riscv64-dsymutil-atomic.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/riscv64-dsymutil-atomic.patch 2020-04-08 00:18:39.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Link dsymutil with -latomic when required + dsymutil requires -latomic on riscv64. +Author: William Grant <wgrant@ubuntu.com> + +Index: rustc-1.41.0+dfsg1+llvm/src/llvm-project/llvm/tools/dsymutil/CMakeLists.txt +=================================================================== +--- rustc-1.41.0+dfsg1+llvm.orig/src/llvm-project/llvm/tools/dsymutil/CMakeLists.txt ++++ rustc-1.41.0+dfsg1+llvm/src/llvm-project/llvm/tools/dsymutil/CMakeLists.txt +@@ -32,3 +32,7 @@ add_llvm_tool(dsymutil + if(APPLE) + target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation") + endif(APPLE) ++ ++if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) ++ target_link_libraries(dsymutil PRIVATE atomic) ++endif()
  10. Download patch src/ci/docker/dist-x86_64-linux/build-curl.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-x86_64-linux/build-curl.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-x86_64-linux/build-curl.sh 2020-01-27 15:34:02.000000000 +0000 @@ -5,6 +5,9 @@ source shared.sh VERSION=7.66.0 +# This needs to be downloaded directly from S3, it can't go through the CDN. +# That's because the CDN is backed by CloudFront, which requires SNI and TLSv1 +# (without paying an absurd amount of money). curl https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/curl-$VERSION.tar.xz \ | xz --decompress \ | tar xf -
  11. Download patch README.md

    --- 1.40.0+dfsg1-5/README.md 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/README.md 2020-01-27 15:34:02.000000000 +0000 @@ -21,7 +21,7 @@ The Rust build system has a Python scrip the compiler. More information about it may be found by running `./x.py --help` or reading the [rustc guide][rustcguidebuild]. -[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html +[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html ### Building on *nix 1. Make sure you have installed the dependencies:
  12. Download patch src/bootstrap/native.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/native.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/native.rs 2020-01-27 15:34:02.000000000 +0000 @@ -294,11 +294,11 @@ fn check_llvm_version(builder: &Builder< let mut parts = version.split('.').take(2) .filter_map(|s| s.parse::<u32>().ok()); if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) { - if major >= 6 { + if major >= 7 { return } } - panic!("\n\nbad LLVM version: {}, need >=6.0\n\n", version) + panic!("\n\nbad LLVM version: {}, need >=7.0\n\n", version) } fn configure_cmake(builder: &Builder<'_>,
  13. Download patch debian/patches/riscv64-vendor-cc.diff

    --- 1.40.0+dfsg1-5/debian/patches/riscv64-vendor-cc.diff 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/riscv64-vendor-cc.diff 2020-04-08 00:18:39.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Fix one last ABI reference for riscv64 +Author: William Grant <wgrant@ubuntu.com> + +Index: rustc-1.41.0+dfsg1+llvm/vendor/cc/src/lib.rs +=================================================================== +--- rustc-1.41.0+dfsg1+llvm.orig/vendor/cc/src/lib.rs ++++ rustc-1.41.0+dfsg1+llvm/vendor/cc/src/lib.rs +@@ -1591,7 +1591,7 @@ impl Build { + // ABI is always soft-float right now, update this when this is no longer the + // case: + if arch.starts_with("64") { +- cmd.args.push("-mabi=lp64".into()); ++ cmd.args.push("-mabi=lp64d".into()); + } else { + cmd.args.push("-mabi=ilp32".into()); + }
  14. Download patch debian/patches/u-riscv64-cc-428.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-cc-428.patch 2020-01-04 04:16:35.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-cc-428.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -From 4981b3cdf070c5f1f8ead508d5b56ea60ec657c2 Mon Sep 17 00:00:00 2001 -From: "Wladimir J. van der Laan" <laanwj@gmail.com> -Date: Wed, 7 Aug 2019 13:57:33 +0000 -Subject: [PATCH] Add RISC-V support - -Automatically choose the most common name for the toolchain, and add the -command-line arguments to generate code that is compatible with the -chosen architecture. - -Fixes #397. ---- - src/lib.rs | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/src/lib.rs b/src/lib.rs -index 3500c527..f3b9343e 100644 ---- a/vendor/cc/src/lib.rs -+++ b/vendor/cc/src/lib.rs -@@ -1428,6 +1428,17 @@ impl Build { - cmd.args.push("-mfloat-abi=soft".into()); - } - } -+ if target.starts_with("riscv32") || target.starts_with("riscv64") { -+ // get the 32i/32imac/32imc/64gc/64imac/... part -+ let mut parts = target.split('-'); -+ if let Some(arch) = parts.next() { -+ let arch = &arch[5..]; -+ cmd.args.push(("-march=rv".to_owned() + arch).into()); -+ // ABI is always soft-float right now, update this when this is no longer the -+ // case: -+ cmd.args.push("-mabi=lp64".into()); -+ } -+ } - } - } - -@@ -1809,6 +1820,11 @@ impl Build { - "powerpc-unknown-netbsd" => Some("powerpc--netbsd"), - "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"), - "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"), -+ "riscv32i-unknown-none-elf" => Some("riscv32-unknown-elf"), -+ "riscv32imac-unknown-none-elf" => Some("riscv32-unknown-elf"), -+ "riscv32imc-unknown-none-elf" => Some("riscv32-unknown-elf"), -+ "riscv64gc-unknown-none-elf" => Some("riscv64-unknown-elf"), -+ "riscv64imac-unknown-none-elf" => Some("riscv64-unknown-elf"), - "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"), - "sparc-unknown-linux-gnu" => Some("sparc-linux-gnu"), - "sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"),
  15. Download patch debian/patches/u-riscv64-cc-460.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-cc-460.patch 2020-01-04 04:16:35.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-cc-460.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -From f0e5025a94e22a30734e338eb2a2a2e79e59486c Mon Sep 17 00:00:00 2001 -From: msizanoen1 <qtmlabs@protonmail.com> -Date: Sun, 1 Dec 2019 20:19:11 +0700 -Subject: [PATCH] Default to double-float ABI on RISC-V Linux - ---- - src/lib.rs | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - ---- a/vendor/cc/src/lib.rs -+++ b/vendor/cc/src/lib.rs -@@ -1220,7 +1220,10 @@ - cmd.push_cc_arg("-fdata-sections".into()); - } - // Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet -- if self.pic.unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv")) { -+ if self -+ .pic -+ .unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv")) -+ { - cmd.push_cc_arg("-fPIC".into()); - // PLT only applies if code is compiled with PIC support, - // and only for ELF targets. -@@ -1429,9 +1432,11 @@ - if let Some(arch) = parts.next() { - let arch = &arch[5..]; - cmd.args.push(("-march=rv".to_owned() + arch).into()); -- // ABI is always soft-float right now, update this when this is no longer the -- // case: -- if arch.starts_with("64") { -+ if target.contains("linux") && arch.starts_with("64") { -+ cmd.args.push("-mabi=lp64d".into()); -+ } else if target.contains("linux") && arch.starts_with("32") { -+ cmd.args.push("-mabi=ilp32d".into()); -+ } else if arch.starts_with("64") { - cmd.args.push("-mabi=lp64".into()); - } else { - cmd.args.push("-mabi=ilp32".into());
  16. Download patch debian/patches/u-riscv64-cc-429.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-cc-429.patch 2020-01-04 04:16:35.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-cc-429.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From b15493847edca64203a08565863d74dd08961fdc Mon Sep 17 00:00:00 2001 -From: "Wladimir J. van der Laan" <laanwj@gmail.com> -Date: Thu, 8 Aug 2019 06:52:55 +0000 -Subject: [PATCH] risc-v: Set ABI correctly for 32-bit targets - -Pick the correct softfloat mode based on bitness: - -- `-mabi=lp64` for 64 bit RISC-V -- `-mabi=ilp32` for 32-bit RISC-V - -Currently it fails for rv32 due to a conflict between the ABI and arch: - - cc1: error: ABI requires -march=rv64 ---- - src/lib.rs | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/lib.rs b/src/lib.rs -index f3b9343e..4fe1b34e 100644 ---- a/vendor/cc/src/lib.rs -+++ b/vendor/cc/src/lib.rs -@@ -1436,7 +1436,11 @@ impl Build { - cmd.args.push(("-march=rv".to_owned() + arch).into()); - // ABI is always soft-float right now, update this when this is no longer the - // case: -- cmd.args.push("-mabi=lp64".into()); -+ if arch.starts_with("64") { -+ cmd.args.push("-mabi=lp64".into()); -+ } else { -+ cmd.args.push("-mabi=ilp32".into()); -+ } - } - } - }
  17. Download patch debian/patches/d-0000-ignore-removed-submodules.patch

    --- 1.40.0+dfsg1-5/debian/patches/d-0000-ignore-removed-submodules.patch 2020-01-05 13:33:55.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/d-0000-ignore-removed-submodules.patch 2020-03-02 12:42:53.000000000 +0000 @@ -161,9 +161,20 @@ Forwarded: not-needed features --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml -@@ -12,11 +12,6 @@ +@@ -6,21 +6,15 @@ + edition = "2018" + + [features] +-linkcheck = ["mdbook-linkcheck", "codespan-reporting"] ++linkcheck = [] + + [dependencies] clap = "2.25.0" failure = "0.1" +-mdbook-linkcheck = { version = "0.5.0", optional = true } + # Keep in sync with mdbook-linkcheck. + codespan-reporting = { version = "0.5", optional = true } + -# A noop dependency that changes in the Rust repository, it's a bit of a hack. -# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` @@ -171,7 +182,7 @@ Forwarded: not-needed -rustc-workspace-hack = "1.0.0" - [dependencies.mdbook] - version = "0.3.5" + version = "0.3.0" default-features = false --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs
  18. Download patch debian/patches/u-riscv64-65953.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-65953.patch 2020-01-04 04:16:35.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-65953.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -From 539de439ad6f32e9a9a8a593299072a106786890 Mon Sep 17 00:00:00 2001 -From: Gui Andrade <gh@archshift.com> -Date: Tue, 29 Oct 2019 21:12:05 -0700 -Subject: [PATCH] Allow specifying key "llvm-abiname" in target specification - -This addresses #65024, as it allows RISC-V target specification -files to set "llvm-abiname": "lp64d". In general, it is useful -for the programmer to be able to set this codegen parameter, -which other languages usually expose under a compiler argument -like "-mabi=<XYZ>". ---- - src/librustc_codegen_llvm/back/write.rs | 3 ++- - src/librustc_codegen_llvm/llvm/ffi.rs | 1 + - src/librustc_target/spec/mod.rs | 8 +++++++- - src/rustllvm/PassWrapper.cpp | 3 ++- - 4 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs -index 52f3a1cbb5c3..fa14ce7b03c8 100644 ---- a/src/librustc_codegen_llvm/back/write.rs -+++ b/src/librustc_codegen_llvm/back/write.rs -@@ -161,6 +161,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea - let cpu = SmallCStr::new(llvm_util::target_cpu(sess)); - let features = features.join(","); - let features = CString::new(features).unwrap(); -+ let abi = SmallCStr::new(&sess.target.target.options.llvm_abiname); - let is_pie_binary = !find_features && is_pie_binary(sess); - let trap_unreachable = sess.target.target.options.trap_unreachable; - let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes; -@@ -170,7 +171,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea - Arc::new(move || { - let tm = unsafe { - llvm::LLVMRustCreateTargetMachine( -- triple.as_ptr(), cpu.as_ptr(), features.as_ptr(), -+ triple.as_ptr(), cpu.as_ptr(), features.as_ptr(), abi.as_ptr(), - code_model, - reloc_model, - opt_level, -diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs -index c69942ef3f2d..85c181ba2f31 100644 ---- a/src/librustc_codegen_llvm/llvm/ffi.rs -+++ b/src/librustc_codegen_llvm/llvm/ffi.rs -@@ -1684,6 +1684,7 @@ extern "C" { - pub fn LLVMRustCreateTargetMachine(Triple: *const c_char, - CPU: *const c_char, - Features: *const c_char, -+ Abi: *const c_char, - Model: CodeModel, - Reloc: RelocMode, - Level: CodeGenOptLevel, -diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs -index 6033d52c4411..e51772220b73 100644 ---- a/src/librustc_target/spec/mod.rs -+++ b/src/librustc_target/spec/mod.rs -@@ -793,7 +793,10 @@ pub struct TargetOptions { - pub merge_functions: MergeFunctions, - - /// Use platform dependent mcount function -- pub target_mcount: String -+ pub target_mcount: String, -+ -+ /// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers -+ pub llvm_abiname: String, - } - - impl Default for TargetOptions { -@@ -880,6 +883,7 @@ impl Default for TargetOptions { - override_export_symbols: None, - merge_functions: MergeFunctions::Aliases, - target_mcount: "mcount".to_string(), -+ llvm_abiname: "".to_string(), - } - } - } -@@ -1196,6 +1200,7 @@ impl Target { - key!(override_export_symbols, opt_list); - key!(merge_functions, MergeFunctions)?; - key!(target_mcount); -+ key!(llvm_abiname); - - if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) { - for name in array.iter().filter_map(|abi| abi.as_string()) { -@@ -1414,6 +1419,7 @@ impl ToJson for Target { - target_option_val!(override_export_symbols); - target_option_val!(merge_functions); - target_option_val!(target_mcount); -+ target_option_val!(llvm_abiname); - - if default.abi_blacklist != self.options.abi_blacklist { - d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter() -diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp -index 0cda3465dc09..5b3900ab4961 100644 ---- a/src/rustllvm/PassWrapper.cpp -+++ b/src/rustllvm/PassWrapper.cpp -@@ -343,7 +343,7 @@ extern "C" const char* LLVMRustGetHostCPUName(size_t *len) { - - extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( - const char *TripleStr, const char *CPU, const char *Feature, -- LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc, -+ const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc, - LLVMRustCodeGenOptLevel RustOptLevel, bool UseSoftFloat, - bool PositionIndependentExecutable, bool FunctionSections, - bool DataSections, -@@ -374,6 +374,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( - Options.FunctionSections = FunctionSections; - Options.MCOptions.AsmVerbose = AsmComments; - Options.MCOptions.PreserveAsmComments = AsmComments; -+ Options.MCOptions.ABIName = ABIStr; - - if (TrapUnreachable) { - // Tell LLVM to codegen `unreachable` into an explicit trap instruction.
  19. Download patch CONTRIBUTING.md

    --- 1.40.0+dfsg1-5/CONTRIBUTING.md 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/CONTRIBUTING.md 2020-01-27 15:34:02.000000000 +0000 @@ -105,7 +105,7 @@ contributions to the compiler and the st really useful commands to the build system (`./x.py`), which could save you a lot of time. -[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html +[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html ## Pull Requests [pull-requests]: #pull-requests @@ -150,13 +150,13 @@ All pull requests are reviewed by anothe request. If you want to request that a specific person reviews your pull request, -you can add an `r?` to the message. For example, [Steve][steveklabnik] usually reviews +you can add an `r?` to the pull request description. For example, [Steve][steveklabnik] usually reviews documentation changes. So if you were to make a documentation change, add r? @steveklabnik -to the end of the message, and @rust-highfive will assign [@steveklabnik][steveklabnik] instead -of a random person. This is entirely optional. +to the end of the pull request description, and [@rust-highfive][rust-highfive] will assign +[@steveklabnik][steveklabnik] instead of a random person. This is entirely optional. After someone has reviewed your pull request, they will leave an annotation on the pull request with an `r+`. It will look something like this:
  20. Download patch src/ci/publish_toolstate.sh

    --- 1.40.0+dfsg1-5/src/ci/publish_toolstate.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/publish_toolstate.sh 2020-01-27 15:34:02.000000000 +0000 @@ -0,0 +1,33 @@ +#!/bin/sh + +set -eu + +# The following lines are also found in src/bootstrap/toolstate.rs, +# so if updating here, please also update that file. + +export MESSAGE_FILE=$(mktemp -t msg.XXXXXX) + +git config --global user.email '7378925+rust-toolstate-update@users.noreply.github.com' +git config --global user.name 'Rust Toolstate Update' +git config --global credential.helper store +printf 'https://%s:x-oauth-basic@github.com\n' "$TOOLSTATE_REPO_ACCESS_TOKEN" \ + > "$HOME/.git-credentials" +git clone --depth=1 $TOOLSTATE_REPO + +cd rust-toolstate +FAILURE=1 +for RETRY_COUNT in 1 2 3 4 5; do + # The purpose is to publish the new "current" toolstate in the toolstate repo. + "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" \ + "$(git log --format=%s -n1 HEAD)" \ + "$MESSAGE_FILE" \ + "$TOOLSTATE_REPO_ACCESS_TOKEN" + # `git commit` failing means nothing to commit. + FAILURE=0 + git commit -a -F "$MESSAGE_FILE" || break + # On failure randomly sleep for 0 to 3 seconds as a crude way to introduce jittering. + git push origin master && break || sleep $(LC_ALL=C tr -cd 0-3 < /dev/urandom | head -c 1) + FAILURE=1 + git fetch origin master + git reset --hard origin/master +done
  21. Download patch debian/rules

    --- 1.40.0+dfsg1-5/debian/rules 2020-01-05 13:33:55.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/rules 2020-04-08 00:13:35.000000000 +0000 @@ -27,21 +27,17 @@ endif include debian/architecture.mk export DEB_HOST_RUST_TYPE +# Let rustbuild control whether LLVM is compiled with debug symbols, rather +# than compiling with debug symbols unconditionally, which will fail on +# 32-bit architectures +CFLAGS := $(shell echo $(CFLAGS) | sed -e 's/\-g//') +CXXFLAGS := $(shell echo $(CFLAGS) | sed -e 's/\-g//') + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_DESTDIR := $(CURDIR)/debian/tmp -# Use system LLVM (comment out to use vendored LLVM) -LLVM_VERSION = 9 -OLD_LLVM_VERSION = 8 -# Make it easier to test against a custom LLVM -ifneq (,$(LLVM_DESTDIR)) -LLVM_LIBRARY_PATH := $(LLVM_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH):$(LLVM_DESTDIR)/usr/lib -LD_LIBRARY_PATH := $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):$(LLVM_LIBRARY_PATH),$(LLVM_LIBRARY_PATH)) -export LD_LIBRARY_PATH -endif - RUSTBUILD = RUST_BACKTRACE=1 python3 src/bootstrap/bootstrap.py RUSTBUILD_FLAGS = --config debian/config.toml -vvv --on-fail env RUSTBUILD_TEST = $(RUSTBUILD) test --no-fail-fast @@ -150,14 +146,12 @@ debian/config.toml: debian/config.toml.i -DDEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \ -DDEB_TARGET_GNU_TYPE="$(DEB_TARGET_GNU_TYPE)" \ -DMAKE_OPTIMISATIONS="$(MAKE_OPTIMISATIONS)" \ - -DLLVM_DESTDIR="$(LLVM_DESTDIR)" \ - -DLLVM_VERSION="$(LLVM_VERSION)" \ -DRUST_DESTDIR="$(RUST_DESTDIR)" \ "$<" > "$@" if $(DOWNLOAD_BOOTSTRAP) || [ $(HAVE_BINARY_TARBALL) != 0 ]; \ then sed -i -e '/^rustc = /d' -e '/^cargo = /d' "$@"; fi # Work around low-memory (32-bit) architectures: https://github.com/rust-lang/rust/issues/45854 -ifneq (,$(filter $(DEB_BUILD_ARCH), armhf armel mips mipsel powerpc powerpcspe)) +ifneq (,$(filter $(DEB_BUILD_ARCH), armhf armel i386 mips mipsel powerpc powerpcspe)) sed -i -e 's/^debuginfo-level = .*/debuginfo-level = 0/g' "$@" endif @@ -166,8 +160,6 @@ debian/rust-src.%: debian/rust-src.%.in "$<" > "$@" debian/dh_auto_configure.stamp: debian/config.toml - # fail the build if we have any instances of OLD_LLVM_VERSION in debian, except for debian/changelog - ! grep --color=always -i 'll\(..\|d\)-\?$(subst .,\.,$(OLD_LLVM_VERSION))' --exclude=changelog --exclude='*.patch' --exclude-dir='.debhelper' -R debian # fail the build if we accidentally vendored openssl, indicates we pulled in unnecessary dependencies test ! -e vendor/openssl # fail the build if we didn't update d-ignore-error-detail-diff.patch @@ -203,7 +195,7 @@ endif override_dh_auto_clean: $(RM) -rf build tmp .cargo debian/cargo_home config.stamp config.mk Makefile - $(RM) -rf $(TEST_LOG) debian/config.toml debian/rust-src.install debian/rust-src.links debian/*.stamp + $(RM) -rf debian/config.toml debian/rust-src.install debian/rust-src.links debian/*.stamp $(RM) -rf $(SRC_CLEAN) config.toml debian/dh_auto_build.stamp: @@ -217,51 +209,19 @@ ifeq (true,$(BUILD_DOCS)) $(RUSTBUILD) doc $(RUSTBUILD_FLAGS) endif -TEST_LOG = debian/rustc-tests.log -# This is advertised as "5 tests failed" in README.Debian because our counting -# method is imprecise and in practise we count some failures twice. -FAILURES_ALLOWED = 8 -ifneq (,$(filter $(DEB_BUILD_ARCH), ppc64 arm64 mips64el i386)) - FAILURES_ALLOWED = 12 -endif -ifneq (,$(filter $(DEB_BUILD_ARCH), mips mipsel riscv64 s390x)) - FAILURES_ALLOWED = 24 -endif -ifneq (,$(filter $(DEB_BUILD_ARCH), powerpc powerpcspe sparc64 x32)) - FAILURES_ALLOWED = 180 -endif -FAILED_TESTS = grep "FAILED\|^command did not execute successfully" $(TEST_LOG) | grep -v '^test result: FAILED' +RUN_TESTS = \ + if $(1); then \ + : ; \ + else \ + echo "====================================================="; \ + echo "WARNING: Ignoring test failures in the rust testsuite"; \ + echo "====================================================="; \ + fi + override_dh_auto_test-arch: - # ensure that rustc_llvm is actually dynamically linked to libLLVM - set -e; find build/*/stage2/lib/rustlib/* -name '*rustc_llvm*.so' | \ - while read x; do \ - stat -c '%s %n' "$$x"; \ - objdump -p "$$x" | grep -q "NEEDED.*LLVM"; \ - test "$$(stat -c %s "$$x")" -lt 6000000; \ - done ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES))) ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS))) - { $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS); echo $$?; } | tee -a $(TEST_LOG) - # test that the log has at least 1 pass, to prevent e.g. #57709 - grep -l "^test .* \.\.\. ok$$" $(TEST_LOG) - echo "==== Debian rustc test report ===="; \ - echo "Specific test failures:"; \ - $(FAILED_TESTS); \ - num_failures=$$($(FAILED_TESTS) | wc -l); \ - exit_code=$$(tail -n1 $(TEST_LOG)); \ - echo "Summary: exit code $$exit_code, counted $$num_failures tests failed."; \ - echo -n "$(FAILURES_ALLOWED) maximum allowed. "; \ - if test "$$num_failures" -eq 0 -a "$$exit_code" -ne 0; then \ - echo "Aborting just in case, because we missed counting some test failures."; \ - echo "This could happen if we failed to build the tests, or if the testsuite runner is buggy."; \ - false; \ - elif test "$$num_failures" -le $(FAILURES_ALLOWED); then \ - echo "Continuing..."; \ - else \ - echo "Aborting the build."; \ - echo "Check the logs further above for details."; \ - false; \ - fi + $(call RUN_TESTS,$(RUSTBUILD_TEST) --no-fail-fast $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS)) # don't continue if RUSTBUILD_TEST_FLAGS is non-empty test -z "$(RUSTBUILD_TEST_FLAGS)" endif @@ -274,8 +234,8 @@ ifeq (, $(filter nocheck,$(DEB_BUILD_OPT -$(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS) \ --host $(DEB_BUILD_RUST_TYPE) --target wasm32-unknown-unknown src/libstd ifeq (true,$(BUILD_DOCS)) - # Run all rules that test the docs, i.e. that depend on default:doc - $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) src/tools/linkchecker + # Run all rules that test the docs, i.e. in step.rs that depend on default:doc + $(call RUN_TESTS,$(RUSTBUILD_TEST) --no-fail-fast src/tools/linkchecker $(RUSTBUILD_FLAGS)) endif test -z "$(RUSTBUILD_TEST_FLAGS)" endif @@ -324,7 +284,6 @@ override_dh_install-arch: dh_install dh_install -p$(LIBSTD_PKG) usr/lib/$(DEB_HOST_MULTIARCH)/ dh_install -plibstd-rust-dev usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/lib/ - dh_install -prustc usr/lib/rustlib/$(DEB_HOST_RUST_TYPE)/codegen-backends/ override_dh_install-indep: debian/rust-src.install debian/rust-src.links dh_install @@ -333,6 +292,8 @@ override_dh_install-indep: debian/rust-s debian/rust-gdb/usr/share/rust-gdb/*.py \ debian/rust-lldb/usr/share/rust-lldb/*.py $(RM) -rf $(SRC_CLEAN:%=debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION)/%) + # Get rid of src/llvm-project + $(RM) -rf debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION)/src/llvm-project # Get rid of lintian warnings find debian/rust-src/usr/src/rustc-$(RUST_LONG_VERSION) \ \( -name .gitignore \
  22. Download patch src/ci/docker/scripts/freebsd-toolchain.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/scripts/freebsd-toolchain.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/scripts/freebsd-toolchain.sh 2020-01-27 15:34:02.000000000 +0000 @@ -59,7 +59,7 @@ done # Originally downloaded from: # https://download.freebsd.org/ftp/releases/${freebsd_arch}/${freebsd_version}-RELEASE/base.txz -URL=https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2019-04-04-freebsd-${freebsd_arch}-${freebsd_version}-RELEASE-base.txz +URL=https://ci-mirrors.rust-lang.org/rustc/2019-04-04-freebsd-${freebsd_arch}-${freebsd_version}-RELEASE-base.txz curl "$URL" | tar xJf - -C "$sysroot" --wildcards "${files_to_extract[@]}" # Fix up absolute symlinks from the system image. This can be removed
  23. Download patch debian/make_orig-stage0_tarball.sh

    --- 1.40.0+dfsg1-5/debian/make_orig-stage0_tarball.sh 2019-04-29 23:15:49.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/make_orig-stage0_tarball.sh 2020-03-02 12:40:37.000000000 +0000 @@ -11,6 +11,7 @@ upstream_bootstrap_arch="${upstream_boot rm -f stage0/*/*.sha256 mkdir -p stage0 build && ln -sf ../stage0 build/cache +touch stage0/hack if [ -n "$(find stage0/ -type f)" ]; then echo >&2 "$0: NOTE: extra artifacts in stage0/ will be included:" find stage0/ -type f
  24. Download patch src/ci/docker/x86_64-gnu-llvm-7/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/x86_64-gnu-llvm-7/Dockerfile 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/x86_64-gnu-llvm-7/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -0,0 +1,35 @@ +FROM ubuntu:18.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + make \ + file \ + curl \ + ca-certificates \ + python2.7 \ + git \ + cmake \ + sudo \ + gdb \ + llvm-7-tools \ + libedit-dev \ + libssl-dev \ + pkg-config \ + zlib1g-dev \ + xz-utils + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +# using llvm-link-shared due to libffi issues -- see #34486 +ENV RUST_CONFIGURE_ARGS \ + --build=x86_64-unknown-linux-gnu \ + --llvm-root=/usr/lib/llvm-7 \ + --enable-llvm-link-shared +ENV SCRIPT python2.7 ../x.py test src/tools/tidy && python2.7 ../x.py test + +# The purpose of this container isn't to test with debug assertions and +# this is run on all PRs, so let's get speedier builds by disabling these extra +# checks. +ENV NO_DEBUG_ASSERTIONS=1 +ENV NO_LLVM_ASSERTIONS=1
  25. Download patch src/ci/docker/dist-x86_64-netbsd/build-netbsd-toolchain.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-x86_64-netbsd/build-netbsd-toolchain.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-x86_64-netbsd/build-netbsd-toolchain.sh 2020-01-27 15:34:02.000000000 +0000 @@ -25,7 +25,7 @@ cd netbsd mkdir -p /x-tools/x86_64-unknown-netbsd/sysroot -URL=https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc +URL=https://ci-mirrors.rust-lang.org/rustc # Originally from ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-$BSD/source/sets/*.tgz curl $URL/2018-03-01-netbsd-src.tgz | tar xzf -
  26. Download patch debian/patches/u-rustbuild-rustflags.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-rustbuild-rustflags.patch 2019-11-30 21:51:28.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-rustbuild-rustflags.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -Forwarded: https://github.com/rust-lang/rust/pull/66834 ---- a/src/bootstrap/bootstrap.py -+++ b/src/bootstrap/bootstrap.py -@@ -628,7 +628,9 @@ - env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ - (os.pathsep + env["LIBRARY_PATH"]) \ - if "LIBRARY_PATH" in env else "" -- env["RUSTFLAGS"] = "-Cdebuginfo=2 " -+ # preserve existing RUSTFLAGS -+ env.setdefault("RUSTFLAGS", "") -+ env["RUSTFLAGS"] += " -Cdebuginfo=2" - - build_section = "target.{}".format(self.build_triple()) - target_features = [] -@@ -637,13 +639,13 @@ - elif self.get_toml("crt-static", build_section) == "false": - target_features += ["-crt-static"] - if target_features: -- env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " " -+ env["RUSTFLAGS"] += " -C target-feature=" + (",".join(target_features)) - target_linker = self.get_toml("linker", build_section) - if target_linker is not None: -- env["RUSTFLAGS"] += "-C linker=" + target_linker + " " -- env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes " -+ env["RUSTFLAGS"] += " -C linker=" + target_linker -+ env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes" - if self.get_toml("deny-warnings", "rust") != "false": -- env["RUSTFLAGS"] += "-Dwarnings " -+ env["RUSTFLAGS"] += " -Dwarnings" - - env["PATH"] = os.path.join(self.bin_root(), "bin") + \ - os.pathsep + env["PATH"]
  27. Download patch src/bootstrap/check.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/check.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/check.rs 2020-01-27 15:34:02.000000000 +0000 @@ -1,11 +1,10 @@ //! Implementation of compiling the compiler and standard library, in "check"-based modes. -use crate::compile::{run_cargo, std_cargo, rustc_cargo, rustc_cargo_env, - add_to_sysroot}; +use crate::compile::{run_cargo, std_cargo, rustc_cargo, add_to_sysroot}; use crate::builder::{RunConfig, Builder, Kind, ShouldRun, Step}; use crate::tool::{prepare_tool_cargo, SourceType}; use crate::{Compiler, Mode}; -use crate::cache::{INTERNER, Interned}; +use crate::cache::Interned; use std::path::PathBuf; #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -97,7 +96,7 @@ impl Step for Rustc { let mut cargo = builder.cargo(compiler, Mode::Rustc, target, cargo_subcommand(builder.kind)); - rustc_cargo(builder, &mut cargo); + rustc_cargo(builder, &mut cargo, target); builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target)); run_cargo(builder, @@ -114,55 +113,6 @@ impl Step for Rustc { } #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct CodegenBackend { - pub target: Interned<String>, - pub backend: Interned<String>, -} - -impl Step for CodegenBackend { - type Output = (); - const ONLY_HOSTS: bool = true; - const DEFAULT: bool = true; - - fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.all_krates("rustc_codegen_llvm") - } - - fn make_run(run: RunConfig<'_>) { - let backend = run.builder.config.rust_codegen_backends.get(0); - let backend = backend.cloned().unwrap_or_else(|| { - INTERNER.intern_str("llvm") - }); - run.builder.ensure(CodegenBackend { - target: run.target, - backend, - }); - } - - fn run(self, builder: &Builder<'_>) { - let compiler = builder.compiler(0, builder.config.build); - let target = self.target; - let backend = self.backend; - - builder.ensure(Rustc { target }); - - let mut cargo = builder.cargo(compiler, Mode::Codegen, target, - cargo_subcommand(builder.kind)); - cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); - rustc_cargo_env(builder, &mut cargo); - - // We won't build LLVM if it's not available, as it shouldn't affect `check`. - - run_cargo(builder, - cargo, - args(builder.kind), - &codegen_backend_stamp(builder, compiler, target, backend), - vec![], - true); - } -} - -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct Rustdoc { pub target: Interned<String>, } @@ -231,16 +181,6 @@ pub fn librustc_stamp( builder.cargo_out(compiler, Mode::Rustc, target).join(".librustc-check.stamp") } -/// Cargo's output path for librustc_codegen_llvm in a given stage, compiled by a particular -/// compiler for the specified target and backend. -fn codegen_backend_stamp(builder: &Builder<'_>, - compiler: Compiler, - target: Interned<String>, - backend: Interned<String>) -> PathBuf { - builder.cargo_out(compiler, Mode::Codegen, target) - .join(format!(".librustc_codegen_llvm-{}-check.stamp", backend)) -} - /// Cargo's output path for rustdoc in a given stage, compiled by a particular /// compiler for the specified target. pub fn rustdoc_stamp(
  28. Download patch RELEASES.md
  29. Download patch src/ci/docker/dist-x86_64-linux/build-openssl.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-x86_64-linux/build-openssl.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-x86_64-linux/build-openssl.sh 2020-01-27 15:34:02.000000000 +0000 @@ -4,6 +4,10 @@ set -ex source shared.sh VERSION=1.0.2k + +# This needs to be downloaded directly from S3, it can't go through the CDN. +# That's because the CDN is backed by CloudFront, which requires SNI and TLSv1 +# (without paying an absurd amount of money). URL=https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/openssl-$VERSION.tar.gz curl $URL | tar xzf -
  30. Download patch debian/control

    --- 1.40.0+dfsg1-5/debian/control 2020-01-02 22:18:57.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/control 2020-03-02 14:32:31.000000000 +0000 @@ -1,7 +1,8 @@ Source: rustc Section: devel Priority: optional -Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> Uploaders: Ximin Luo <infinity0@debian.org>, Sylvestre Ledru <sylvestre@debian.org> @@ -10,11 +11,8 @@ Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.17.14), python3:native, cargo:native (>= 0.40.0) <!pkg.rustc.dlstage0>, - rustc:native (>= 1.39.0+dfsg) <!pkg.rustc.dlstage0>, - rustc:native (<= 1.40.0++) <!pkg.rustc.dlstage0>, - llvm-9-dev:native, - llvm-9-tools:native, - libllvm9 (>= 1:9.0.1-2), + rustc:native (>= 1.40.0+dfsg) <!pkg.rustc.dlstage0>, + rustc:native (<= 1.41.0++) <!pkg.rustc.dlstage0>, autotools-dev, cmake (>= 3.0) | cmake3, # needed by some vendor crates @@ -24,19 +22,23 @@ Build-Depends: debhelper (>= 9), zlib1g-dev, # used by rust-installer liblzma-dev:native, +# Required for llvm build + m4, # test dependencies: binutils (>= 2.26) <!nocheck> | binutils-2.26 <!nocheck>, git <!nocheck>, procps <!nocheck>, # below are optional tools even for 'make check' gdb (>= 7.12) <!nocheck>, + libc6-dbg [armhf], # Work around #864741. The version constraint for gdb above should already do # that, but this will keep things covered even in the case that they change # gdb-minimal to do a versioned Provides: gdb. # Extra build-deps needed for x.py to download stuff in pkg.rustc.dlstage0. curl <pkg.rustc.dlstage0>, ca-certificates <pkg.rustc.dlstage0>, -Build-Conflicts: gdb-minimal <!nocheck> +Build-Depends-Indep: libssl-dev +Build-Conflicts: gdb-minimal (<< 8.1-0ubuntu6) <!nocheck> # ^ That version of rustc is broken Standards-Version: 4.2.1 Homepage: http://www.rust-lang.org/ @@ -49,10 +51,10 @@ Multi-Arch: allowed Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-dev (= ${binary:Version}), gcc, libc-dev, binutils (>= 2.26) -Recommends: cargo (>= 0.41.0~~), cargo (<< 0.42.0~~), rust-gdb | rust-lldb +Recommends: cargo (>= 0.42.0~~), cargo (<< 0.43.0~~), rust-gdb | rust-lldb Suggests: rust-doc, rust-src, lld-9 -Replaces: libstd-rust-dev (<< 1.25.0+dfsg1-2~~) -Breaks: libstd-rust-dev (<< 1.25.0+dfsg1-2~~) +Replaces: libstd-rust-dev (<< 1.26.2+dfsg1+llvm-0ubuntu1~~) +Breaks: libstd-rust-dev (<< 1.26.2+dfsg1+llvm-0ubuntu1~~) Description: Rust systems programming language Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly @@ -66,7 +68,7 @@ Description: Rust systems programming la generic programming and meta-programming, in both static and dynamic styles. -Package: libstd-rust-1.40 +Package: libstd-rust-1.41 Section: libs Architecture: any Multi-Arch: same @@ -91,7 +93,7 @@ Package: libstd-rust-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-1.40 (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libstd-rust-1.41 (= ${binary:Version}) Description: Rust standard libraries - development files Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly
  31. Download patch src/bootstrap/util.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/util.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/util.rs 2020-01-27 15:34:02.000000000 +0000 @@ -15,6 +15,7 @@ use build_helper::t; use crate::config::Config; use crate::builder::Builder; +use crate::cache::Interned; /// Returns the `name` as the filename of a static library for `target`. pub fn staticlib(name: &str, target: &str) -> String { @@ -262,6 +263,8 @@ pub enum CiEnv { None, /// The Azure Pipelines environment, for Linux (including Docker), Windows, and macOS builds. AzurePipelines, + /// The GitHub Actions environment, for Linux (including Docker), Windows and macOS builds. + GitHubActions, } impl CiEnv { @@ -269,6 +272,8 @@ impl CiEnv { pub fn current() -> CiEnv { if env::var("TF_BUILD").ok().map_or(false, |e| &*e == "True") { CiEnv::AzurePipelines + } else if env::var("GITHUB_ACTIONS").ok().map_or(false, |e| &*e == "true") { + CiEnv::GitHubActions } else { CiEnv::None } @@ -302,3 +307,15 @@ pub fn forcing_clang_based_tests() -> bo false } } + +pub fn use_host_linker(target: &Interned<String>) -> bool { + // FIXME: this information should be gotten by checking the linker flavor + // of the rustc target + !( + target.contains("emscripten") || + target.contains("wasm32") || + target.contains("nvptx") || + target.contains("fortanix") || + target.contains("fuchsia") + ) +}
  32. Download patch src/bootstrap/lib.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/lib.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/lib.rs 2020-01-27 15:34:02.000000000 +0000 @@ -169,7 +169,6 @@ mod job { pub use crate::config::Config; use crate::flags::Subcommand; use crate::cache::{Interned, INTERNER}; -use crate::toolstate::ToolState; const LLVM_TOOLS: &[&str] = &[ "llvm-nm", // used to inspect binaries; it shows symbol names, their sizes and visibility @@ -501,6 +500,9 @@ impl Build { if self.config.jemalloc { features.push_str("jemalloc"); } + if self.config.llvm_enabled() { + features.push_str(" llvm"); + } features } @@ -806,11 +808,8 @@ impl Build { .and_then(|c| c.linker.as_ref()) { Some(linker) } else if target != self.config.build && - !target.contains("msvc") && - !target.contains("emscripten") && - !target.contains("wasm32") && - !target.contains("nvptx") && - !target.contains("fuchsia") { + util::use_host_linker(&target) && + !target.contains("msvc") { Some(self.cc(target)) } else { None @@ -1073,32 +1072,6 @@ impl Build { } } - /// Updates the actual toolstate of a tool. - /// - /// The toolstates are saved to the file specified by the key - /// `rust.save-toolstates` in `config.toml`. If unspecified, nothing will be - /// done. The file is updated immediately after this function completes. - pub fn save_toolstate(&self, tool: &str, state: ToolState) { - if let Some(ref path) = self.config.save_toolstates { - if let Some(parent) = path.parent() { - // Ensure the parent directory always exists - t!(std::fs::create_dir_all(parent)); - } - let mut file = t!(fs::OpenOptions::new() - .create(true) - .read(true) - .write(true) - .open(path)); - - let mut current_toolstates: HashMap<Box<str>, ToolState> = - serde_json::from_reader(&mut file).unwrap_or_default(); - current_toolstates.insert(tool.into(), state); - t!(file.seek(SeekFrom::Start(0))); - t!(file.set_len(0)); - t!(serde_json::to_writer(file, &current_toolstates)); - } - } - fn in_tree_crates(&self, root: &str) -> Vec<&Crate> { let mut ret = Vec::new(); let mut list = vec![INTERNER.intern_str(root)];
  33. Download patch debian/patches/d-ignore-avx-44056.patch

    --- 1.40.0+dfsg1-5/debian/patches/d-ignore-avx-44056.patch 2019-11-25 21:39:17.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/d-ignore-avx-44056.patch 2020-03-02 12:47:04.000000000 +0000 @@ -1,10 +1,10 @@ Bug: https://github.com/rust-lang/rust/pull/55667 -Index: rustc/src/test/ui/issues/issue-44056.rs +Index: rust/src/test/ui/issues/issue-44056.rs =================================================================== ---- rustc.orig/src/test/ui/issues/issue-44056.rs -+++ rustc/src/test/ui/issues/issue-44056.rs +--- rust.orig/src/test/ui/issues/issue-44056.rs ++++ rust/src/test/ui/issues/issue-44056.rs @@ -1,5 +1,5 @@ - // build-pass (FIXME(62277): could be check-pass?) + // build-pass (FIXME(55996): should be run on targets supporting avx) -// only-x86_64 +// ignore-test // no-prefer-dynamic
  34. Download patch src/ci/scripts/install-msys2.sh

    --- 1.40.0+dfsg1-5/src/ci/scripts/install-msys2.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/scripts/install-msys2.sh 2020-01-27 15:34:02.000000000 +0000 @@ -12,8 +12,8 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" if isWindows; then - choco install msys2 --params="/InstallDir:${SYSTEM_WORKFOLDER}/msys2 /NoPath" -y --no-progress - mkdir -p "${SYSTEM_WORKFOLDER}/msys2/home/${USERNAME}" + choco install msys2 --params="/InstallDir:$(ciCheckoutPath)/msys2 /NoPath" -y --no-progress + mkdir -p "$(ciCheckoutPath)/msys2/home/${USERNAME}" - ciCommandAddPath "${SYSTEM_WORKFOLDER}/msys2/usr/bin" + ciCommandAddPath "$(ciCheckoutPath)/msys2/usr/bin" fi
  35. Download patch src/bootstrap/flags.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/flags.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/flags.rs 2020-01-27 15:34:02.000000000 +0000 @@ -448,12 +448,12 @@ Arguments: Flags { verbose: matches.opt_count("verbose"), - stage: matches.opt_str("stage").map(|j| j.parse().unwrap()), + stage: matches.opt_str("stage").map(|j| j.parse().expect("`stage` should be a number")), dry_run: matches.opt_present("dry-run"), on_fail: matches.opt_str("on-fail"), rustc_error_format: matches.opt_str("error-format"), keep_stage: matches.opt_strs("keep-stage") - .into_iter().map(|j| j.parse().unwrap()) + .into_iter().map(|j| j.parse().expect("`keep-stage` should be a number")) .collect(), host: split(&matches.opt_strs("host")) .into_iter() @@ -464,7 +464,7 @@ Arguments: .map(|x| INTERNER.intern_string(x)) .collect::<Vec<_>>(), config: cfg_file, - jobs: matches.opt_str("jobs").map(|j| j.parse().unwrap()), + jobs: matches.opt_str("jobs").map(|j| j.parse().expect("`jobs` should be a number")), cmd, incremental: matches.opt_present("incremental"), exclude: split(&matches.opt_strs("exclude"))
  36. Download patch src/bootstrap/bootstrap.py

    --- 1.40.0+dfsg1-5/src/bootstrap/bootstrap.py 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/bootstrap.py 2020-01-27 15:34:02.000000000 +0000 @@ -102,10 +102,10 @@ def verify(path, sha_path, verbose): return verified -def unpack(tarball, dst, verbose=False, match=None): +def unpack(tarball, tarball_suffix, dst, verbose=False, match=None): """Unpack the given tarball file""" print("extracting", tarball) - fname = os.path.basename(tarball).replace(".tar.gz", "") + fname = os.path.basename(tarball).replace(tarball_suffix, "") with contextlib.closing(tarfile.open(tarball)) as tar: for member in tar.getnames(): if "/" not in member: @@ -331,6 +331,7 @@ class RustBuild(object): self.use_vendored_sources = '' self.verbose = False + def download_stage0(self): """Fetch the build system for Rust, written in Rust @@ -344,18 +345,30 @@ class RustBuild(object): rustc_channel = self.rustc_channel cargo_channel = self.cargo_channel + def support_xz(): + try: + with tempfile.NamedTemporaryFile(delete=False) as temp_file: + temp_path = temp_file.name + with tarfile.open(temp_path, "w:xz") as tar: + pass + return True + except tarfile.CompressionError: + return False + if self.rustc().startswith(self.bin_root()) and \ (not os.path.exists(self.rustc()) or self.program_out_of_date(self.rustc_stamp())): if os.path.exists(self.bin_root()): shutil.rmtree(self.bin_root()) - filename = "rust-std-{}-{}.tar.gz".format( - rustc_channel, self.build) + tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz' + filename = "rust-std-{}-{}{}".format( + rustc_channel, self.build, tarball_suffix) pattern = "rust-std-{}".format(self.build) - self._download_stage0_helper(filename, pattern) + self._download_stage0_helper(filename, pattern, tarball_suffix) - filename = "rustc-{}-{}.tar.gz".format(rustc_channel, self.build) - self._download_stage0_helper(filename, "rustc") + filename = "rustc-{}-{}{}".format(rustc_channel, self.build, + tarball_suffix) + self._download_stage0_helper(filename, "rustc", tarball_suffix) self.fix_executable("{}/bin/rustc".format(self.bin_root())) self.fix_executable("{}/bin/rustdoc".format(self.bin_root())) with output(self.rustc_stamp()) as rust_stamp: @@ -365,20 +378,22 @@ class RustBuild(object): # libraries/binaries that are included in rust-std with # the system MinGW ones. if "pc-windows-gnu" in self.build: - filename = "rust-mingw-{}-{}.tar.gz".format( - rustc_channel, self.build) - self._download_stage0_helper(filename, "rust-mingw") + filename = "rust-mingw-{}-{}{}".format( + rustc_channel, self.build, tarball_suffix) + self._download_stage0_helper(filename, "rust-mingw", tarball_suffix) if self.cargo().startswith(self.bin_root()) and \ (not os.path.exists(self.cargo()) or self.program_out_of_date(self.cargo_stamp())): - filename = "cargo-{}-{}.tar.gz".format(cargo_channel, self.build) - self._download_stage0_helper(filename, "cargo") + tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz' + filename = "cargo-{}-{}{}".format(cargo_channel, self.build, + tarball_suffix) + self._download_stage0_helper(filename, "cargo", tarball_suffix) self.fix_executable("{}/bin/cargo".format(self.bin_root())) with output(self.cargo_stamp()) as cargo_stamp: cargo_stamp.write(self.date) - def _download_stage0_helper(self, filename, pattern): + def _download_stage0_helper(self, filename, pattern, tarball_suffix): cache_dst = os.path.join(self.build_dir, "cache") rustc_cache = os.path.join(cache_dst, self.date) if not os.path.exists(rustc_cache): @@ -388,7 +403,7 @@ class RustBuild(object): tarball = os.path.join(rustc_cache, filename) if not os.path.exists(tarball): get("{}/{}".format(url, filename), tarball, verbose=self.verbose) - unpack(tarball, self.bin_root(), match=pattern, verbose=self.verbose) + unpack(tarball, tarball_suffix, self.bin_root(), match=pattern, verbose=self.verbose) @staticmethod def fix_executable(fname): @@ -628,7 +643,9 @@ class RustBuild(object): env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ (os.pathsep + env["LIBRARY_PATH"]) \ if "LIBRARY_PATH" in env else "" - env["RUSTFLAGS"] = "-Cdebuginfo=2 " + # preserve existing RUSTFLAGS + env.setdefault("RUSTFLAGS", "") + env["RUSTFLAGS"] += " -Cdebuginfo=2" build_section = "target.{}".format(self.build_triple()) target_features = [] @@ -637,13 +654,13 @@ class RustBuild(object): elif self.get_toml("crt-static", build_section) == "false": target_features += ["-crt-static"] if target_features: - env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " " + env["RUSTFLAGS"] += " -C target-feature=" + (",".join(target_features)) target_linker = self.get_toml("linker", build_section) if target_linker is not None: - env["RUSTFLAGS"] += "-C linker=" + target_linker + " " - env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes " + env["RUSTFLAGS"] += " -C linker=" + target_linker + env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes" if self.get_toml("deny-warnings", "rust") != "false": - env["RUSTFLAGS"] += "-Dwarnings " + env["RUSTFLAGS"] += " -Dwarnings" env["PATH"] = os.path.join(self.bin_root(), "bin") + \ os.pathsep + env["PATH"]
  37. Download patch src/ci/docker/x86_64-gnu-llvm-6.0/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/x86_64-gnu-llvm-6.0/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/x86_64-gnu-llvm-6.0/Dockerfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -FROM ubuntu:16.04 - -RUN apt-get update && apt-get install -y --no-install-recommends \ - g++ \ - make \ - file \ - curl \ - ca-certificates \ - python2.7 \ - git \ - cmake \ - sudo \ - gdb \ - llvm-6.0-tools \ - libedit-dev \ - libssl-dev \ - pkg-config \ - zlib1g-dev \ - xz-utils - -COPY scripts/sccache.sh /scripts/ -RUN sh /scripts/sccache.sh - -# using llvm-link-shared due to libffi issues -- see #34486 -ENV RUST_CONFIGURE_ARGS \ - --build=x86_64-unknown-linux-gnu \ - --llvm-root=/usr/lib/llvm-6.0 \ - --enable-llvm-link-shared -ENV SCRIPT python2.7 ../x.py test src/tools/tidy && python2.7 ../x.py test - -# The purpose of this container isn't to test with debug assertions and -# this is run on all PRs, so let's get speedier builds by disabling these extra -# checks. -ENV NO_DEBUG_ASSERTIONS=1 -ENV NO_LLVM_ASSERTIONS=1
  38. Download patch src/ci/docker/dist-various-2/build-wasi-toolchain.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-various-2/build-wasi-toolchain.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-various-2/build-wasi-toolchain.sh 2020-01-27 15:34:02.000000000 +0000 @@ -4,17 +4,17 @@ set -ex -# Originally from https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz -curl https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/clang%2Bllvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz | \ +# Originally from https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz +curl https://ci-mirrors.rust-lang.org/rustc/clang%2Bllvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz | \ tar xJf - -export PATH=`pwd`/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-14.04/bin:$PATH +export PATH=`pwd`/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/bin:$PATH -git clone https://github.com/CraneStation/wasi-sysroot +git clone https://github.com/CraneStation/wasi-libc -cd wasi-sysroot -git reset --hard e5f14be38362f1ab83302895a6e74b2ffd0e2302 +cd wasi-libc +git reset --hard f645f498dfbbbc00a7a97874d33082d3605c3f21 make -j$(nproc) INSTALL_DIR=/wasm32-wasi install cd .. -rm -rf reference-sysroot-wasi +rm -rf wasi-libc rm -rf clang+llvm*
  39. Download patch src/ci/azure-pipelines/pr.yml

    --- 1.40.0+dfsg1-5/src/ci/azure-pipelines/pr.yml 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/azure-pipelines/pr.yml 2020-01-27 15:34:02.000000000 +0000 @@ -18,10 +18,7 @@ jobs: - template: steps/run.yml strategy: matrix: - x86_64-gnu-llvm-6.0: - IMAGE: x86_64-gnu-llvm-6.0 - mingw-check: - IMAGE: mingw-check + x86_64-gnu-llvm-7: {} + mingw-check: {} x86_64-gnu-tools: - IMAGE: x86_64-gnu-tools CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
  40. Download patch src/ci/shared.sh

    --- 1.40.0+dfsg1-5/src/ci/shared.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/shared.sh 2020-01-27 15:34:02.000000000 +0000 @@ -4,7 +4,7 @@ # `source shared.sh`, hence the invalid shebang and not being # marked as an executable file in git. -export MIRRORS_BASE="https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc" +export MIRRORS_BASE="https://ci-mirrors.rust-lang.org/rustc" # See http://unix.stackexchange.com/questions/82598 # Duplicated in docker/dist-various-2/shared.sh @@ -27,27 +27,66 @@ function retry { } function isCI { - [ "$CI" = "true" ] || [ "$TF_BUILD" = "True" ] + [[ "${CI-false}" = "true" ]] || isAzurePipelines || isGitHubActions +} + +function isAzurePipelines { + [[ "${TF_BUILD-False}" = "True" ]] +} + +function isGitHubActions { + [[ "${GITHUB_ACTIONS-false}" = "true" ]] } function isMacOS { - [ "$AGENT_OS" = "Darwin" ] + [[ "${OSTYPE}" = "darwin"* ]] } function isWindows { - [ "$AGENT_OS" = "Windows_NT" ] + [[ "${OSTYPE}" = "cygwin" ]] || [[ "${OSTYPE}" = "msys" ]] } function isLinux { - [ "$AGENT_OS" = "Linux" ] + [[ "${OSTYPE}" = "linux-gnu" ]] } -function getCIBranch { - echo "$BUILD_SOURCEBRANCHNAME" +function isCiBranch { + if [[ $# -ne 1 ]]; then + echo "usage: $0 <branch-name>" + exit 1 + fi + name="$1" + + if isAzurePipelines; then + [[ "${BUILD_SOURCEBRANCHNAME}" = "${name}" ]] + elif isGitHubActions; then + [[ "${GITHUB_REF}" = "refs/heads/${name}" ]] + else + echo "isCiBranch only works inside CI!" + exit 1 + fi } function ciCommit { - echo "${BUILD_SOURCEVERSION}" + if isAzurePipelines; then + echo "${BUILD_SOURCEVERSION}" + elif isGitHubActions; then + echo "${GITHUB_SHA}" + else + echo "ciCommit only works inside CI!" + exit 1 + fi +} + +function ciCheckoutPath { + if isAzurePipelines; then + echo "${SYSTEM_WORKFOLDER}" + elif isGitHubActions; then + echo "${GITHUB_WORKSPACE}" + else + echo "ciCheckoutPath only works inside CI!" + exit 1 + fi } function ciCommandAddPath { @@ -57,7 +96,14 @@ function ciCommandAddPath { fi path="$1" - echo "##vso[task.prependpath]${path}" + if isAzurePipelines; then + echo "##vso[task.prependpath]${path}" + elif isGitHubActions; then + echo "::add-path::${value}" + else + echo "ciCommandAddPath only works inside CI!" + exit 1 + fi } function ciCommandSetEnv { @@ -68,5 +114,12 @@ function ciCommandSetEnv { name="$1" value="$2" - echo "##vso[task.setvariable variable=${name}]${value}" + if isAzurePipelines; then + echo "##vso[task.setvariable variable=${name}]${value}" + elif isGitHubActions; then + echo "::set-env name=${name}::${value}" + else + echo "ciCommandSetEnv only works inside CI!" + exit 1 + fi }
  41. Download patch src/ci/docker/mingw-check/validate-toolstate.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/mingw-check/validate-toolstate.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/mingw-check/validate-toolstate.sh 2020-01-27 15:34:02.000000000 +0000 @@ -0,0 +1,19 @@ +#!/bin/bash +# A quick smoke test to make sure publish_tooolstate.py works. + +set -euo pipefail +IFS=$'\n\t' + +rm -rf rust-toolstate +git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git +cd rust-toolstate +python2.7 "../../src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" \ + "$(git log --format=%s -n1 HEAD)" "" "" +# Only check maintainers if this build is supposed to publish toolstate. +# Builds that are not supposed to publish don't have the access token. +if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then + TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 \ + "../../src/tools/publish_toolstate.py" +fi +cd .. +rm -rf rust-toolstate
  42. Download patch src/ci/azure-pipelines/steps/run.yml

    --- 1.40.0+dfsg1-5/src/ci/azure-pipelines/steps/run.yml 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/azure-pipelines/steps/run.yml 2020-01-27 15:34:02.000000000 +0000 @@ -8,6 +8,13 @@ steps: +# Configure our CI_JOB_NAME variable which log analyzers can use for the main +# step to see what's going on. +- bash: | + builder=$(echo $AGENT_JOBNAME | cut -d ' ' -f 2) + echo "##vso[task.setvariable variable=CI_JOB_NAME]$builder" + displayName: Configure Job Name + # Disable automatic line ending conversion, which is enabled by default on # Azure's Windows image. Having the conversion enabled caused regressions both # in our test suite (it broke miri tests) and in the ecosystem, since we @@ -21,51 +28,39 @@ steps: - checkout: self fetchDepth: 2 +- bash: src/ci/scripts/setup-environment.sh + displayName: Setup environment + - bash: src/ci/scripts/should-skip-this.sh displayName: Decide whether to run this job -# Spawn a background process to collect CPU usage statistics which we'll upload -# at the end of the build. See the comments in the script here for more -# information. -- bash: python src/ci/cpu-usage-over-time.py &> cpu-usage.csv & - displayName: "Collect CPU-usage statistics in the background" +- bash: src/ci/scripts/collect-cpu-stats.sh + displayName: Collect CPU-usage statistics in the background - bash: src/ci/scripts/dump-environment.sh displayName: Show the current environment - bash: src/ci/scripts/install-sccache.sh - env: - AGENT_OS: $(Agent.OS) displayName: Install sccache condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-clang.sh - env: - AGENT_OS: $(Agent.OS) displayName: Install clang condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/switch-xcode.sh - env: - AGENT_OS: $(Agent.OS) displayName: Switch to Xcode 9.3 condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-wix.sh - env: - AGENT_OS: $(Agent.OS) displayName: Install wix condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-innosetup.sh - env: - AGENT_OS: $(Agent.OS) displayName: Install InnoSetup condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/windows-symlink-build-dir.sh - env: - AGENT_OS: $(Agent.OS) displayName: Ensure the build happens on C:\ instead of D:\ condition: and(succeeded(), not(variables.SKIP_JOB)) @@ -74,35 +69,22 @@ steps: condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-msys2.sh - env: - AGENT_OS: $(Agent.OS) - SYSTEM_WORKFOLDER: $(System.Workfolder) displayName: Install msys2 condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-msys2-packages.sh - env: - AGENT_OS: $(Agent.OS) - SYSTEM_WORKFOLDER: $(System.Workfolder) displayName: Install msys2 packages condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-mingw.sh - env: - AGENT_OS: $(Agent.OS) - SYSTEM_WORKFOLDER: $(System.Workfolder) displayName: Install MinGW condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/install-ninja.sh - env: - AGENT_OS: $(Agent.OS) displayName: Install ninja condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/enable-docker-ipv6.sh - env: - AGENT_OS: $(Agent.OS) displayName: Enable IPv6 on Docker condition: and(succeeded(), not(variables.SKIP_JOB)) @@ -116,67 +98,22 @@ steps: condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/checkout-submodules.sh - env: - AGENT_OS: $(Agent.OS) displayName: Checkout submodules condition: and(succeeded(), not(variables.SKIP_JOB)) - bash: src/ci/scripts/verify-line-endings.sh - env: - AGENT_OS: $(Agent.OS) displayName: Verify line endings condition: and(succeeded(), not(variables.SKIP_JOB)) # Ensure the `aws` CLI is installed so we can deploy later on, cache docker # images, etc. - bash: src/ci/scripts/install-awscli.sh - env: - AGENT_OS: $(Agent.OS) condition: and(succeeded(), not(variables.SKIP_JOB)) displayName: Install awscli -# Configure our CI_JOB_NAME variable which log analyzers can use for the main -# step to see what's going on. -- bash: | - builder=$(echo $AGENT_JOBNAME | cut -d ' ' -f 2) - echo "##vso[task.setvariable variable=CI_JOB_NAME]$builder" - displayName: Configure Job Name - -# As a quick smoke check on the otherwise very fast mingw-check linux builder -# check our own internal scripts. -- bash: | - set -e - git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git - cd rust-toolstate - python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" "" - # Only check maintainers if this build is supposed to publish toolstate. - # Builds that are not supposed to publish don't have the access token. - if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then - TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py" - fi - cd .. - rm -rf rust-toolstate - env: - TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN) - condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check')) - displayName: Verify the publish_toolstate script works - -- bash: | - set -e - # Remove any preexisting rustup installation since it can interfere - # with the cargotest step and its auto-detection of things like Clippy in - # the environment - rustup self uninstall -y || true - if [ "$IMAGE" = "" ]; then - src/ci/run.sh - else - src/ci/docker/run.sh $IMAGE - fi - #timeoutInMinutes: 180 +- bash: src/ci/scripts/run-build-from-ci.sh timeoutInMinutes: 600 env: - CI: true - SRC: . AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY) TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
  43. Download patch src/ci/azure-pipelines/master.yml

    --- 1.40.0+dfsg1-5/src/ci/azure-pipelines/master.yml 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/azure-pipelines/master.yml 2020-01-27 15:34:02.000000000 +0000 @@ -16,10 +16,7 @@ steps: - checkout: self fetchDepth: 2 -- script: | - export MESSAGE_FILE=$(mktemp -t msg.XXXXXX) - . src/ci/docker/x86_64-gnu-tools/repo.sh - commit_toolstate_change "$MESSAGE_FILE" "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" "$TOOLSTATE_REPO_ACCESS_TOKEN" +- script: src/ci/publish_toolstate.sh displayName: Publish toolstate env: TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
  44. Download patch debian/patches/u-riscv64-66661.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-66661.patch 2020-01-04 04:16:35.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-66661.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From 75dac389fb168159e0b049f72141f889b7215889 Mon Sep 17 00:00:00 2001 -From: msizanoen1 <qtmlabs@protonmail.com> -Date: Sat, 23 Nov 2019 14:15:27 +0700 -Subject: [PATCH] Add riscv64gc-unknown-linux-gnu target - ---- - src/librustc_target/spec/mod.rs | 1 + - .../spec/riscv64gc_unknown_linux_gnu.rs | 25 +++++++++++++++++++ - 2 files changed, 26 insertions(+) - create mode 100644 src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs - -diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs -index 716aef056a35..1a7cb943de76 100644 ---- a/src/librustc_target/spec/mod.rs -+++ b/src/librustc_target/spec/mod.rs -@@ -487,6 +487,7 @@ supported_targets! { - ("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf), - ("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf), - ("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf), -+ ("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu), - - ("aarch64-unknown-none", aarch64_unknown_none), - ("aarch64-unknown-none-softfloat", aarch64_unknown_none_softfloat), -diff --git a/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs b/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs -new file mode 100644 -index 000000000000..638e6770ebf8 ---- /dev/null -+++ b/src/librustc_target/spec/riscv64gc_unknown_linux_gnu.rs -@@ -0,0 +1,25 @@ -+use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; -+ -+pub fn target() -> TargetResult { -+ Ok(Target { -+ llvm_target: "riscv64-unknown-linux-gnu".to_string(), -+ target_endian: "little".to_string(), -+ target_pointer_width: "64".to_string(), -+ target_c_int_width: "32".to_string(), -+ target_env: "gnu".to_string(), -+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".to_string(), -+ arch: "riscv64".to_string(), -+ target_os: "linux".to_string(), -+ target_vendor: "unknown".to_string(), -+ linker_flavor: LinkerFlavor::Gcc, -+ options: TargetOptions { -+ abi_blacklist: super::riscv_base::abi_blacklist(), -+ code_model: Some("medium".to_string()), -+ cpu: "generic-rv64".to_string(), -+ features: "+m,+a,+f,+d,+c".to_string(), -+ llvm_abiname: "lp64d".to_string(), -+ max_atomic_width: Some(64), -+ ..super::linux_base::opts() -+ }, -+ }) -+}
  45. Download patch src/ci/docker/x86_64-gnu-tools/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/x86_64-gnu-tools/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/x86_64-gnu-tools/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -17,9 +17,7 @@ RUN apt-get update && apt-get install -y COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh -COPY x86_64-gnu-tools/checkregression.py /tmp/ COPY x86_64-gnu-tools/checktools.sh /tmp/ -COPY x86_64-gnu-tools/repo.sh /tmp/ # Run rustbook with `linkcheck` feature enabled ENV CHECK_LINKS 1 @@ -27,4 +25,4 @@ ENV CHECK_LINKS 1 ENV RUST_CONFIGURE_ARGS \ --build=x86_64-unknown-linux-gnu \ --save-toolstates=/tmp/toolstate/toolstates.json -ENV SCRIPT /tmp/checktools.sh ../x.py /tmp/toolstate/toolstates.json linux +ENV SCRIPT /tmp/checktools.sh ../x.py
  46. Download patch src/ci/docker/README.md

    --- 1.40.0+dfsg1-5/src/ci/docker/README.md 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/README.md 2020-01-27 15:34:02.000000000 +0000 @@ -16,6 +16,13 @@ for example: Images will output artifacts in an `obj` dir at the root of a repository. +**NOTE**: Re-using the same `obj` dir with different docker images with +the same target triple (e.g. `dist-x86_64-linux` and `dist-various-1`) +may result in strange linker errors, due shared library versions differing between platforms. + +If you encounter any issues when using multiple Docker images, try deleting your `obj` directory +before running your command. + ## Filesystem layout - Each directory, excluding `scripts` and `disabled`, corresponds to a docker image
  47. Download patch git-commit-hash

    --- 1.40.0+dfsg1-5/git-commit-hash 2019-12-16 17:25:54.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/git-commit-hash 2020-01-27 17:20:49.000000000 +0000 @@ -1 +1 @@ -73528e339aae0f17a15ffa49a8ac608f50c6cf14 \ No newline at end of file +5e1a799842ba6ed4a57e91f7ab9435947482f7d8 \ No newline at end of file
  48. Download patch debian/patches/d-0001-disable-miniz.patch

    --- 1.40.0+dfsg1-5/debian/patches/d-0001-disable-miniz.patch 2019-04-29 23:15:49.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/d-0001-disable-miniz.patch 2020-03-02 12:42:53.000000000 +0000 @@ -1,6 +1,6 @@ --- a/vendor/flate2/Cargo.toml +++ b/vendor/flate2/Cargo.toml -@@ -36,15 +36,6 @@ +@@ -40,14 +40,6 @@ version = "0.2" version = "1.0" optional = true @@ -8,29 +8,25 @@ -version = "0.1.11" -optional = true - --[dependencies.miniz_oxide_c_api] --version = "0.2" --features = ["no_c_export"] +-[dependencies.miniz_oxide] +-version = "0.3.2" -optional = true - [dependencies.tokio-io] - version = "0.1" + version = "0.1.11" optional = true -@@ -59,13 +50,12 @@ - version = "0.1" +@@ -71,12 +63,10 @@ version = "0.1.3" + version = "0.1.10" [features] --default = ["miniz-sys"] --rust_backend = ["miniz_oxide_c_api"] +-default = ["rust_backend"] +-rust_backend = ["miniz_oxide"] +default = ["zlib"] -+miniz-sys = ["zlib"] -+miniz_oxide_c_api = ["zlib"] +rust_backend = ["zlib"] tokio = ["tokio-io", "futures"] zlib = ["libz-sys"] --[target."cfg(all(target_arch = \"wasm32\", not(target_os = \"emscripten\")))".dependencies.miniz_oxide_c_api] --version = "0.2" --features = ["no_c_export"] +-[target."cfg(all(target_arch = \"wasm32\", not(target_os = \"emscripten\")))".dependencies.miniz_oxide] +-version = "0.3.2" [badges.appveyor] repository = "alexcrichton/flate2-rs"
  49. Download patch src/ci/docker/x86_64-gnu-tools/repo.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/x86_64-gnu-tools/repo.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/x86_64-gnu-tools/repo.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -#!/bin/sh - -# This file provides the function `commit_toolstate_change` for pushing a change -# to the `rust-toolstate` repository. -# -# The function relies on a GitHub bot user, which should have a Personal access -# token defined in the environment variable $TOOLSTATE_REPO_ACCESS_TOKEN. If for -# some reason you need to change the token, please update the Azure Pipelines -# variable group. -# -# 1. Generate a new Personal access token: -# -# * Login to the bot account, and go to Settings -> Developer settings -> -# Personal access tokens -# * Click "Generate new token" -# * Enable the "public_repo" permission, then click "Generate token" -# * Copy the generated token (should be a 40-digit hexadecimal number). -# Save it somewhere secure, as the token would be gone once you leave -# the page. -# -# 2. Update the variable group in Azure Pipelines -# -# * Ping a member of the infrastructure team to do this. -# -# 4. Replace the email address below if the bot account identity is changed -# -# * See <https://help.github.com/articles/about-commit-email-addresses/> -# if a private email by GitHub is wanted. - -commit_toolstate_change() { - OLDFLAGS="$-" - set -eu - - git config --global user.email '7378925+rust-toolstate-update@users.noreply.github.com' - git config --global user.name 'Rust Toolstate Update' - git config --global credential.helper store - printf 'https://%s:x-oauth-basic@github.com\n' "$TOOLSTATE_REPO_ACCESS_TOKEN" \ - > "$HOME/.git-credentials" - git clone --depth=1 $TOOLSTATE_REPO - - cd rust-toolstate - FAILURE=1 - MESSAGE_FILE="$1" - shift - for RETRY_COUNT in 1 2 3 4 5; do - # Call the callback. - # - If we are in the `auto` branch (pre-landing), this is called from `checktools.sh` and - # the callback is `change_toolstate` in that file. The purpose of this is to publish the - # test results (the new commit-to-toolstate mapping) in the toolstate repo. - # - If we are in the `master` branch (post-landing), this is called by the CI pipeline - # and the callback is `src/tools/publish_toolstate.py`. The purpose is to publish - # the new "current" toolstate in the toolstate repo. - "$@" - # `git commit` failing means nothing to commit. - FAILURE=0 - git commit -a -F "$MESSAGE_FILE" || break - # On failure randomly sleep for 0 to 3 seconds as a crude way to introduce jittering. - git push origin master && break || sleep $(LC_ALL=C tr -cd 0-3 < /dev/urandom | head -c 1) - FAILURE=1 - git fetch origin master - git reset --hard origin/master - done - cd .. - - set +eu - set "-$OLDFLAGS" - return $FAILURE -}
  50. Download patch src/ci/docker/dist-x86_64-linux/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-x86_64-linux/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-x86_64-linux/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -69,7 +69,7 @@ RUN ./build-python.sh # Now build LLVM+Clang 7, afterwards configuring further compilations to use the # clang/clang++ compilers. -COPY dist-x86_64-linux/build-clang.sh /tmp/ +COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/ RUN ./build-clang.sh ENV CC=clang CXX=clang++
  51. Download patch debian/update-version.sh

    --- 1.40.0+dfsg1-5/debian/update-version.sh 2020-01-03 18:30:23.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/update-version.sh 2020-03-02 12:43:17.000000000 +0000 @@ -3,12 +3,12 @@ prev_stable() { local V=$1 -python3 -c 'import sys; k=map(int,sys.argv[1].split(".")); k[1]-=1; print ".".join(map(str,k))' "$V" +python3 -c 'import sys; k=list(map(int,sys.argv[1].split("."))); k[1]-=1; print(".".join(map(str,k)))' "$V" } cargo_new() { local V=$1 -python3 -c 'import sys; k=map(int,sys.argv[1].split(".")); k[1]+='"${2:-1}"'; k[0]-=1; print ".".join(map(str,k))' "$V" +python3 -c 'import sys; k=list(map(int,sys.argv[1].split("."))); k[1]+='"${2:-1}"'; k[0]-=1; print(".".join(map(str,k)))' "$V" } update() {
  52. Download patch debian/patches/riscv64-atomic-detection.patch

    --- 1.40.0+dfsg1-5/debian/patches/riscv64-atomic-detection.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/riscv64-atomic-detection.patch 2020-04-08 00:15:47.000000000 +0000 @@ -0,0 +1,18 @@ +Description: Fix libatomic requirement detection for riscv64 + riscv64 doesn't need libatomic for 64-bit atomics, but it does for 8-bit ones. + Ensure the check tests both. +Author: William Grant <wgrant@ubuntu.com> + +--- rustc-1.41.0+dfsg1+llvm.orig/src/llvm-project/llvm/cmake/modules/CheckAtomic.cmake ++++ rustc-1.41.0+dfsg1+llvm/src/llvm-project/llvm/cmake/modules/CheckAtomic.cmake +@@ -12,8 +12,9 @@ function(check_working_cxx_atomics varna + CHECK_CXX_SOURCE_COMPILES(" + #include <atomic> + std::atomic<int> x; ++std::atomic<char> y; + int main() { +- return x; ++ return x.fetch_add(1) + y.fetch_add(1); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
  53. Download patch src/ci/docker/dist-i686-linux/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-i686-linux/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-i686-linux/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -69,7 +69,7 @@ RUN ./build-python.sh # Now build LLVM+Clang 7, afterwards configuring further compilations to use the # clang/clang++ compilers. -COPY dist-x86_64-linux/build-clang.sh /tmp/ +COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/ RUN ./build-clang.sh ENV CC=clang CXX=clang++
  54. Download patch debian/patches/u-riscv64-format-1.patch
  55. Download patch src/bootstrap/compile.rs
  56. Download patch debian/patches/u-riscv64-format-2.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-format-2.patch 2020-01-03 23:26:02.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-format-2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -commit 4436c9d35498e7ae3da261f6141d6d73b915e1e8 -gpg: Signature made Sat 30 Nov 2019 02:43:27 GMT -gpg: using RSA key 4628C5D82CFF65D68164A78AF9BA143B95FF6D82 -gpg: Can't check signature: No public key -Author: David Tolnay <dtolnay@gmail.com> -Date: Wed Nov 27 10:29:00 2019 -0800 - - Format libstd with rustfmt - - This commit applies rustfmt with rust-lang/rust's default settings to - files in src/libstd *that are not involved in any currently open PR* to - minimize merge conflicts. THe list of files involved in open PRs was - determined by querying GitHub's GraphQL API with this script: - https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 - - With the list of files from the script in outstanding_files, the - relevant commands were: - - $ find src/libstd -name '*.rs' \ - | xargs rustfmt --edition=2018 --unstable-features --skip-children - $ rg libstd outstanding_files | xargs git checkout -- - - Repeating this process several months apart should get us coverage of - most of the rest of libstd. - - To confirm no funny business: - - $ git checkout $THIS_COMMIT^ - $ git show --pretty= --name-only $THIS_COMMIT \ - | xargs rustfmt --edition=2018 --unstable-features --skip-children - $ git diff $THIS_COMMIT # there should be no difference - -diff --git a/src/libstd/sys_common/alloc.rs b/src/libstd/sys_common/alloc.rs -index 1cfc7ed17f2..713b9949f64 100644 ---- a/src/libstd/sys_common/alloc.rs -+++ b/src/libstd/sys_common/alloc.rs -@@ -6,20 +6,24 @@ use crate::ptr; - - // The minimum alignment guaranteed by the architecture. This value is used to - // add fast paths for low alignment values. --#[cfg(all(any(target_arch = "x86", -- target_arch = "arm", -- target_arch = "mips", -- target_arch = "powerpc", -- target_arch = "powerpc64", -- target_arch = "asmjs", -- target_arch = "wasm32", -- target_arch = "hexagon")))] -+#[cfg(all(any( -+ target_arch = "x86", -+ target_arch = "arm", -+ target_arch = "mips", -+ target_arch = "powerpc", -+ target_arch = "powerpc64", -+ target_arch = "asmjs", -+ target_arch = "wasm32", -+ target_arch = "hexagon" -+)))] - pub const MIN_ALIGN: usize = 8; --#[cfg(all(any(target_arch = "x86_64", -- target_arch = "aarch64", -- target_arch = "mips64", -- target_arch = "s390x", -- target_arch = "sparc64")))] -+#[cfg(all(any( -+ target_arch = "x86_64", -+ target_arch = "aarch64", -+ target_arch = "mips64", -+ target_arch = "s390x", -+ target_arch = "sparc64" -+)))] - pub const MIN_ALIGN: usize = 16; - - pub unsafe fn realloc_fallback(
  57. Download patch src/doc/book/ci/dictionary.txt

    --- 1.40.0+dfsg1-5/src/doc/book/ci/dictionary.txt 2019-10-29 12:16:09.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/doc/book/ci/dictionary.txt 2019-11-15 16:30:04.000000000 +0000 @@ -160,7 +160,6 @@ Filesystem filesystem's filesystems Firefox -FnBox FnMut FnOnce formatter
  58. Download patch src/bootstrap/install.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/install.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/install.rs 2020-01-27 15:34:02.000000000 +0000 @@ -260,7 +260,7 @@ install!((self, builder, _config), }; Rustc, "src/librustc", true, only_hosts: true, { builder.ensure(dist::Rustc { - compiler: self.compiler, + compiler: builder.compiler(builder.top_stage, self.target), }); install_rustc(builder, self.compiler.stage, self.target); };
  59. Download patch config.toml.example

    --- 1.40.0+dfsg1-5/config.toml.example 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/config.toml.example 2020-01-27 15:34:02.000000000 +0000 @@ -379,9 +379,6 @@ # and currently the only standard option supported is `"llvm"` #codegen-backends = ["llvm"] -# This is the name of the directory in which codegen backends will get installed -#codegen-backends-dir = "codegen-backends" - # Indicates whether LLD will be compiled and made available in the sysroot for # rustc to execute. #lld = false
  60. Download patch src/bootstrap/toolstate.rs
  61. Download patch debian/patches/llvm/llvm-riscv64-fix-cffi.diff

    --- 1.40.0+dfsg1-5/debian/patches/llvm/llvm-riscv64-fix-cffi.diff 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/llvm/llvm-riscv64-fix-cffi.diff 2020-04-08 00:12:30.000000000 +0000 @@ -0,0 +1,76 @@ +commit c6b09bff5671600f8e764d3847023d0996f328d9 +Author: Luís Marques <luismarques@lowrisc.org> +Date: Thu Nov 14 18:27:42 2019 +0000 + + [RISCV] Fix wrong CFI directives + + Summary: Removes CFI CFA directives that could incorrectly propagate + beyond the basic block they were inteded for. Specifically it removes + the epilogue CFI directives. See the branch_and_tail_call test for an + example of the issue. Should fix the stack unwinding issues caused by + the incorrect directives. + + Reviewers: asb, lenary, shiva0217 + Reviewed By: lenary + Tags: #llvm + Differential Revision: https://reviews.llvm.org/D69723 + +--- a/src/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp ++++ b/src/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp +@@ -205,7 +205,6 @@ + MachineFrameInfo &MFI = MF.getFrameInfo(); + auto *RVFI = MF.getInfo<RISCVMachineFunctionInfo>(); + DebugLoc DL = MBBI->getDebugLoc(); +- const RISCVInstrInfo *TII = STI.getInstrInfo(); + unsigned FPReg = getFPReg(STI); + unsigned SPReg = getSPReg(STI); + +@@ -225,48 +224,9 @@ + adjustReg(MBB, LastFrameDestroy, DL, SPReg, FPReg, -FPOffset, + MachineInstr::FrameDestroy); + } +- +- if (hasFP(MF)) { +- // To find the instruction restoring FP from stack. +- for (auto &I = LastFrameDestroy; I != MBBI; ++I) { +- if (I->mayLoad() && I->getOperand(0).isReg()) { +- unsigned DestReg = I->getOperand(0).getReg(); +- if (DestReg == FPReg) { +- // If there is frame pointer, after restoring $fp registers, we +- // need adjust CFA to ($sp - FPOffset). +- // Emit ".cfi_def_cfa $sp, -FPOffset" +- unsigned CFIIndex = MF.addFrameInst(MCCFIInstruction::createDefCfa( +- nullptr, RI->getDwarfRegNum(SPReg, true), -FPOffset)); +- BuildMI(MBB, std::next(I), DL, +- TII->get(TargetOpcode::CFI_INSTRUCTION)) +- .addCFIIndex(CFIIndex); +- break; +- } +- } +- } +- } +- +- // Add CFI directives for callee-saved registers. +- const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo(); +- // Iterate over list of callee-saved registers and emit .cfi_restore +- // directives. +- for (const auto &Entry : CSI) { +- unsigned Reg = Entry.getReg(); +- unsigned CFIIndex = MF.addFrameInst(MCCFIInstruction::createRestore( +- nullptr, RI->getDwarfRegNum(Reg, true))); +- BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::CFI_INSTRUCTION)) +- .addCFIIndex(CFIIndex); +- } + + // Deallocate stack + adjustReg(MBB, MBBI, DL, SPReg, SPReg, StackSize, MachineInstr::FrameDestroy); +- +- // After restoring $sp, we need to adjust CFA to $(sp + 0) +- // Emit ".cfi_def_cfa_offset 0" +- unsigned CFIIndex = +- MF.addFrameInst(MCCFIInstruction::createDefCfaOffset(nullptr, 0)); +- BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::CFI_INSTRUCTION)) +- .addCFIIndex(CFIIndex); + } + + int RISCVFrameLowering::getFrameIndexReference(const MachineFunction &MF,
  62. Download patch Cargo.lock
  63. Download patch debian/patches/u-riscv64-cc-430.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-riscv64-cc-430.patch 2020-01-04 04:16:35.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-riscv64-cc-430.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -From 97b648e1d2597363d6baea7190469d45c857c8f6 Mon Sep 17 00:00:00 2001 -From: "Wladimir J. van der Laan" <laanwj@gmail.com> -Date: Thu, 8 Aug 2019 06:27:30 +0000 -Subject: [PATCH] risc-v: Disable PIC by default for now - -Rust's linker cannot currently handle gcc's fPIC compilation units -for RISC-V targets: - - = note: rust-lld: error: - .got section detected in the input files. Dynamic relocations are not - supported. If you are linking to C code compiled using the `gcc` crate - then modify your build script to compile the C code _without_ the - -fPIC flag. See the documentation of the `gcc::Config.fpic` method for - details. - -So disable PIC by default for now for `riscv` targets. ---- - src/lib.rs | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/lib.rs b/src/lib.rs -index f3b9343e..fd67d0be 100644 ---- a/vendor/cc/src/lib.rs -+++ b/vendor/cc/src/lib.rs -@@ -824,7 +824,7 @@ impl Build { - - /// Configures whether the compiler will emit position independent code. - /// -- /// This option defaults to `false` for `windows-gnu` targets and -+ /// This option defaults to `false` for `windows-gnu` and `riscv` targets and - /// to `true` for all other targets. - pub fn pic(&mut self, pic: bool) -> &mut Build { - self.pic = Some(pic); -@@ -1225,7 +1225,8 @@ impl Build { - cmd.push_cc_arg("-ffunction-sections".into()); - cmd.push_cc_arg("-fdata-sections".into()); - } -- if self.pic.unwrap_or(!target.contains("windows-gnu")) { -+ // Disable generation of PIC on RISC-V for now: rust-lld doesn't support this yet -+ if self.pic.unwrap_or(!target.contains("windows-gnu") && !target.contains("riscv")) { - cmd.push_cc_arg("-fPIC".into()); - // PLT only applies if code is compiled with PIC support, - // and only for ELF targets.
  64. Download patch debian/patches/llvm/clang-riscv64-multiarch.diff

    --- 1.40.0+dfsg1-5/debian/patches/llvm/clang-riscv64-multiarch.diff 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/llvm/clang-riscv64-multiarch.diff 2020-04-08 00:12:30.000000000 +0000 @@ -0,0 +1,34 @@ +Index: llvm-toolchain-9_9.0.0/src/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp +=================================================================== +--- llvm-toolchain-9_9.0.0.orig/src/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp ++++ llvm-toolchain-9_9.0.0/src/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp +@@ -151,6 +151,10 @@ static std::string getMultiarchTriple(co + if (D.getVFS().exists(SysRoot + "/lib/powerpc64le-linux-gnu")) + return "powerpc64le-linux-gnu"; + break; ++ case llvm::Triple::riscv64: ++ if (D.getVFS().exists(SysRoot + "/lib/riscv64-linux-gnu")) ++ return "riscv64-linux-gnu"; ++ break; + case llvm::Triple::sparc: + if (D.getVFS().exists(SysRoot + "/lib/sparc-linux-gnu")) + return "sparc-linux-gnu"; +@@ -759,6 +763,8 @@ void Linux::AddClangSystemIncludeArgs(co + "/usr/include/powerpc64-linux-gnu"}; + const StringRef PPC64LEMultiarchIncludeDirs[] = { + "/usr/include/powerpc64le-linux-gnu"}; ++ const StringRef RISCV64MultiarchIncludeDirs[] = { ++ "/usr/include/riscv64-linux-gnu"}; + const StringRef SparcMultiarchIncludeDirs[] = { + "/usr/include/sparc-linux-gnu"}; + const StringRef Sparc64MultiarchIncludeDirs[] = { +@@ -834,6 +840,9 @@ void Linux::AddClangSystemIncludeArgs(co + case llvm::Triple::ppc64le: + MultiarchIncludeDirs = PPC64LEMultiarchIncludeDirs; + break; ++ case llvm::Triple::riscv64: ++ MultiarchIncludeDirs = RISCV64MultiarchIncludeDirs; ++ break; + case llvm::Triple::sparc: + MultiarchIncludeDirs = SparcMultiarchIncludeDirs; + break;
  65. Download patch src/bootstrap/builder/tests.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/builder/tests.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/builder/tests.rs 2020-01-27 15:34:02.000000000 +0000 @@ -363,6 +363,10 @@ fn dist_with_same_targets_and_hosts() { compiler: Compiler { host: a, stage: 1 }, target: b, }, + compile::Std { + compiler: Compiler { host: a, stage: 2 }, + target: b, + }, ] ); assert_eq!(
  66. Download patch debian/watch

    --- 1.40.0+dfsg1-5/debian/watch 2019-11-30 21:51:28.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/watch 2020-03-02 12:40:37.000000000 +0000 @@ -6,11 +6,11 @@ version=4 opts="\ pgpsigurlmangle=s/$/.asc/,\ uversionmangle=s/(\d)[_.+-]?((beta|alpha)\.?\d*)$/$1~$2/,\ -dversionmangle=s/\+dfsg\d*$//,\ +dversionmangle=s/\+dfsg\d\+llvm*$//,\ downloadurlmangle=s/\.[gx]z/.xz/,\ filenamemangle=s/.*\/(.*)\.[gx]z(\..*)?/$1.xz$2/,\ repack,\ -repacksuffix=+dfsg1,\ +repacksuffix=+dfsg1+llvm,\ compression=xz,\ " \ https://forge.rust-lang.org/infra/other-installation-methods.html \
  67. Download patch debian/patches/d-ignore-error-detail-diff.patch
  68. Download patch src/ci/docker/run.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/run.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/run.sh 2020-01-27 15:34:02.000000000 +0000 @@ -172,6 +172,8 @@ docker \ --env CI \ --env TF_BUILD \ --env BUILD_SOURCEBRANCHNAME \ + --env GITHUB_ACTIONS \ + --env GITHUB_REF \ --env TOOLSTATE_REPO_ACCESS_TOKEN \ --env TOOLSTATE_REPO \ --env TOOLSTATE_PUBLISH \
  69. Download patch src/ci/docker/dist-armv7-linux/crosstool-ng.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-armv7-linux/crosstool-ng.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-armv7-linux/crosstool-ng.sh 2020-01-27 15:34:02.000000000 +0000 @@ -1,7 +1,7 @@ set -ex # Mirrored from https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-1.24.0.tar.gz -url="https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/crosstool-ng-1.24.0.tar.gz" +url="https://ci-mirrors.rust-lang.org/rustc/crosstool-ng-1.24.0.tar.gz" curl -Lf $url | tar xzf - cd crosstool-ng-crosstool-ng-1.24.0 ./bootstrap
  70. Download patch debian/patches/series

    --- 1.40.0+dfsg1-5/debian/patches/series 2020-01-04 05:12:21.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/series 2020-04-08 00:18:39.000000000 +0000 @@ -7,28 +7,18 @@ u-make-tests-work-without-rpath.patch u-tests-ignore-arm.patch u-mips-fixes.diff #u-allow-system-compiler-rt.patch -u-fix-cross-compile-install-again.patch -u-riscv64-65953.patch -u-riscv64-66661.patch -u-riscv64-format-1.patch -u-riscv64-format-2.patch u-riscv64-66899.patch u-riscv64-libc-1606.patch -u-riscv64-cc-428.patch -u-riscv64-cc-429.patch -u-riscv64-cc-430.patch -u-riscv64-cc-460.patch u-riscv64-cc-461.patch u-riscv64-cc-465.patch # not forwarded, or forwarded but unlikely to be merged -u-rustbuild-rustflags.patch -u-reproducible-compiler-builtins.patch u-rustc-llvm-cross-flags.patch u-reproducible-dl-stage0.patch # Debian-specific patches, not suitable for upstream # Patches needed by debian/prune-unused-deps +d-0000-convert-cargo-lock-to-v1.patch d-0000-ignore-removed-submodules.patch d-0001-disable-miniz.patch d-0002-pkg-config-no-special-snowflake.patch @@ -52,3 +42,12 @@ d-fix-mips64el-bootstrap.patch # Work around for some porterboxes, keep this commented #d-host-duplicates.patch +u-riscv64-68452.patch +u-riscv64-compiletest.patch +llvm/D60657-riscv-pcrel_lo.diff +llvm/clang-riscv64-multiarch.diff +llvm/clang-riscv64-rv64gc.diff +llvm/llvm-riscv64-fix-cffi.diff +riscv64-vendor-cc.diff +riscv64-dsymutil-atomic.patch +riscv64-atomic-detection.patch
  71. Download patch debian/patches/llvm/D60657-riscv-pcrel_lo.diff

    --- 1.40.0+dfsg1-5/debian/patches/llvm/D60657-riscv-pcrel_lo.diff 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/llvm/D60657-riscv-pcrel_lo.diff 2020-04-08 00:12:30.000000000 +0000 @@ -0,0 +1,171 @@ +commit 41449c58c58e466bcf9cdc4f7415950382bad8d7 +Author: Roger Ferrer Ibanez <roger.ferrer@bsc.es> +Date: Fri Nov 8 08:26:30 2019 +0000 + + [RISCV] Fix evaluation of %pcrel_lo + + The following testcase + + function: + .Lpcrel_label1: + auipc a0, %pcrel_hi(other_function) + addi a1, a0, %pcrel_lo(.Lpcrel_label1) + .p2align 2 # Causes a new fragment to be emitted + + .type other_function,@function + other_function: + ret + + exposes an odd behaviour in which only the %pcrel_hi relocation is + evaluated but not the %pcrel_lo. + + $ llvm-mc -triple riscv64 -filetype obj t.s | llvm-objdump -d -r - + + <stdin>: file format ELF64-riscv + + Disassembly of section .text: + 0000000000000000 function: + 0: 17 05 00 00 auipc a0, 0 + 4: 93 05 05 00 mv a1, a0 + 0000000000000004: R_RISCV_PCREL_LO12_I other_function+4 + + 0000000000000008 other_function: + 8: 67 80 00 00 ret + + The reason seems to be that in RISCVAsmBackend::shouldForceRelocation we + only consider the fragment but in RISCVMCExpr::evaluatePCRelLo we + consider the section. This usually works but there are cases where the + section may still be the same but the fragment may be another one. In + that case we end forcing a %pcrel_lo relocation without any %pcrel_hi. + + This patch makes RISCVAsmBackend::shouldForceRelocation use the section, + if any, to determine if the relocation must be forced or not. + + Differential Revision: https://reviews.llvm.org/D60657 + +commit 41449c58c58e466bcf9cdc4f7415950382bad8d7 +Author: Roger Ferrer Ibanez <roger.ferrer@bsc.es> +Date: Fri Nov 8 08:26:30 2019 +0000 + + [RISCV] Fix evaluation of %pcrel_lo + + The following testcase + + function: + .Lpcrel_label1: + auipc a0, %pcrel_hi(other_function) + addi a1, a0, %pcrel_lo(.Lpcrel_label1) + .p2align 2 # Causes a new fragment to be emitted + + .type other_function,@function + other_function: + ret + + exposes an odd behaviour in which only the %pcrel_hi relocation is + evaluated but not the %pcrel_lo. + + $ llvm-mc -triple riscv64 -filetype obj t.s | llvm-objdump -d -r - + + <stdin>: file format ELF64-riscv + + Disassembly of section .text: + 0000000000000000 function: + 0: 17 05 00 00 auipc a0, 0 + 4: 93 05 05 00 mv a1, a0 + 0000000000000004: R_RISCV_PCREL_LO12_I other_function+4 + + 0000000000000008 other_function: + 8: 67 80 00 00 ret + + The reason seems to be that in RISCVAsmBackend::shouldForceRelocation we + only consider the fragment but in RISCVMCExpr::evaluatePCRelLo we + consider the section. This usually works but there are cases where the + section may still be the same but the fragment may be another one. In + that case we end forcing a %pcrel_lo relocation without any %pcrel_hi. + + This patch makes RISCVAsmBackend::shouldForceRelocation use the section, + if any, to determine if the relocation must be forced or not. + + Differential Revision: https://reviews.llvm.org/D60657 + +diff --git a/src/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp b/src/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +index f6b727ae37c..5881a0a86ef 100644 +--- a/src/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp ++++ b/src/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +@@ -64,11 +64,15 @@ bool RISCVAsmBackend::shouldForceRelocation(const MCAssembler &Asm, + case RISCV::fixup_riscv_tls_gd_hi20: + ShouldForce = true; + break; +- case RISCV::fixup_riscv_pcrel_hi20: +- ShouldForce = T->getValue()->findAssociatedFragment() != +- Fixup.getValue()->findAssociatedFragment(); ++ case RISCV::fixup_riscv_pcrel_hi20: { ++ MCFragment *TFragment = T->getValue()->findAssociatedFragment(); ++ MCFragment *FixupFragment = Fixup.getValue()->findAssociatedFragment(); ++ assert(FixupFragment && "We should have a fragment for this fixup"); ++ ShouldForce = ++ !TFragment || TFragment->getParent() != FixupFragment->getParent(); + break; + } ++ } + break; + } + +diff --git a/src/llvm-project/llvm/test/MC/RISCV/pcrel-fixups.s b/src/llvm-project/llvm/test/MC/RISCV/pcrel-fixups.s +new file mode 100644 +index 00000000000..1025988967a +--- /dev/null ++++ b/src/llvm-project/llvm/test/MC/RISCV/pcrel-fixups.s +@@ -0,0 +1,52 @@ ++# RUN: llvm-mc -triple riscv32 -mattr=-relax -filetype obj %s \ ++# RUN: | llvm-objdump -M no-aliases -d -r - \ ++# RUN: | FileCheck --check-prefix NORELAX %s ++# RUN: llvm-mc -triple riscv32 -mattr=+relax -filetype obj %s \ ++# RUN: | llvm-objdump -M no-aliases -d -r - \ ++# RUN: | FileCheck --check-prefix RELAX %s ++# RUN: llvm-mc -triple riscv64 -mattr=-relax -filetype obj %s \ ++# RUN: | llvm-objdump -M no-aliases -d -r - \ ++# RUN: | FileCheck --check-prefix NORELAX %s ++# RUN: llvm-mc -triple riscv64 -mattr=+relax -filetype obj %s \ ++# RUN: | llvm-objdump -M no-aliases -d -r - \ ++# RUN: | FileCheck --check-prefix RELAX %s ++ ++# Fixups for %pcrel_hi / %pcrel_lo can be evaluated within a section, ++# regardless of the fragment containing the target address. ++ ++function: ++.Lpcrel_label1: ++ auipc a0, %pcrel_hi(other_function) ++ addi a1, a0, %pcrel_lo(.Lpcrel_label1) ++# NORELAX: auipc a0, 0 ++# NORELAX-NOT: R_RISCV ++# NORELAX: addi a1, a0, 16 ++# NORELAX-NOT: R_RISCV ++ ++# RELAX: auipc a0, 0 ++# RELAX: R_RISCV_PCREL_HI20 other_function ++# RELAX: R_RISCV_RELAX *ABS* ++# RELAX: addi a1, a0, 0 ++# RELAX: R_RISCV_PCREL_LO12_I .Lpcrel_label1 ++# RELAX: R_RISCV_RELAX *ABS* ++ ++ .p2align 2 # Cause a new fragment be emitted here ++.Lpcrel_label2: ++ auipc a0, %pcrel_hi(other_function) ++ addi a1, a0, %pcrel_lo(.Lpcrel_label2) ++# NORELAX: auipc a0, 0 ++# NORELAX-NOT: R_RISCV ++# NORELAX: addi a1, a0, 8 ++# NORELAX-NOT: R_RISCV ++ ++# RELAX: auipc a0, 0 ++# RELAX: R_RISCV_PCREL_HI20 other_function ++# RELAX: R_RISCV_RELAX *ABS* ++# RELAX: addi a1, a0, 0 ++# RELAX: R_RISCV_PCREL_LO12_I .Lpcrel_label2 ++# RELAX: R_RISCV_RELAX *ABS* ++ ++ .type other_function,@function ++other_function: ++ ret ++
  72. Download patch src/ci/docker/scripts/sccache.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/scripts/sccache.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/scripts/sccache.sh 2020-01-27 15:34:02.000000000 +0000 @@ -1,6 +1,6 @@ set -ex curl -fo /usr/local/bin/sccache \ - https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2018-04-02-sccache-x86_64-unknown-linux-musl + https://ci-mirrors.rust-lang.org/rustc/2018-04-02-sccache-x86_64-unknown-linux-musl chmod +x /usr/local/bin/sccache
  73. Download patch debian/config.toml.in

    --- 1.40.0+dfsg1-5/debian/config.toml.in 2019-11-25 21:53:30.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/config.toml.in 2020-03-02 12:40:37.000000000 +0000 @@ -22,25 +22,6 @@ docs = false [install] prefix = "/usr" -[target.DEB_BUILD_RUST_TYPE] -llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config" -linker = "DEB_BUILD_GNU_TYPE-gcc" - -ifelse(DEB_BUILD_RUST_TYPE,DEB_HOST_RUST_TYPE,, -[target.DEB_HOST_RUST_TYPE] -llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config" -linker = "DEB_HOST_GNU_TYPE-gcc" - -)dnl -ifelse(DEB_BUILD_RUST_TYPE,DEB_TARGET_RUST_TYPE,,DEB_HOST_RUST_TYPE,DEB_TARGET_RUST_TYPE,, -[target.DEB_TARGET_RUST_TYPE] -llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config" -linker = "DEB_TARGET_GNU_TYPE-gcc" - -)dnl -[llvm] -link-shared = true - [rust] jemalloc = false optimize = MAKE_OPTIMISATIONS
  74. Download patch src/ci/docker/dist-various-1/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-various-1/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-various-1/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -135,6 +135,9 @@ ENV TARGETS=$TARGETS,armv7r-none-eabi ENV TARGETS=$TARGETS,armv7r-none-eabihf ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf +# riscv targets currently do not need a C compiler, as compiler_builtins +# doesn't currently have it enabled, and the riscv gcc compiler is not +# installed. ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \ CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \ CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc \ @@ -143,7 +146,12 @@ ENV CC_mipsel_unknown_linux_musl=mipsel- CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \ CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \ AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \ - CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ + CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \ + CC_riscv32i_unknown_none_elf=false \ + CC_riscv32imc_unknown_none_elf=false \ + CC_riscv32imac_unknown_none_elf=false \ + CC_riscv64imac_unknown_none_elf=false \ + CC_riscv64gc_unknown_none_elf=false ENV RUST_CONFIGURE_ARGS \ --musl-root-armv5te=/musl-armv5te \
  75. Download patch src/bootstrap/test.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/test.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/test.rs 2020-01-27 15:34:02.000000000 +0000 @@ -570,7 +570,12 @@ impl Step for Clippy { let host_libs = builder .stage_out(compiler, Mode::ToolRustc) .join(builder.cargo_dir()); + let target_libs = builder + .stage_out(compiler, Mode::ToolRustc) + .join(&self.host) + .join(builder.cargo_dir()); cargo.env("HOST_LIBS", host_libs); + cargo.env("TARGET_LIBS", target_libs); // clippy tests need to find the driver cargo.env("CLIPPY_DRIVER_PATH", clippy); @@ -1768,7 +1773,7 @@ impl Step for Crate { } Mode::Rustc => { builder.ensure(compile::Rustc { compiler, target }); - compile::rustc_cargo(builder, &mut cargo); + compile::rustc_cargo(builder, &mut cargo, target); } _ => panic!("can only test libraries"), };
  76. Download patch src/ci/docker/dist-various-1/install-mips-musl.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-various-1/install-mips-musl.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-various-1/install-mips-musl.sh 2020-01-27 15:34:02.000000000 +0000 @@ -5,7 +5,7 @@ mkdir /usr/local/mips-linux-musl # originally from # https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/ # OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2 -URL="https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc" +URL="https://ci-mirrors.rust-lang.org/rustc" FILE="OpenWrt-Toolchain-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2" curl -L "$URL/$FILE" | tar xjf - -C /usr/local/mips-linux-musl --strip-components=2
  77. Download patch debian/patches/d-no-jemalloc.patch

    --- 1.40.0+dfsg1-5/debian/patches/d-no-jemalloc.patch 2019-07-13 17:22:28.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/d-no-jemalloc.patch 2020-03-02 12:47:04.000000000 +0000 @@ -1,8 +1,8 @@ -Index: rustc/src/rustc/Cargo.toml +Index: rust/src/rustc/Cargo.toml =================================================================== ---- rustc.orig/src/rustc/Cargo.toml -+++ rustc/src/rustc/Cargo.toml -@@ -15,11 +15,3 @@ rustc_driver = { path = "../librustc_dri +--- rust.orig/src/rustc/Cargo.toml ++++ rust/src/rustc/Cargo.toml +@@ -15,12 +15,5 @@ rustc_driver = { path = "../librustc_dri # Make sure rustc_codegen_ssa ends up in the sysroot, because this # crate is intended to be used by codegen backends, which may not be in-tree. rustc_codegen_ssa = { path = "../librustc_codegen_ssa" } @@ -12,5 +12,6 @@ Index: rustc/src/rustc/Cargo.toml -optional = true -features = ['unprefixed_malloc_on_supported_platforms'] - --[features] + [features] -jemalloc = ['jemalloc-sys'] + llvm = ['rustc_driver/llvm']
  78. Download patch src/bootstrap/bin/rustdoc.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/bin/rustdoc.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/bin/rustdoc.rs 2020-01-27 15:34:02.000000000 +0000 @@ -25,7 +25,7 @@ fn main() { let mut dylib_path = bootstrap::util::dylib_path(); dylib_path.insert(0, PathBuf::from(libdir.clone())); - //FIXME(misdreavus): once stdsimd uses cfg(rustdoc) instead of cfg(dox), remove the `--cfg dox` + //FIXME(misdreavus): once stdsimd uses cfg(doc) instead of cfg(dox), remove the `--cfg dox` //arguments here let mut cmd = Command::new(rustdoc); cmd.args(&args)
  79. Download patch src/ci/azure-pipelines/try.yml

    --- 1.40.0+dfsg1-5/src/ci/azure-pipelines/try.yml 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/azure-pipelines/try.yml 2020-01-27 15:34:02.000000000 +0000 @@ -14,13 +14,9 @@ jobs: - template: steps/run.yml strategy: matrix: - dist-x86_64-linux: - IMAGE: dist-x86_64-linux - DEPLOY: 1 - + dist-x86_64-linux: {} dist-x86_64-linux-alt: IMAGE: dist-x86_64-linux - DEPLOY_ALT: 1 # The macOS and Windows builds here are currently disabled due to them not being # overly necessary on `try` builds. We also don't actually have anything that @@ -72,7 +68,6 @@ jobs: # DEPLOY: 1 # # dist-x86_64-msvc-alt: -# MSYS_BITS: 64 # RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler # SCRIPT: python x.py dist # DEPLOY_ALT: 1
  80. Download patch debian/patches/u-riscv64-68452.patch
  81. Download patch debian/patches/d-0000-convert-cargo-lock-to-v1.patch
  82. Download patch debian/libstd-rust-1.41.lintian-overrides

    --- 1.40.0+dfsg1-5/debian/libstd-rust-1.41.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/libstd-rust-1.41.lintian-overrides 2020-03-02 14:30:52.000000000 +0000 @@ -0,0 +1,13 @@ +# "libstd" just seemed too generic +libstd-rust-1.41 binary: package-name-doesnt-match-sonames +libstd-rust-1.41 binary: sharedobject-in-library-directory-missing-soname + +# Rust doesn't use dev shlib symlinks nor any of the other shlib support stuff +libstd-rust-1.41 binary: dev-pkg-without-shlib-symlink +libstd-rust-1.41 binary: shlib-without-versioned-soname +libstd-rust-1.41 binary: unused-shlib-entry-in-control-file + +# Libraries that use libc symbols (libterm, libstd, etc) *are* linked +# to libc. Lintian gets upset that some Rust libraries don't need +# libc, boo hoo. +libstd-rust-1.41 binary: library-not-linked-against-libc
  83. Download patch src/bootstrap/dist.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/dist.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/dist.rs 2020-01-27 15:34:02.000000000 +0000 @@ -498,16 +498,6 @@ impl Step for Rustc { } } - // Copy over the codegen backends - let backends_src = builder.sysroot_codegen_backends(compiler); - let backends_rel = backends_src.strip_prefix(&src).unwrap() - .strip_prefix(builder.sysroot_libdir_relative(compiler)).unwrap(); - // Don't use custom libdir here because ^lib/ will be resolved again with installer - let backends_dst = image.join("lib").join(&backends_rel); - - t!(fs::create_dir_all(&backends_dst)); - builder.cp_r(&backends_src, &backends_dst); - // Copy libLLVM.so to the lib dir as well, if needed. While not // technically needed by rustc itself it's needed by lots of other // components like the llvm tools and LLD. LLD is included below and @@ -616,6 +606,7 @@ impl Step for DebuggerScripts { cp_debugger_script("natvis/intrinsic.natvis"); cp_debugger_script("natvis/liballoc.natvis"); cp_debugger_script("natvis/libcore.natvis"); + cp_debugger_script("natvis/libstd.natvis"); } else { cp_debugger_script("debugger_pretty_printers_common.py"); @@ -2133,6 +2124,10 @@ impl Step for HashSign { // Maybe add libLLVM.so to the lib-dir. It will only have been built if // LLVM tools are linked dynamically. +// +// We add this to both the libdir of the rustc binary itself (for it to load at +// runtime) and also to the target directory so it can find it at link-time. +// // Note: This function does no yet support Windows but we also don't support // linking LLVM tools dynamically on Windows yet. pub fn maybe_install_llvm_dylib(builder: &Builder<'_>, @@ -2141,13 +2136,19 @@ pub fn maybe_install_llvm_dylib(builder: let src_libdir = builder .llvm_out(target) .join("lib"); - let dst_libdir = sysroot.join("lib/rustlib").join(&*target).join("lib"); - t!(fs::create_dir_all(&dst_libdir)); + let dst_libdir1 = sysroot.join("lib/rustlib").join(&*target).join("lib"); + let dst_libdir2 = sysroot.join(builder.sysroot_libdir_relative(Compiler { + stage: 1, + host: target, + })); + t!(fs::create_dir_all(&dst_libdir1)); + t!(fs::create_dir_all(&dst_libdir2)); if target.contains("apple-darwin") { let llvm_dylib_path = src_libdir.join("libLLVM.dylib"); if llvm_dylib_path.exists() { - builder.install(&llvm_dylib_path, &dst_libdir, 0o644); + builder.install(&llvm_dylib_path, &dst_libdir1, 0o644); + builder.install(&llvm_dylib_path, &dst_libdir2, 0o644); } return } @@ -2163,7 +2164,8 @@ pub fn maybe_install_llvm_dylib(builder: }); - builder.install(&llvm_dylib_path, &dst_libdir, 0o644); + builder.install(&llvm_dylib_path, &dst_libdir1, 0o644); + builder.install(&llvm_dylib_path, &dst_libdir2, 0o644); } }
  84. Download patch debian/patches/u-fix-cross-compile-install-again.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-fix-cross-compile-install-again.patch 2019-11-30 21:51:28.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-fix-cross-compile-install-again.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -Forwarded: https://github.com/rust-lang/rust/pull/66834 ---- a/src/bootstrap/install.rs -+++ b/src/bootstrap/install.rs -@@ -260,7 +260,7 @@ - }; - Rustc, "src/librustc", true, only_hosts: true, { - builder.ensure(dist::Rustc { -- compiler: self.compiler, -+ compiler: builder.compiler(builder.top_stage, self.target), - }); - install_rustc(builder, self.compiler.stage, self.target); - };
  85. Download patch debian/libstd-rust-1.40.lintian-overrides

    --- 1.40.0+dfsg1-5/debian/libstd-rust-1.40.lintian-overrides 2020-01-02 22:18:57.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/libstd-rust-1.40.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# "libstd" just seemed too generic -libstd-rust-1.40 binary: package-name-doesnt-match-sonames -libstd-rust-1.40 binary: sharedobject-in-library-directory-missing-soname - -# Rust doesn't use dev shlib symlinks nor any of the other shlib support stuff -libstd-rust-1.40 binary: dev-pkg-without-shlib-symlink -libstd-rust-1.40 binary: shlib-without-versioned-soname -libstd-rust-1.40 binary: unused-shlib-entry-in-control-file - -# Libraries that use libc symbols (libterm, libstd, etc) *are* linked -# to libc. Lintian gets upset that some Rust libraries don't need -# libc, boo hoo. -libstd-rust-1.40 binary: library-not-linked-against-libc
  86. Download patch debian/patches/u-reproducible-compiler-builtins.patch

    --- 1.40.0+dfsg1-5/debian/patches/u-reproducible-compiler-builtins.patch 2019-12-02 00:51:29.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/u-reproducible-compiler-builtins.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ ---- a/vendor/compiler_builtins/build.rs -+++ b/vendor/compiler_builtins/build.rs -@@ -423,6 +423,11 @@ - panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display()); - } - -+ // Support deterministic builds by remapping the __FILE__ prefix if the -+ // compiler supports it. This fixes the nondeterminism caused by the -+ // use of that macro in lib/builtins/int_util.h in compiler-rt. -+ cfg.flag_if_supported(&format!("-ffile-prefix-map={}=.", root.display())); -+ - let src_dir = root.join("lib/builtins"); - for (sym, src) in sources.map.iter() { - let src = src_dir.join(src);
  87. Download patch src/bootstrap/builder.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/builder.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/builder.rs 2020-01-27 15:34:02.000000000 +0000 @@ -339,7 +339,6 @@ impl<'a> Builder<'a> { Kind::Build => describe!( compile::Std, compile::Rustc, - compile::CodegenBackend, compile::StartupObjects, tool::BuildManifest, tool::Rustbook, @@ -364,10 +363,10 @@ impl<'a> Builder<'a> { Kind::Check | Kind::Clippy | Kind::Fix => describe!( check::Std, check::Rustc, - check::CodegenBackend, check::Rustdoc ), Kind::Test => describe!( + crate::toolstate::ToolStateCheck, test::Tidy, test::Ui, test::CompileFail, @@ -631,11 +630,6 @@ impl<'a> Builder<'a> { self.ensure(Libdir { compiler, target }) } - pub fn sysroot_codegen_backends(&self, compiler: Compiler) -> PathBuf { - self.sysroot_libdir(compiler, compiler.host) - .with_file_name(self.config.rust_codegen_backends_dir.clone()) - } - /// Returns the compiler's libdir where it stores the dynamic libraries that /// it itself links against. /// @@ -706,15 +700,6 @@ impl<'a> Builder<'a> { } } - /// Gets the paths to all of the compiler's codegen backends. - fn codegen_backends(&self, compiler: Compiler) -> impl Iterator<Item = PathBuf> { - fs::read_dir(self.sysroot_codegen_backends(compiler)) - .into_iter() - .flatten() - .filter_map(Result::ok) - .map(|entry| entry.path()) - } - pub fn rustdoc(&self, compiler: Compiler) -> PathBuf { self.ensure(tool::Rustdoc { compiler }) } @@ -758,12 +743,6 @@ impl<'a> Builder<'a> { let mut cargo = Command::new(&self.initial_cargo); let out_dir = self.stage_out(compiler, mode); - // Codegen backends are not yet tracked by -Zbinary-dep-depinfo, - // so we need to explicitly clear out if they've been updated. - for backend in self.codegen_backends(compiler) { - self.clear_if_dirty(&out_dir, &backend); - } - if cmd == "doc" || cmd == "rustdoc" { let my_out = match mode { // This is the intended out directory for compiler documentation. @@ -980,7 +959,7 @@ impl<'a> Builder<'a> { // argument manually via `-C link-args=-Wl,-rpath,...`. Plus isn't it // fun to pass a flag to a tool to pass a flag to pass a flag to a tool // to change a flag in a binary? - if self.config.rust_rpath { + if self.config.rust_rpath && util::use_host_linker(&target) { let rpath = if target.contains("apple") { // Note that we need to take one extra step on macOS to also pass @@ -990,10 +969,7 @@ impl<'a> Builder<'a> { // flesh out rpath support more fully in the future. rustflags.arg("-Zosx-rpath-install-name"); Some("-Wl,-rpath,@loader_path/../lib") - } else if !target.contains("windows") && - !target.contains("wasm32") && - !target.contains("emscripten") && - !target.contains("fuchsia") { + } else if !target.contains("windows") { Some("-Wl,-rpath,$ORIGIN/../lib") } else { None @@ -1242,7 +1218,8 @@ impl<'a> Builder<'a> { cargo.arg("--frozen"); } - cargo.env("RUSTC_INSTALL_BINDIR", &self.config.bindir); + // Try to use a sysroot-relative bindir, in case it was configured absolutely. + cargo.env("RUSTC_INSTALL_BINDIR", self.config.bindir_relative()); self.ci_env.force_coloring_in_ci(&mut cargo);
  88. Download patch debian/patches/llvm/clang-riscv64-rv64gc.diff

    --- 1.40.0+dfsg1-5/debian/patches/llvm/clang-riscv64-rv64gc.diff 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/debian/patches/llvm/clang-riscv64-rv64gc.diff 2020-04-08 00:12:30.000000000 +0000 @@ -0,0 +1,38 @@ +Index: llvm-toolchain-9_9.0.0/src/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +=================================================================== +--- llvm-toolchain-9_9.0.0.orig/src/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp ++++ llvm-toolchain-9_9.0.0/src/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +@@ -350,6 +350,13 @@ void riscv::getRISCVTargetFeatures(const + + // Handle all other types of extensions. + getExtensionFeatures(D, Args, Features, MArch, OtherExts); ++ } else { ++ // Default to imafdc aka gc ++ Features.push_back("+m"); ++ Features.push_back("+a"); ++ Features.push_back("+f"); ++ Features.push_back("+d"); ++ Features.push_back("+c"); + } + + // -mrelax is default, unless -mno-relax is specified. +@@ -375,5 +382,5 @@ StringRef riscv::getRISCVABI(const ArgLi + if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) + return A->getValue(); + +- return Triple.getArch() == llvm::Triple::riscv32 ? "ilp32" : "lp64"; ++ return Triple.getArch() == llvm::Triple::riscv32 ? "ilp32" : "lp64d"; + } +Index: llvm-toolchain-9_9.0.0/src/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp +=================================================================== +--- llvm-toolchain-9_9.0.0.orig/src/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ++++ llvm-toolchain-9_9.0.0/src/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp +@@ -1862,7 +1862,7 @@ void Clang::AddRISCVTargetArgs(const Arg + else if (Triple.getArch() == llvm::Triple::riscv32) + ABIName = "ilp32"; + else if (Triple.getArch() == llvm::Triple::riscv64) +- ABIName = "lp64"; ++ ABIName = "lp64d"; + else + llvm_unreachable("Unexpected triple!"); +
  89. Download patch src/ci/scripts/setup-environment.sh

    --- 1.40.0+dfsg1-5/src/ci/scripts/setup-environment.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/scripts/setup-environment.sh 2020-01-27 15:34:02.000000000 +0000 @@ -0,0 +1,31 @@ +#!/bin/bash +# This script guesses some environment variables based on the builder name and +# the current platform, to reduce the amount of variables defined in the CI +# configuration. + +set -euo pipefail +IFS=$'\n\t' + +source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" + +# Builders starting with `dist-` are dist builders, but if they also end with +# `-alt` they are alternate dist builders. +if [[ "${CI_JOB_NAME}" = dist-* ]]; then + if [[ "${CI_JOB_NAME}" = *-alt ]]; then + echo "alternate dist builder detected, setting DEPLOY_ALT=1" + ciCommandSetEnv DEPLOY_ALT 1 + else + echo "normal dist builder detected, setting DEPLOY=1" + ciCommandSetEnv DEPLOY 1 + fi +fi + +# All the Linux builds happen inside Docker. +if isLinux; then + if [[ -z "${IMAGE+x}" ]]; then + echo "linux builder detected, using docker to run the build" + ciCommandSetEnv IMAGE "${CI_JOB_NAME}" + else + echo "a custom docker image is already set" + fi +fi
  90. Download patch src/ci/scripts/install-clang.sh

    --- 1.40.0+dfsg1-5/src/ci/scripts/install-clang.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/scripts/install-clang.sh 2020-01-27 15:34:02.000000000 +0000 @@ -9,15 +9,15 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" if isMacOS; then - curl -f "${MIRRORS_BASE}/clang%2Bllvm-7.0.0-x86_64-apple-darwin.tar.xz" | tar xJf - + curl -f "${MIRRORS_BASE}/clang%2Bllvm-9.0.0-x86_64-darwin-apple.tar.xz" | tar xJf - - ciCommandSetEnv CC "$(pwd)/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang" - ciCommandSetEnv CXX "$(pwd)/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++" + ciCommandSetEnv CC "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang" + ciCommandSetEnv CXX "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang++" # Configure `AR` specifically so rustbuild doesn't try to infer it as # `clang-ar` by accident. ciCommandSetEnv AR "ar" -elif isWindows && [[ -z ${MINGW_URL+x} ]]; then +elif isWindows && [[ ${CUSTOM_MINGW-0} -ne 1 ]]; then # If we're compiling for MSVC then we, like most other distribution builders, # switch to clang as the compiler. This'll allow us eventually to enable LTO # amongst LLVM and rustc. Note that we only do this on MSVC as I don't think @@ -27,17 +27,18 @@ elif isWindows && [[ -z ${MINGW_URL+x} ] # Note that the LLVM installer is an NSIS installer # # Original downloaded here came from - # http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe - # That installer was run through `wine` on Linux and then the resulting - # installation directory (found in `$HOME/.wine/drive_c/Program Files/LLVM`) was - # packaged up into a tarball. We've had issues otherwise that the installer will - # randomly hang, provide not a lot of useful information, pollute global state, - # etc. In general the tarball is just more confined and easier to deal with when - # working with various CI environments. + # http://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe + # That installer was run through `wine ./installer.exe /S /NCRC` on Linux + # and then the resulting installation directory (found in + # `$HOME/.wine/drive_c/Program Files/LLVM`) was packaged up into a tarball. + # We've had issues otherwise that the installer will randomly hang, provide + # not a lot of useful information, pollute global state, etc. In general the + # tarball is just more confined and easier to deal with when working with + # various CI environments. mkdir -p citools cd citools - curl -f "${MIRRORS_BASE}/LLVM-7.0.0-win64.tar.gz" | tar xzf - + curl -f "${MIRRORS_BASE}/LLVM-9.0.0-win64.tar.gz" | tar xzf - ciCommandSetEnv RUST_CONFIGURE_ARGS \ "${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe" fi
  91. Download patch src/bootstrap/doc.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/doc.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/doc.rs 2020-01-27 15:34:02.000000000 +0000 @@ -433,7 +433,7 @@ impl Step for Std { builder.info(&format!("Documenting stage{} std ({})", stage, target)); let out = builder.doc_out(target); t!(fs::create_dir_all(&out)); - let compiler = builder.compiler_for(stage, builder.config.build, target); + let compiler = builder.compiler(stage, builder.config.build); builder.ensure(compile::Std { compiler, target }); let out_dir = builder.stage_out(compiler, Mode::Std) @@ -541,7 +541,7 @@ impl Step for Rustc { // Build cargo command. let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "doc"); cargo.env("RUSTDOCFLAGS", "--document-private-items --passes strip-hidden"); - compile::rustc_cargo(builder, &mut cargo); + compile::rustc_cargo(builder, &mut cargo, target); // Only include compiler crates, no dependencies of those, such as `libc`. cargo.arg("--no-deps");
  92. Download patch src/ci/scripts/collect-cpu-stats.sh

    --- 1.40.0+dfsg1-5/src/ci/scripts/collect-cpu-stats.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/scripts/collect-cpu-stats.sh 2020-01-27 15:34:02.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/bash +# Spawn a background process to collect CPU usage statistics which we'll upload +# at the end of the build. See the comments in the script here for more +# information. + +set -euo pipefail +IFS=$'\n\t' + +python src/ci/cpu-usage-over-time.py &> cpu-usage.csv &
  93. Download patch src/ci/scripts/install-mingw.sh

    --- 1.40.0+dfsg1-5/src/ci/scripts/install-mingw.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/scripts/install-mingw.sh 2020-01-27 15:34:02.000000000 +0000 @@ -27,19 +27,38 @@ IFS=$'\n\t' source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" +MINGW_ARCHIVE_32="i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z" +MINGW_ARCHIVE_64="x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z" + if isWindows; then - if [[ -z "${MINGW_URL+x}" ]]; then - arch=i686 - if [ "$MSYS_BITS" = "64" ]; then - arch=x86_64 - fi + case "${CI_JOB_NAME}" in + *i686*) + bits=32 + arch=i686 + mingw_archive="${MINGW_ARCHIVE_32}" + ;; + *x86_64*) + bits=64 + arch=x86_64 + mingw_archive="${MINGW_ARCHIVE_64}" + ;; + *) + echo "src/ci/scripts/install-mingw.sh can't detect the builder's architecture" + echo "please tweak it to recognize the builder named '${CI_JOB_NAME}'" + exit 1 + ;; + esac + + if [[ "${CUSTOM_MINGW-0}" -ne 1 ]]; then pacman -S --noconfirm --needed mingw-w64-$arch-toolchain mingw-w64-$arch-cmake \ mingw-w64-$arch-gcc mingw-w64-$arch-python2 - ciCommandAddPath "${SYSTEM_WORKFOLDER}/msys2/mingw${MSYS_BITS}/bin" + ciCommandAddPath "$(ciCheckoutPath)/msys2/mingw${bits}/bin" else - curl -o mingw.7z "${MINGW_URL}/${MINGW_ARCHIVE}" + mingw_dir="mingw${bits}" + + curl -o mingw.7z "${MIRRORS_BASE}/${mingw_archive}" 7z x -y mingw.7z > /dev/null - curl -o "${MINGW_DIR}/bin/gdborig.exe" "${MINGW_URL}/2017-04-20-${MSYS_BITS}bit-gdborig.exe" - ciCommandAddPath "$(pwd)/${MINGW_DIR}/bin" + curl -o "${mingw_dir}/bin/gdborig.exe" "${MIRRORS_BASE}/2017-04-20-${bits}bit-gdborig.exe" + ciCommandAddPath "$(pwd)/${mingw_dir}/bin" fi fi
  94. Download patch src/ci/docker/armhf-gnu/Dockerfile

    --- 1.40.0+dfsg1-5/src/ci/docker/armhf-gnu/Dockerfile 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/armhf-gnu/Dockerfile 2020-01-27 15:34:02.000000000 +0000 @@ -72,7 +72,7 @@ RUN arm-linux-gnueabihf-gcc addentropy.c # TODO: What is this?! # Source of the file: https://github.com/vfdev-5/qemu-rpi2-vexpress/raw/master/vexpress-v2p-ca15-tc1.dtb -RUN curl -O https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/vexpress-v2p-ca15-tc1.dtb +RUN curl -O https://ci-mirrors.rust-lang.org/rustc/vexpress-v2p-ca15-tc1.dtb COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh
  95. Download patch src/ci/docker/dist-x86_64-linux/build-clang.sh

    --- 1.40.0+dfsg1-5/src/ci/docker/dist-x86_64-linux/build-clang.sh 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/ci/docker/dist-x86_64-linux/build-clang.sh 2020-01-27 15:34:02.000000000 +0000 @@ -4,7 +4,7 @@ set -ex source shared.sh -LLVM=llvmorg-8.0.0-rc2 +LLVM=llvmorg-9.0.0 mkdir llvm-project cd llvm-project @@ -12,6 +12,9 @@ cd llvm-project curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \ tar xzf - --strip-components=1 +yum install -y patch +patch -Np1 < ../llvm-project-centos.patch + mkdir clang-build cd clang-build
  96. Download patch src/ci/azure-pipelines/auto.yml
  97. Download patch src/bootstrap/config.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/config.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/config.rs 2020-01-27 15:34:02.000000000 +0000 @@ -105,7 +105,6 @@ pub struct Config { pub rust_optimize_tests: bool, pub rust_dist_src: bool, pub rust_codegen_backends: Vec<Interned<String>>, - pub rust_codegen_backends_dir: String, pub rust_verify_llvm_ir: bool, pub rust_remap_debuginfo: bool, @@ -316,7 +315,6 @@ struct Rust { dist_src: Option<bool>, save_toolstates: Option<String>, codegen_backends: Option<Vec<String>>, - codegen_backends_dir: Option<String>, lld: Option<bool>, llvm_tools: Option<bool>, lldb: Option<bool>, @@ -372,7 +370,6 @@ impl Config { config.ignore_git = false; config.rust_dist_src = true; config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")]; - config.rust_codegen_backends_dir = "codegen-backends".to_owned(); config.deny_warnings = true; config.missing_tools = false; @@ -575,8 +572,6 @@ impl Config { .collect(); } - set(&mut config.rust_codegen_backends_dir, rust.codegen_backends_dir.clone()); - config.rust_codegen_units = rust.codegen_units.map(threads_from_config); config.rust_codegen_units_std = rust.codegen_units_std.map(threads_from_config); } @@ -647,6 +642,20 @@ impl Config { config } + /// Try to find the relative path of `bindir`, otherwise return it in full. + pub fn bindir_relative(&self) -> &Path { + let bindir = &self.bindir; + if bindir.is_absolute() { + // Try to make it relative to the prefix. + if let Some(prefix) = &self.prefix { + if let Ok(stripped) = bindir.strip_prefix(prefix) { + return stripped; + } + } + } + bindir + } + /// Try to find the relative path of `libdir`. pub fn libdir_relative(&self) -> Option<&Path> { let libdir = self.libdir.as_ref()?;
  98. Download patch debian/copyright
  99. Download patch src/bootstrap/channel.rs

    --- 1.40.0+dfsg1-5/src/bootstrap/channel.rs 2019-12-16 15:38:05.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/bootstrap/channel.rs 2020-01-27 15:34:02.000000000 +0000 @@ -13,7 +13,7 @@ use build_helper::output; use crate::Build; // The version number -pub const CFG_RELEASE_NUM: &str = "1.40.0"; +pub const CFG_RELEASE_NUM: &str = "1.41.0"; pub struct GitInfo { inner: Option<Info>,
  100. Download patch src/doc/book/src/ch04-03-slices.md

    --- 1.40.0+dfsg1-5/src/doc/book/src/ch04-03-slices.md 2019-10-29 12:16:09.000000000 +0000 +++ 1.41.0+dfsg1+llvm-0ubuntu2/src/doc/book/src/ch04-03-slices.md 2019-11-15 16:30:04.000000000 +0000 @@ -158,7 +158,7 @@ in the slice and `ending_index` is one m slice. Internally, the slice data structure stores the starting position and the length of the slice, which corresponds to `ending_index` minus `starting_index`. So in the case of `let world = &s[6..11];`, `world` would be -a slice that contains a pointer to the 7th byte of `s` with a length value of 5. +a slice that contains a pointer to the 7th byte (counting from 1) of `s` with a length value of 5. Figure 4-6 shows this in a diagram.
  101. ...
  1. pep8
  2. rust-uuid
  3. rustc