File List
Not logged in

Files of check-in [d26d71cd86] in directory wiki_references/2017/software/Rust/src_from_GitHub/the_repository_clones/rust/src/ci/docker   [history]


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.

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

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.

# 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:/
$ bash build_toolchain_root.sh
$ ct-ng menuconfig
$ docker drunk_murdock:/.config arm-linux-gnueabi.config

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

arm-linux-gnueabihf.config

For targets: arm-unknown-linux-gnueabihf

armv7-linux-gnueabihf.config

For targets: armv7-unknown-linux-gnueabihf

(*) 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

powerpc-linux-gnu.config

For targets: powerpc-unknown-linux-gnu

powerpc64-linux-gnu.config

For targets: powerpc64-unknown-linux-gnu

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

s390x-linux-gnu.config

For targets: s390x-unknown-linux-gnu