rust/src/ci/docker
Manish Goregaokar 5b1252bcc9
Rollup merge of #60791 - ehuss:update-books, r=Mark-Simulacrum
Update books

## nomicon

1 commits in fb29b147be4d9a1f8e24aba753a7e1de537abf61..c656171b749b7307f21371dd0d3278efee5573b8
2019-04-22 19:10:29 -0400 to 2019-04-25 15:31:26 -0400
- Lifetimes: Updates to incorporate NLL (rust-lang-nursery/nomicon#101)

## reference

5 commits in 2a2de9ce095979978ad7b582daecf94e4070b916..862b669c395822bb0938781d74f860e5762ad4fb
2019-04-22 10:25:52 -0700 to 2019-05-04 23:41:35 -0700
- Typo (rust-lang-nursery/reference#606)
- Added missing ? to Generics from InherentImpl and TraitImpl (rust-lang-nursery/reference#604)
- Add missing ( to ExternalFunctionItem (rust-lang-nursery/reference#603)
- Remove unneeded | from AssignmentExpression (rust-lang-nursery/reference#601)
- Remove unneeded ( from TypePathSegment (rust-lang-nursery/reference#602)

## book

6 commits in db919bc6bb9071566e9c4f05053672133eaac33e..29fe982990e43b9367be0ff47abc82fb2123fd03
2019-04-15 20:11:03 -0400 to 2019-05-15 17:48:40 -0400
- Ignore a non-compiling test listing and add code to fix a test listing
- Remove nostarch snapshots I've checked in layout
- Reword error messages to maybe not need to wrap lines in print
- This example doesn't compile but wasn't marked as such
- Update install instructions for VS 2019 (rust-lang/book#1923)
- Switch IRC to Discord

## rust-by-example

9 commits in 1ff0f8e018838a710ebc0cc1a7bf74ebe73ad9f1..811c697b232c611ed754d279ed20643a0c4096f6
2019-04-15 08:15:32 -0300 to 2019-04-28 18:56:42 -0300
- Fix typo in dsl.md (rust-lang/rust-by-example#1187)
- File read lines (rust-lang/rust-by-example#1186)
- For https://github.com/rust-lang/rust-by-example/issues/1184 closes rust-lang/rust-by-example#1184 (rust-lang/rust-by-example#1185)
- Link to Reference for macro_rules designators (rust-lang/rust-by-example#1182)
- Improve section Meta/Docs (rust-lang/rust-by-example#1183)
- Small improvements to various files (rust-lang/rust-by-example#1173)
- 19.2 Vectors Error in Code Example (rust-lang/rust-by-example#1178)
- For https://github.com/rust-lang/rust-by-example/issues/1175 (rust-lang/rust-by-example#1176)
- For https://github.com/rust-lang/rust-by-example/issues/1179 (rust-lang/rust-by-example#1180)

## rustc-guide

12 commits in 99e1b1d53656be08654df399fc200584aebb50e4..3cb727b62b953d59b4360d39aa68b6dc8f157655
2019-04-20 09:57:54 -0500 to 2019-05-07 09:53:32 -0500
- Fix typo, 'which' repeated twice
- [canonicalization] fix result canonicalization example (rust-lang/rustc-guide#304)
- Rename to RUSTC_LOG
- Added mention of universal ctags
- Fix link in walkthrough
- Remove IRC from discussion chats
- Bring the updating LLVM guide up to date
- use nightly rust for ci
- Fixed broken chalk links
- Add documentation for two-phase borrows
- Explain new powers of the `treat-err-as-bug` flag
- Update lowering-module test case

## edition-guide

3 commits in c413d42a207bd082f801ec0137c31b71e4bfed4c..581c6cccfaf995394ea9dcac362dc8e731c18558
2019-04-22 01:14:56 +0200 to 2019-05-06 12:47:44 -0700
- Fix typo in controlling-panics-with-std-panic.md (rust-lang-nursery/edition-guide#158)
- Fix links for book editions. (rust-lang-nursery/edition-guide#149)
- Update now that NLL is enabled in 2015. (rust-lang-nursery/edition-guide#157)

## embedded-book

3 commits in de3d55f521e657863df45260ebbca1b10527f662..9858872bd1b7dbba5ec27dc30d34eba00acd7ef9
2019-04-22 12:58:28 +0000 to 2019-05-02 18:56:54 +0000
- Update linux.md  (rust-embedded/book#167)
- Clarify list of available targets for installation  (rust-embedded/book#165)
- minor grammar fix  (rust-embedded/book#188)
2019-05-17 11:34:08 -07:00
..
arm-android ci: use a custom android sdk manager with pinning and mirroring 2019-04-12 22:18:48 +02:00
armhf-gnu fix broken download link in the armhf-gnu image 2019-03-28 19:51:05 +01:00
asmjs Update llvm-emscripten 2018-11-04 18:50:57 +01:00
disabled Update CI configuration for building Redox libraries 2019-03-17 08:04:57 -06:00
dist-aarch64-linux build dist-aarch64-linux with --enable-profiler 2019-05-02 12:11:42 -04:00
dist-android Add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf 2018-12-13 19:21:27 +02:00
dist-arm-linux [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
dist-armhf-linux [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
dist-armv7-linux [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
dist-i586-gnu-i586-i686-musl Remove obsolete flags in the i586_musl Dockerfile 2018-07-19 16:36:45 +02:00
dist-i686-freebsd rustbuild: Disable docs on cross-compiled builds 2018-03-25 23:31:41 -07:00
dist-i686-linux Update CI-clang to 7.0.0 for Linux dists. 2018-11-14 17:42:06 +01:00
dist-mips-linux rustbuild: Disable docs on cross-compiled builds 2018-03-25 23:31:41 -07:00
dist-mips64-linux rustbuild: Disable docs on cross-compiled builds 2018-03-25 23:31:41 -07:00
dist-mips64el-linux rustbuild: Disable docs on cross-compiled builds 2018-03-25 23:31:41 -07:00
dist-mipsel-linux rustbuild: Disable docs on cross-compiled builds 2018-03-25 23:31:41 -07:00
dist-powerpc-linux [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
dist-powerpc64-linux Wrap a long configure line 2019-03-06 20:33:09 -08:00
dist-powerpc64le-linux [CI] Update binutils for powerpc64 and powerpc64le 2019-03-06 20:14:27 -08:00
dist-s390x-linux [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
dist-various-1 Remove unnecessary ignore-tidy-linelength 2019-04-23 11:42:14 +01:00
dist-various-2 Auto merge of #60585 - sunfishcode:wasm32-wasi, r=alexcrichton 2019-05-10 07:02:38 +00:00
dist-x86_64-freebsd rustbuild: Disable docs on cross-compiled builds 2018-03-25 23:31:41 -07:00
dist-x86_64-linux build-gcc: Create missing cc symlink 2019-04-29 13:12:23 +00:00
dist-x86_64-musl Conditionally provide cc in musl-toolchain.sh 2019-05-10 16:12:47 +02:00
dist-x86_64-netbsd Update toolchain to build NetBSD release 2019-03-01 10:34:08 -08:00
i686-gnu CI: Trim some tests from i686-gnu 2019-03-10 08:23:32 -07:00
i686-gnu-nopt ci: Remove the need for dumb-init 2017-08-26 18:34:13 -07:00
mingw-check Move compiletest test run to mingw-check builder 2018-12-20 18:00:07 +01:00
scripts Conditionally provide cc in musl-toolchain.sh 2019-05-10 16:12:47 +02:00
test-various Merge remote-tracking branch 'upstream/master' into asm-compile-tests 2019-03-16 23:40:43 +01:00
x86_64-gnu ci: bump ubuntu 18.10 images to 19.04 2019-05-09 11:51:01 +02:00
x86_64-gnu-aux Fixup some previous configuration errors. 2017-12-26 02:14:54 +08:00
x86_64-gnu-debug ci: bump ubuntu 18.10 images to 19.04 2019-05-09 11:51:01 +02:00
x86_64-gnu-distcheck fix option for RUST_CONFIGURE_ARGS to be rust.ignore-git=false 2017-08-29 22:01:51 -07:00
x86_64-gnu-full-bootstrap ci: Remove the need for dumb-init 2017-08-26 18:34:13 -07:00
x86_64-gnu-llvm-6.0 Bump minimum required LLVM version to 6.0 2018-12-09 12:05:40 +01:00
x86_64-gnu-nopt ci: Only run compare-mode tests on one builder 2018-11-30 14:31:04 -08:00
x86_64-gnu-tools Rollup merge of #60791 - ehuss:update-books, r=Mark-Simulacrum 2019-05-17 11:34:08 -07:00
README.md [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
run.sh [CI] record docker image info for reuse 2019-03-25 15:27:49 -07:00

Docker images for CI

This folder contains a bunch of docker images used by the continuous integration (CI) of Rust. An script is accompanied (run.sh) with these images to actually execute them. To test out an image execute:

./src/ci/docker/run.sh $image_name

for example:

./src/ci/docker/run.sh x86_64-gnu

Images will output artifacts in an obj dir at the root of a repository.

Filesystem layout

  • Each directory, excluding scripts and disabled, corresponds to a docker image
  • scripts contains files shared by docker images
  • disabled contains images that are not built on travis

Docker Toolbox on Windows

For Windows before Windows 10, the docker images can be run on Windows via Docker Toolbox. There are several preparation needs to be made before running a Docker image.

  1. Stop the virtual machine from the terminal with docker-machine stop

  2. If your Rust source is placed outside of C:\Users\**, e.g. if you place the repository in the E:\rust folder, please add a shared folder from VirtualBox by:

    1. Select the "default" virtual machine inside VirtualBox, then click "Settings"

    2. Go to "Shared Folders", click "Add shared folder" (the folder icon with a plus sign), fill in the following information, then click "OK":

      • Folder path: E:\rust
      • Folder name: e/rust
      • Read-only: ☐ unchecked
      • Auto-mount: ☑ checked
      • Make Permanent: ☑ checked
  3. VirtualBox might not support creating symbolic links inside a shared folder by default. You can enable it manually by running these from cmd.exe:

    cd "C:\Program Files\Oracle\VirtualBox"
    VBoxManage setextradata default VBoxInternal2/SharedFoldersEnableSymlinksCreate/e/rust 1
    ::                                                                              ^~~~~~
    ::                                                                              folder name
    
  4. Restart the virtual machine from terminal with docker-machine start.

To run the image,

  1. Launch the "Docker Quickstart Terminal".
  2. Execute ./src/ci/docker/run.sh $image_name as explained at the beginning.

Cross toolchains

A number of these images take quite a long time to compile as they're building whole gcc toolchains to do cross builds with. Much of this is relatively self-explanatory but some images use crosstool-ng which isn't quite as self explanatory. Below is a description of where these *.config files come form, how to generate them, and how the existing ones were generated.

Generating a .config file

If you have a linux-cross image lying around you can use that and skip the next two steps.

  • First we spin up a container and copy build_toolchain_root.sh into it. All these steps are outside the container:
# Note: We use ubuntu:15.10 because that's the "base" of linux-cross Docker
# image
$ docker run -it ubuntu:15.10 bash
$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
cfbec05ed730        ubuntu:15.10        "bash"              16 seconds ago      Up 15 seconds                           drunk_murdock
$ docker cp build_toolchain_root.sh drunk_murdock:/
  • Then inside the container we build crosstool-ng by simply calling the bash script we copied in the previous step:
$ bash build_toolchain_root.sh
  • Now, inside the container run the following command to configure the toolchain. To get a clue of which options need to be changed check the next section and come back.
$ ct-ng menuconfig
  • Finally, we retrieve the .config file from the container and give it a meaningful name. This is done outside the container.
$ docker drunk_murdock:/.config arm-linux-gnueabi.config
  • Now you can shutdown the container or repeat the two last steps to generate a new .config file.

Toolchain configuration

Changes on top of the default toolchain configuration used to generate the .config files in this directory. The changes are formatted as follows:

$category > $option = $value -- $comment

arm-linux-gnueabi.config

For targets: arm-unknown-linux-gnueabi

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Path and misc options > Patches origin = Bundled, then local
  • Path and misc options > Local patch directory = /tmp/patches
  • Target options > Target Architecture = arm
  • Target options > Architecture level = armv6 -- (+)
  • Target options > Floating point = software (no FPU) -- (*)
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 3.2.72 -- Precise kernel
  • C-library > glibc version = 2.16.0
  • C compiler > gcc version = 5.2.0
  • C compiler > C++ = ENABLE -- to cross compile LLVM

arm-linux-gnueabihf.config

For targets: arm-unknown-linux-gnueabihf

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Path and misc options > Patches origin = Bundled, then local
  • Path and misc options > Local patch directory = /tmp/patches
  • Target options > Target Architecture = arm
  • Target options > Architecture level = armv6 -- (+)
  • Target options > Use specific FPU = vfp -- (+)
  • Target options > Floating point = hardware (FPU) -- (*)
  • Target options > Default instruction set mode = arm -- (+)
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 3.2.72 -- Precise kernel
  • C-library > glibc version = 2.16.0
  • C compiler > gcc version = 5.2.0
  • C compiler > C++ = ENABLE -- to cross compile LLVM

armv7-linux-gnueabihf.config

For targets: armv7-unknown-linux-gnueabihf

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Path and misc options > Patches origin = Bundled, then local
  • Path and misc options > Local patch directory = /tmp/patches
  • Target options > Target Architecture = arm
  • Target options > Suffix to the arch-part = v7
  • Target options > Architecture level = armv7-a -- (+)
  • Target options > Use specific FPU = vfpv3-d16 -- (*)
  • Target options > Floating point = hardware (FPU) -- (*)
  • Target options > Default instruction set mode = thumb -- (*)
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 3.2.72 -- Precise kernel
  • C-library > glibc version = 2.16.0
  • C compiler > gcc version = 5.2.0
  • C compiler > C++ = ENABLE -- to cross compile LLVM

(*) These options have been selected to match the configuration of the arm toolchains shipped with Ubuntu 15.10 (+) These options have been selected to match the gcc flags we use to compile C libraries like jemalloc. See the mk/cfg/arm(v7)-uknown-linux-gnueabi{,hf}.mk file in Rust's source code.

aarch64-linux-gnu.config

For targets: aarch64-unknown-linux-gnu

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Target options > Target Architecture = arm
  • Target options > Bitness = 64-bit
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 4.2.6
  • C-library > glibc version = 2.17 -- aarch64 support was introduced in this version
  • C compiler > gcc version = 5.2.0
  • C compiler > C++ = ENABLE -- to cross compile LLVM

powerpc-linux-gnu.config

For targets: powerpc-unknown-linux-gnu

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Path and misc options > Patches origin = Bundled, then local
  • Path and misc options > Local patch directory = /tmp/patches
  • Target options > Target Architecture = powerpc
  • Target options > Emit assembly for CPU = powerpc -- pure 32-bit PowerPC
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
  • C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
  • C compiler > gcc version = 5.2.0
  • C compiler > C++ = ENABLE -- to cross compile LLVM

powerpc64-linux-gnu.config

For targets: powerpc64-unknown-linux-gnu

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Path and misc options > Patches origin = Bundled, then local
  • Path and misc options > Local patch directory = /tmp/patches
  • Target options > Target Architecture = powerpc
  • Target options > Bitness = 64-bit
  • Target options > Emit assembly for CPU = power4 -- (+)
  • Target options > Tune for CPU = power6 -- (+)
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
  • C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
  • C compiler > gcc version = 5.2.0
  • C compiler > C++ = ENABLE -- to cross compile LLVM

(+) These CPU options match the configuration of the toolchains in RHEL6.

s390x-linux-gnu.config

For targets: s390x-unknown-linux-gnu

  • Path and misc options > Prefix directory = /x-tools/${CT_TARGET}
  • Path and misc options > Patches origin = Bundled, then local
  • Path and misc options > Local patch directory = /tmp/patches
  • Target options > Target Architecture = s390
  • Target options > Bitness = 64-bit
  • Operating System > Target OS = linux
  • Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
  • C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
  • C compiler > gcc version = 5.2.0
  • C compiler > gcc extra config = --with-arch=z10 -- LLVM's minimum support
  • C compiler > C++ = ENABLE -- to cross compile LLVM