close
The Wayback Machine - https://web.archive.org/web/20201101214538/https://github.com/rust-lang/rust/commit/38eb369fa4d06e55869a8fae62796a7b0085a5bd
Skip to content
Permalink
Browse files

Enforce Python 3 as much as possible

  • Loading branch information
GuillaumeGomez authored and Mark-Simulacrum committed Apr 10, 2020
1 parent 42abbd8 commit 38eb369fa4d06e55869a8fae62796a7b0085a5bd
Showing with 131 additions and 111 deletions.
  1. +2 −2 README.md
  2. +2 −4 config.toml.example
  3. +1 −0 configure
  4. +6 −1 src/bootstrap/job.rs
  5. +0 −2 src/bootstrap/sanity.rs
  6. +1 −1 src/ci/docker/arm-android/Dockerfile
  7. +2 −2 src/ci/docker/armhf-gnu/Dockerfile
  8. +2 −2 src/ci/docker/disabled/aarch64-gnu/Dockerfile
  9. +2 −2 src/ci/docker/disabled/asmjs/Dockerfile
  10. +1 −1 src/ci/docker/disabled/dist-aarch64-android/Dockerfile
  11. +2 −2 src/ci/docker/disabled/dist-armv7-android/Dockerfile
  12. +2 −2 src/ci/docker/disabled/dist-i686-android/Dockerfile
  13. +2 −2 src/ci/docker/disabled/dist-powerpcspe-linux/Dockerfile
  14. +2 −2 src/ci/docker/disabled/dist-sparc64-linux/Dockerfile
  15. +1 −1 src/ci/docker/disabled/dist-x86_64-android/Dockerfile
  16. +2 −2 src/ci/docker/disabled/dist-x86_64-dragonfly/Dockerfile
  17. +2 −2 src/ci/docker/disabled/dist-x86_64-haiku/Dockerfile
  18. +1 −1 src/ci/docker/disabled/dist-x86_64-redox/Dockerfile
  19. +1 −1 src/ci/docker/dist-aarch64-linux/Dockerfile
  20. +1 −1 src/ci/docker/dist-android/Dockerfile
  21. +1 −1 src/ci/docker/dist-arm-linux/Dockerfile
  22. +1 −1 src/ci/docker/dist-armhf-linux/Dockerfile
  23. +1 −1 src/ci/docker/dist-armv7-linux/Dockerfile
  24. +3 −3 src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
  25. +2 −2 src/ci/docker/dist-i686-freebsd/Dockerfile
  26. +2 −2 src/ci/docker/dist-mips-linux/Dockerfile
  27. +2 −2 src/ci/docker/dist-mips64-linux/Dockerfile
  28. +2 −2 src/ci/docker/dist-mips64el-linux/Dockerfile
  29. +2 −2 src/ci/docker/dist-mipsel-linux/Dockerfile
  30. +1 −1 src/ci/docker/dist-powerpc-linux/Dockerfile
  31. +1 −1 src/ci/docker/dist-powerpc64-linux/Dockerfile
  32. +1 −1 src/ci/docker/dist-powerpc64le-linux/Dockerfile
  33. +1 −1 src/ci/docker/dist-s390x-linux/Dockerfile
  34. +2 −3 src/ci/docker/dist-various-1/Dockerfile
  35. +2 −2 src/ci/docker/dist-various-2/Dockerfile
  36. +2 −2 src/ci/docker/dist-x86_64-freebsd/Dockerfile
  37. +2 −2 src/ci/docker/dist-x86_64-musl/Dockerfile
  38. +1 −1 src/ci/docker/dist-x86_64-netbsd/Dockerfile
  39. +2 −2 src/ci/docker/i686-gnu-nopt/Dockerfile
  40. +2 −2 src/ci/docker/i686-gnu/Dockerfile
  41. +6 −6 src/ci/docker/mingw-check/Dockerfile
  42. +2 −2 src/ci/docker/mingw-check/validate-toolstate.sh
  43. +1 −1 src/ci/docker/scripts/android-base-apt-get.sh
  44. +1 −1 src/ci/docker/scripts/android-ndk.sh
  45. +1 −1 src/ci/docker/scripts/cross-apt-packages.sh
  46. +4 −4 src/ci/docker/test-various/Dockerfile
  47. +5 −2 src/ci/docker/wasm32/Dockerfile
  48. +1 −1 src/ci/docker/x86_64-gnu-aux/Dockerfile
  49. +4 −4 src/ci/docker/x86_64-gnu-debug/Dockerfile
  50. +2 −2 src/ci/docker/x86_64-gnu-distcheck/Dockerfile
  51. +2 −2 src/ci/docker/x86_64-gnu-full-bootstrap/Dockerfile
  52. +2 −2 src/ci/docker/x86_64-gnu-nopt/Dockerfile
  53. +1 −1 src/ci/docker/x86_64-gnu-tools/Dockerfile
  54. +2 −2 src/ci/docker/x86_64-gnu-tools/checktools.sh
  55. +2 −2 src/ci/docker/x86_64-gnu/Dockerfile
  56. +9 −1 src/ci/run.sh
  57. +3 −2 src/ci/scripts/install-mingw.sh
  58. +3 −3 src/ci/scripts/install-msys2-packages.sh
  59. +1 −1 src/etc/dec2flt_table.py
  60. +1 −1 src/etc/test-float-parse/runtests.py
  61. +1 −1 src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
  62. +9 −2 src/tools/publish_toolstate.py
