diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f789c592ba2..ad58319e892a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,26 +42,6 @@ jobs: TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate" CACHE_DOMAIN: ci-caches.rust-lang.org if: "github.event_name == 'pull_request'" - continue-on-error: "${{ matrix.tidy }}" - strategy: - matrix: - include: - - name: mingw-check - tidy: false - os: ubuntu-20.04-xl - env: {} - - name: mingw-check-tidy - tidy: true - os: ubuntu-20.04-xl - env: {} - - name: x86_64-gnu-llvm-14 - tidy: false - os: ubuntu-20.04-xl - env: {} - - name: x86_64-gnu-tools - tidy: false - os: ubuntu-20.04-xl - env: {} timeout-minutes: 600 runs-on: "${{ matrix.os }}" steps: @@ -313,7 +293,7 @@ jobs: os: ubuntu-20.04-xl - name: dist-x86_64-apple env: - SCRIPT: "./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin" + SCRIPT: PGO_HOST=x86_64-apple-darwin python3 src/ci/stage-build.py python3 x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin" RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.7 @@ -594,9 +574,18 @@ jobs: strategy: matrix: include: - - name: dist-x86_64-linux - os: ubuntu-20.04-xl - env: {} + - name: dist-x86_64-apple + env: + SCRIPT: PGO_HOST=x86_64-apple-darwin python3 src/ci/stage-build.py python3 x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin + RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin" + RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 + MACOSX_DEPLOYMENT_TARGET: 10.7 + SELECT_XCODE: /Applications/Xcode_13.4.1.app + NO_LLVM_ASSERTIONS: 1 + NO_DEBUG_ASSERTIONS: 1 + NO_OVERFLOW_CHECKS: 1 + DIST_REQUIRE_ALL_TOOLS: 1 + os: macos-12-xl timeout-minutes: 600 runs-on: "${{ matrix.os }}" steps: diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 11f1532bef594..a614a86628cca 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -288,25 +288,25 @@ jobs: env: <<: [*shared-ci-variables, *public-variables] if: github.event_name == 'pull_request' - continue-on-error: ${{ matrix.tidy }} - strategy: - matrix: - include: - - name: mingw-check - <<: *job-linux-xl - tidy: false - - - name: mingw-check-tidy - <<: *job-linux-xl - tidy: true - - - name: x86_64-gnu-llvm-14 - <<: *job-linux-xl - tidy: false - - - name: x86_64-gnu-tools - <<: *job-linux-xl - tidy: false + # continue-on-error: ${{ matrix.tidy }} + # strategy: + # matrix: + # include: + # - name: mingw-check + # <<: *job-linux-xl + # tidy: false + + # - name: mingw-check-tidy + # <<: *job-linux-xl + # tidy: true + + # - name: x86_64-gnu-llvm-14 + # <<: *job-linux-xl + # tidy: false + + # - name: x86_64-gnu-tools + # <<: *job-linux-xl + # tidy: false auto: permissions: @@ -478,7 +478,7 @@ jobs: - name: dist-x86_64-apple env: - SCRIPT: ./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin + SCRIPT: PGO_HOST=x86_64-apple-darwin python3 src/ci/stage-build.py python3 x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.7 @@ -749,9 +749,18 @@ jobs: strategy: matrix: include: - - &dist-x86_64-linux - name: dist-x86_64-linux - <<: *job-linux-xl + - name: dist-x86_64-apple + env: + SCRIPT: PGO_HOST=x86_64-apple-darwin python3 src/ci/stage-build.py python3 x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin + RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin + RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 + MACOSX_DEPLOYMENT_TARGET: 10.7 + SELECT_XCODE: /Applications/Xcode_13.4.1.app + NO_LLVM_ASSERTIONS: 1 + NO_DEBUG_ASSERTIONS: 1 + NO_OVERFLOW_CHECKS: 1 + DIST_REQUIRE_ALL_TOOLS: 1 + <<: *job-macos-xl master: name: master diff --git a/src/ci/scripts/install-clang.sh b/src/ci/scripts/install-clang.sh index 02b72625d6eb5..4093f73d430c0 100755 --- a/src/ci/scripts/install-clang.sh +++ b/src/ci/scripts/install-clang.sh @@ -19,9 +19,12 @@ if isMacOS; then bindir="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/bin" else file="${MIRRORS_BASE}/clang%2Bllvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz" + mkdir -p citools + cd citools retry curl -f "${file}" -o "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz" tar xJf "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz" - bindir="$(pwd)/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin/bin" + mv "clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin" clang-rust + bindir="$(pwd)/clang-rust/bin" fi ciCommandSetEnv CC "${bindir}/clang" diff --git a/src/ci/stage-build.py b/src/ci/stage-build.py index fe3083dc31e46..76c36833a6fb4 100644 --- a/src/ci/stage-build.py +++ b/src/ci/stage-build.py @@ -208,6 +208,49 @@ def supports_bolt(self) -> bool: return False +class DarwinPipeline(Pipeline): + def __init__(self): + self.checkout_dir = Path(os.getcwd()) + + def checkout_path(self) -> Path: + return self.checkout_dir + + def downloaded_llvm_dir(self) -> Path: + return self.checkout_path() / "citools" / "clang-rust" + + def build_root(self) -> Path: + return self.checkout_path() + + def opt_artifacts(self) -> Path: + return Path("/tmp/tmp-multistage/opt-artifacts") + + def build_rustc_perf(self): + # rustc-perf version from 2022-07-22 + perf_commit = "3c253134664fdcba862c539d37f0de18557a9a4c" + rustc_perf_zip_path = self.opt_artifacts() / "perf.zip" + + def download_rustc_perf(): + download_file( + f"https://github.com/rust-lang/rustc-perf/archive/{perf_commit}.zip", + rustc_perf_zip_path + ) + with change_cwd(self.opt_artifacts()): + unpack_archive(rustc_perf_zip_path) + move_path(Path(f"rustc-perf-{perf_commit}"), self.rustc_perf_dir()) + delete_file(rustc_perf_zip_path) + + retry_action(download_rustc_perf, "Download rustc-perf") + + with change_cwd(self.rustc_perf_dir()): + cmd([self.cargo_stage_0(), "build", "-p", "collector"], env=dict( + RUSTC=str(self.rustc_stage_0()), + RUSTC_BOOTSTRAP="1" + )) + + def supports_bolt(self) -> bool: + return False + + def get_timestamp() -> float: return time.time() @@ -576,6 +619,8 @@ def create_pipeline() -> Pipeline: return LinuxPipeline() elif sys.platform in ("cygwin", "win32"): return WindowsPipeline() + elif sys.platform == "darwin": + return DarwinPipeline() else: raise Exception(f"Optimized build is not supported for platform {sys.platform}")