diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95551d679b98..4f7cbd6a998f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ name: CI - try-perf - automation/bors/try - master + - optimise-docker-cache pull_request: branches: - "**" @@ -52,18 +53,8 @@ jobs: strategy: matrix: include: - - name: mingw-check - os: ubuntu-20.04-4core-16gb - env: {} - - name: mingw-check-tidy - os: ubuntu-20.04-4core-16gb - env: {} - - name: x86_64-gnu-llvm-16 - env: - ENABLE_GCC_CODEGEN: "1" - os: ubuntu-20.04-16core-64gb - - name: x86_64-gnu-tools - os: ubuntu-20.04-16core-64gb + - name: temp + os: ubuntu-20.04 env: {} timeout-minutes: 600 runs-on: "${{ matrix.os }}" @@ -194,128 +185,128 @@ jobs: - ARM64 - linux - name: arm-android - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: armhf-gnu - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-aarch64-linux env: CODEGEN_BACKENDS: "llvm,cranelift" - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 - name: dist-android - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-arm-linux - os: ubuntu-20.04-16core-64gb + os: ubuntu-20.04 env: {} - name: dist-armhf-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-armv7-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-i586-gnu-i586-i686-musl - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-i686-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-loongarch64-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-powerpc-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-powerpc64-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-powerpc64le-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-riscv64-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-s390x-linux - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-various-1 - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-various-2 - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-x86_64-freebsd - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-x86_64-illumos - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: dist-x86_64-linux env: CODEGEN_BACKENDS: "llvm,cranelift" - os: ubuntu-20.04-16core-64gb + os: ubuntu-20.04 - name: dist-x86_64-linux-alt env: IMAGE: dist-x86_64-linux CODEGEN_BACKENDS: "llvm,cranelift" - os: ubuntu-20.04-16core-64gb + os: ubuntu-20.04 - name: dist-x86_64-musl env: CODEGEN_BACKENDS: "llvm,cranelift" - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 - name: dist-x86_64-netbsd - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: i686-gnu - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: i686-gnu-nopt - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: mingw-check - os: ubuntu-20.04-4core-16gb + os: ubuntu-20.04 env: {} - name: test-various - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: x86_64-gnu - os: ubuntu-20.04-4core-16gb + os: ubuntu-20.04 env: {} - name: x86_64-gnu-stable env: IMAGE: x86_64-gnu RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable CI_ONLY_WHEN_CHANNEL: nightly - os: ubuntu-20.04-4core-16gb + os: ubuntu-20.04 - name: x86_64-gnu-aux - os: ubuntu-20.04-4core-16gb + os: ubuntu-20.04 env: {} - name: x86_64-gnu-integration env: CI_ONLY_WHEN_CHANNEL: nightly - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 - name: x86_64-gnu-debug - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: x86_64-gnu-distcheck - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 env: {} - name: x86_64-gnu-llvm-17 env: RUST_BACKTRACE: 1 - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 - name: x86_64-gnu-llvm-16 env: RUST_BACKTRACE: 1 - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 - name: x86_64-gnu-nopt - os: ubuntu-20.04-4core-16gb + os: ubuntu-20.04 env: {} - name: x86_64-gnu-tools env: DEPLOY_TOOLSTATES_JSON: toolstates-linux.json - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 - name: dist-x86_64-apple env: SCRIPT: "./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin" @@ -588,7 +579,7 @@ jobs: - name: dist-x86_64-linux env: CODEGEN_BACKENDS: "llvm,cranelift" - os: ubuntu-20.04-16core-64gb + os: ubuntu-20.04 timeout-minutes: 600 runs-on: "${{ matrix.os }}" steps: diff --git a/src/ci/docker/host-x86_64/temp/Dockerfile b/src/ci/docker/host-x86_64/temp/Dockerfile new file mode 100644 index 0000000000000..cd38b9c67fe69 --- /dev/null +++ b/src/ci/docker/host-x86_64/temp/Dockerfile @@ -0,0 +1,29 @@ +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends \ + g++ \ + make \ + ninja-build \ + file \ + curl \ + ca-certificates \ + python3 \ + git \ + cmake \ + sudo \ + gdb \ + libssl-dev \ + pkg-config \ + xz-utils \ + mingw-w64 \ + && rm -rf /var/lib/apt/lists/* + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +ENV RUST_CONFIGURE_ARGS \ + --build=x86_64-unknown-linux-gnu \ + --enable-sanitizers \ + --enable-profiler \ + --enable-compiler-docs \ No newline at end of file diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index bd5447ac835d9..bd26bd8f30e7a 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -7,6 +7,7 @@ export MSYS_NO_PATHCONV=1 script=`cd $(dirname $0) && pwd`/`basename $0` image="" + dev=0 while [[ $# -gt 0 ]] @@ -94,7 +95,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then # On non-CI or PR jobs, we don't have permissions to write to the registry cache, so we should # not use `docker login` nor caching. - if [[ "$CI" == "" ]] || [[ "$PR_CI_JOB" == "1" ]]; + if [[ "$CI" == "" ]]; then retry docker build --rm -t rust-ci -f "$dockerfile" "$context" else @@ -132,6 +133,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then # Tag the built image and push it to the registry docker tag rust-ci "${IMAGE_TAG}" + echo ">>>>>>>>>>>>>>>>>> ${IMAGE_TAG}" docker push "${IMAGE_TAG}" # Record the container registry tag/url for reuse, e.g. by rustup.rs builds @@ -293,37 +295,39 @@ if [ "$ENABLE_GCC_CODEGEN" = "1" ]; then echo "Setting extra environment values for docker: $extra_env" fi -docker \ - run \ - --workdir /checkout/obj \ - --env SRC=/checkout \ - $extra_env \ - $args \ - --env CARGO_HOME=/cargo \ - --env DEPLOY \ - --env DEPLOY_ALT \ - --env CI \ - --env GITHUB_ACTIONS \ - --env GITHUB_REF \ - --env GITHUB_STEP_SUMMARY="/checkout/obj/${SUMMARY_FILE}" \ - --env TOOLSTATE_REPO_ACCESS_TOKEN \ - --env TOOLSTATE_REPO \ - --env TOOLSTATE_PUBLISH \ - --env RUST_CI_OVERRIDE_RELEASE_CHANNEL \ - --env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \ - --env BASE_COMMIT="$BASE_COMMIT" \ - --env DIST_TRY_BUILD \ - --env PR_CI_JOB \ - --env OBJDIR_ON_HOST="$objdir" \ - --env CODEGEN_BACKENDS \ - --init \ - --rm \ - rust-ci \ - "${command[@]}" - -cat $objdir/${SUMMARY_FILE} >> "${GITHUB_STEP_SUMMARY}" - -if [ -f /.dockerenv ]; then - rm -rf $objdir - docker cp checkout:/checkout/obj $objdir -fi +echo "${command[@]}" + +# docker \ +# run \ +# --workdir /checkout/obj \ +# --env SRC=/checkout \ +# $extra_env \ +# $args \ +# --env CARGO_HOME=/cargo \ +# --env DEPLOY \ +# --env DEPLOY_ALT \ +# --env CI \ +# --env GITHUB_ACTIONS \ +# --env GITHUB_REF \ +# --env GITHUB_STEP_SUMMARY="/checkout/obj/${SUMMARY_FILE}" \ +# --env TOOLSTATE_REPO_ACCESS_TOKEN \ +# --env TOOLSTATE_REPO \ +# --env TOOLSTATE_PUBLISH \ +# --env RUST_CI_OVERRIDE_RELEASE_CHANNEL \ +# --env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \ +# --env BASE_COMMIT="$BASE_COMMIT" \ +# --env DIST_TRY_BUILD \ +# --env PR_CI_JOB \ +# --env OBJDIR_ON_HOST="$objdir" \ +# --env CODEGEN_BACKENDS \ +# --init \ +# --rm \ +# rust-ci \ +# "${command[@]}" + +# cat $objdir/${SUMMARY_FILE} >> "${GITHUB_STEP_SUMMARY}" + +# if [ -f /.dockerenv ]; then +# rm -rf $objdir +# docker cp checkout:/checkout/obj $objdir +# fi diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 9b0f477409a93..9bca48c0edd47 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -77,15 +77,15 @@ x--expand-yaml-anchors--remove: env: {} - &job-linux-4c - os: ubuntu-20.04-4core-16gb + os: ubuntu-20.04 <<: *base-job - &job-linux-8c - os: ubuntu-20.04-8core-32gb + os: ubuntu-20.04 <<: *base-job - &job-linux-16c - os: ubuntu-20.04-16core-64gb + os: ubuntu-20.04 <<: *base-job - &job-macos-xl @@ -296,6 +296,7 @@ on: - try-perf - automation/bors/try - master + - optimise-docker-cache pull_request: branches: - "**" @@ -330,19 +331,22 @@ jobs: strategy: matrix: include: - - name: mingw-check + - name: temp <<: *job-linux-4c + + # - name: mingw-check + # <<: *job-linux-4c - - name: mingw-check-tidy - <<: *job-linux-4c + # - name: mingw-check-tidy + # <<: *job-linux-4c - - name: x86_64-gnu-llvm-16 - env: - ENABLE_GCC_CODEGEN: "1" - <<: *job-linux-16c + # - name: x86_64-gnu-llvm-16 + # env: + # ENABLE_GCC_CODEGEN: "1" + # <<: *job-linux-16c - - name: x86_64-gnu-tools - <<: *job-linux-16c + # - name: x86_64-gnu-tools + # <<: *job-linux-16c auto: <<: *base-ci-job