@@ -27,7 +27,7 @@ or reading the [rustc dev guide][rustcguidebuild].
1. Make sure you have installed the dependencies:

* `g++` 5.1 or later or `clang++` 3.5 or later
* `python` 2.7 (but not 3.x)
* `python` 3 or 2.7
* GNU `make` 3.81 or later
* `cmake` 3.4.3 or later
* `curl`
@@ -113,7 +113,7 @@ build.
make \
diffutils \
tar \
mingw-w64-x86_64-python2 \
mingw-w64-x86_64-python \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gcc
```
@@ -168,11 +168,9 @@

# Python interpreter to use for various tasks throughout the build, notably
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
# Note that Python 2 is currently required.
#
# Defaults to python2.7, then python2. If neither executable can be found, then
# it defaults to the Python interpreter used to execute x.py.
#python = "python2.7"
# Defaults to the Python interpreter used to execute x.py.
#python = "python"

# Force Cargo to check that Cargo.lock describes the precise dependency
# set that all the Cargo.toml files create, instead of updating it.
@@ -11,6 +11,7 @@ try() {
fi
}

try python3 "$@"
try python2.7 "$@"
try python27 "$@"
try python2 "$@"
@@ -103,7 +103,12 @@ pub unsafe fn setup(build: &mut Build) {
};

let parent = OpenProcess(PROCESS_DUP_HANDLE, FALSE, pid.parse().unwrap());
assert!(!parent.is_null(), "{}", io::Error::last_os_error());
assert!(
!parent.is_null(),
"PID `{}` doesn't seem to exist: {}",
pid,
io::Error::last_os_error()
);
let mut parent_handle = ptr::null_mut();
let r = DuplicateHandle(
GetCurrentProcess(),
@@ -132,8 +132,6 @@ pub fn check(build: &mut Build) {
.python
.take()
.map(|p| cmd_finder.must_have(p))
.or_else(|| cmd_finder.maybe_have("python2.7"))
.or_else(|| cmd_finder.maybe_have("python2"))
.or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
.or_else(|| Some(cmd_finder.must_have("python")));

@@ -31,7 +31,7 @@ ENV TARGETS=arm-linux-androideabi

ENV RUST_CONFIGURE_ARGS --arm-linux-androideabi-ndk=/android/ndk/arm-14

ENV SCRIPT python2.7 ../x.py test --target $TARGETS
ENV SCRIPT python3 ../x.py test --target $TARGETS

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
@@ -14,7 +14,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
libc6-dev \
libc6-dev-armhf-cross \
make \
python2.7 \
python3 \
qemu-system-arm \
xz-utils

@@ -78,6 +78,6 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs
ENV SCRIPT python2.7 ../x.py test --target arm-unknown-linux-gnueabihf
ENV SCRIPT python3 ../x.py test --target arm-unknown-linux-gnueabihf

ENV NO_CHANGE_USER=1
@@ -14,7 +14,7 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
libc6-dev \
libc6-dev-arm64-cross \
make \
python2.7 \
python3 \
qemu-system-aarch64 \
xz-utils

@@ -75,5 +75,5 @@ RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS \
--qemu-aarch64-rootfs=/tmp/rootfs
ENV SCRIPT python2.7 ../x.py test --target aarch64-unknown-linux-gnu
ENV SCRIPT python3 ../x.py test --target aarch64-unknown-linux-gnu
ENV NO_CHANGE_USER=1
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python \
python3 \
git \
cmake \
sudo \
@@ -33,7 +33,7 @@ ENV EMCC_CFLAGS=-O1
# Emscripten installation is user-specific
ENV NO_CHANGE_USER=1

ENV SCRIPT python2.7 ../x.py test --target $TARGETS
ENV SCRIPT python3 ../x.py test --target $TARGETS

# This is almost identical to the wasm32-unknown-emscripten target, so
# running with assertions again is not useful
@@ -19,7 +19,7 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-cargo-openssl-static

ENV SCRIPT python2.7 ../x.py dist --target $HOSTS --host $HOSTS
ENV SCRIPT python3 ../x.py dist --target $HOSTS --host $HOSTS

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
@@ -33,11 +33,11 @@ ENV RUST_CONFIGURE_ARGS \
# build to finish we use --warn-unresolved-symbols. Note that the missing
# symbols does not affect std, only the compiler (llvm) and cargo (openssl).
ENV SCRIPT \
python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
python3 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
(export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \
rm /android/ndk/arm && \
ln -s /android/ndk/arm-14 /android/ndk/arm && \
python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
python3 ../x.py dist --host $HOSTS --target $HOSTS)

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
@@ -33,11 +33,11 @@ ENV RUST_CONFIGURE_ARGS \
# build to finish we use --warn-unresolved-symbols. Note that the missing
# symbols does not affect std, only the compiler (llvm) and cargo (openssl).
ENV SCRIPT \
python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
python3 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
(export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \
rm /android/ndk/x86 && \
ln -s /android/ndk/x86-14 /android/ndk/x86 && \
python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
python3 ../x.py dist --host $HOSTS --target $HOSTS)

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -23,4 +23,4 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=powerpc-unknown-linux-gnuspe

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -23,4 +23,4 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=sparc64-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -19,7 +19,7 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-cargo-openssl-static

ENV SCRIPT python2.7 ../x.py dist --target $HOSTS --host $HOSTS
ENV SCRIPT python3 ../x.py dist --target $HOSTS --host $HOSTS

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -33,4 +33,4 @@ ENV \
ENV HOSTS=x86_64-unknown-dragonfly

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
nasm \
pkg-config \
python2.7 \
python3 \
sudo \
texinfo \
wget \
@@ -46,4 +46,4 @@ ENV RUST_CONFIGURE_ARGS --disable-jemalloc \
--set=$TARGET.cc=x86_64-unknown-haiku-gcc \
--set=$TARGET.cxx=x86_64-unknown-haiku-g++ \
--set=$TARGET.llvm-config=/bin/llvm-config-haiku
ENV SCRIPT python2.7 ../x.py dist --host=$HOST --target=$HOST
ENV SCRIPT python3 ../x.py dist --host=$HOST --target=$HOST
@@ -19,4 +19,4 @@ ENV \
CXX_x86_64_unknown_redox=x86_64-unknown-redox-g++

ENV RUST_CONFIGURE_ARGS --enable-extended
ENV SCRIPT python2.7 ../x.py dist --target x86_64-unknown-redox
ENV SCRIPT python3 ../x.py dist --target x86_64-unknown-redox
@@ -36,4 +36,4 @@ ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--enable-profiler \
--disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -32,7 +32,7 @@ ENV RUST_CONFIGURE_ARGS \
--x86_64-linux-android-ndk=/android/ndk/x86_64-21 \
--disable-docs

ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
ENV SCRIPT python3 ../x.py dist --target $TARGETS

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
@@ -28,4 +28,4 @@ ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \
ENV HOSTS=arm-unknown-linux-gnueabi

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -28,4 +28,4 @@ ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \
ENV HOSTS=arm-unknown-linux-gnueabihf

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -28,4 +28,4 @@ ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
ENV HOSTS=armv7-unknown-linux-gnueabihf

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
xz-utils \
@@ -46,5 +46,5 @@ ENV CFLAGS_i586_unknown_linux_musl=-Wa,-mrelax-relocations=no
ENV TARGETS=i586-unknown-linux-gnu,i686-unknown-linux-musl

ENV SCRIPT \
python2.7 ../x.py test --target $TARGETS && \
python2.7 ../x.py dist --target $TARGETS,i586-unknown-linux-musl
python3 ../x.py test --target $TARGETS && \
python3 ../x.py dist --target $TARGETS,i586-unknown-linux-musl
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -30,4 +30,4 @@ ENV \
ENV HOSTS=i686-unknown-freebsd

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -23,4 +23,4 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=mips-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -22,4 +22,4 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=mips64-unknown-linux-gnuabi64

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -23,4 +23,4 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=mips64el-unknown-linux-gnuabi64

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
git \
cmake \
sudo \
@@ -22,4 +22,4 @@ RUN sh /scripts/sccache.sh
ENV HOSTS=mipsel-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -35,4 +35,4 @@ ENV \
ENV HOSTS=powerpc-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -36,4 +36,4 @@ ENV \
ENV HOSTS=powerpc64-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -33,4 +33,4 @@ ENV \
ENV HOSTS=powerpc64le-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
@@ -35,4 +35,4 @@ ENV \
ENV HOSTS=s390x-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
Image

0 comments on commit 38eb369

Please sign in to comment.
You can’t perform that action at this time.