From 8658c0aea0e87cca5848b15b3c29f6fc76a494c3 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 18 Oct 2023 16:39:21 +0200 Subject: [PATCH 1/9] ci: Trigger a workflow --- .github/workflows/build-rust-all.yaml | 56 --------------------------- 1 file changed, 56 deletions(-) delete mode 100644 .github/workflows/build-rust-all.yaml diff --git a/.github/workflows/build-rust-all.yaml b/.github/workflows/build-rust-all.yaml deleted file mode 100644 index 4f1f777..0000000 --- a/.github/workflows/build-rust-all.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build Xtensa Rust toolchain - -on: - workflow_dispatch: - inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" - release_version: - description: "Release Version for generation" - required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" - required: true - default: "nightly" - release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-06704172812884cde852" - -jobs: - launch_workflows: - name: ${{ matrix.workflow_name.target }} - runs-on: ubuntu-latest - - strategy: - matrix: - workflow_name: - - target: aarch64-unknown-linux-gnu - workflow: build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml - - # "build-rust-aarch64-apple-darwin-self-hosted-dispatch", - # "build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch", - # "build-rust-x86_64-apple-darwin-self-hosted-dispatch.", - # "build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch", - # "build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch", - # "build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch" - # ] - - steps: - - uses: actions/checkout@v4 - - name: Run ${{ matrix.workflow_name }} workflow - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.PAT }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/esp-rs/rust-build/actions/workflows/${{ matrix.workflow_name.workflow }}/dispatches \ - -d '{"ref":"${{ github.event.inputs.rust_build_branch }}", "inputs": { "upload_artifacts":"${{ github.event.inputs.upload_artifacts }}", "rust_build_branch":"${{ github.event.inputs.rust_build_branch }}", "release_version":"${{ github.event.inputs.release_version }}", "rust_version":"${{ github.event.inputs.rust_version }}", "rust_target":"${{ matrix.workflow_name.target }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' From 6ffbc169e1b015b7da317706e671372d751a8eab Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 18 Oct 2023 18:47:36 +0200 Subject: [PATCH 2/9] ci: Refactor build-all workflow --- ...h64-apple-darwin-self-hosted-dispatch.yaml | 46 +++++----------- ...nknown-linux-gnu-self-hosted-dispatch.yaml | 38 ++++--------- .../workflows/build-rust-src-dispatch.yaml | 39 ++++--------- ..._64-apple-darwin-self-hosted-dispatch.yaml | 45 +++++---------- ...4-pc-windows-gnu-self-hosted-dispatch.yaml | 55 ++++++------------- ...-pc-windows-msvc-self-hosted-dispatch.yaml | 48 +++++----------- ...nknown-linux-gnu-self-hosted-dispatch.yaml | 48 +++++----------- 7 files changed, 97 insertions(+), 222 deletions(-) diff --git a/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml index 3831110..d66f6c0 100644 --- a/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml +++ b/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml @@ -1,36 +1,22 @@ -name: build-rust-macos-m1-dispatch +name: Xtensa Rust | $TARGET_TRIPLE on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" - required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" + description: "Xtensa Rust rlease version to build" required: true - default: "nightly" - rust_target: - description: "Target triple" - required: true - default: "aarch64-apple-darwin" + default: '1.73.0.0' release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: aarch64-apple-darwin jobs: get_release: - # https://github.com/octokit/request-action name: Get release runs-on: ubuntu-latest outputs: @@ -39,9 +25,7 @@ jobs: - uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{owner}/{repo}/releases/tags/${{ github.event.inputs.release_tag }} - owner: esp-rs - repo: rust-build + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: get upload url @@ -52,9 +36,8 @@ jobs: env: response: ${{ steps.get_release.outputs.data }} - build-idf-rust: - name: Build IDF Rust for ${{ matrix.os }} - # needs: create_release + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} needs: get_release runs-on: ${{ matrix.os }} strategy: @@ -62,12 +45,12 @@ jobs: os: [macos-m1-self-hosted] include: - os: macos-m1-self-hosted - ASSET_PATH: "build/dist/rust-${{ github.event.inputs.rust_version }}-${{ github.event.inputs.rust_target }}.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.tar.xz" + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: esp-rs/rust ref: esp-${{ github.event.inputs.release_version }} @@ -78,7 +61,6 @@ jobs: - name: Build with x.py - dist packages - with cached LLVM run: arch -arm64 python3 x.py dist --stage 2 || echo "silence pkg build error" - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml index 4bd4be1..1a39894 100644 --- a/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml +++ b/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml @@ -1,32 +1,19 @@ -name: Xtensa Rust | aarch64-linux-dispatch +name: Xtensa Rust | $TARGET_TRIPLE on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" - required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" + description: "Xtensa Rust rlease version to build" required: true - default: "nightly" - rust_target: - description: "Target triple" - required: true - default: "aarch64-unknown-linux-gnu" + default: '1.73.0.0' release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: aarch64-unknown-linux-gnu jobs: get_release: @@ -58,8 +45,8 @@ jobs: os: [macos-m1-self-hosted] include: - os: macos-m1-self-hosted - ASSET_PATH: "build/dist/rust-${{ github.event.inputs.rust_version }}-${{ github.event.inputs.rust_target }}.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.tar.xz" + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Initialize Podman @@ -68,10 +55,10 @@ jobs: podman stop rust-linux || echo "ok" podman container rm rust-linux || echo "Container name rust-linux is available" - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build construction container run: | - cd support/rust-build/${{ github.event.inputs.rust_target }} + cd support/rust-build/$TARGET_TRIPLE podman build -t ubuntu-builder . - name: Build Rust run: | @@ -79,7 +66,6 @@ jobs: mkdir -p build podman cp rust-linux:rust/build/dist build/dist - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/build-rust-src-dispatch.yaml b/.github/workflows/build-rust-src-dispatch.yaml index c75f542..6d0164b 100644 --- a/.github/workflows/build-rust-src-dispatch.yaml +++ b/.github/workflows/build-rust-src-dispatch.yaml @@ -1,32 +1,21 @@ -name: build-rust-src-dispatch +name: Xtensa Rust | rust-src on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" + description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" - required: true - default: "nightly" + default: '1.73.0.0' release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e" + +env: jobs: get_release: - # https://github.com/octokit/request-action name: Get release runs-on: ubuntu-latest outputs: @@ -35,9 +24,7 @@ jobs: - uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{owner}/{repo}/releases/tags/${{ github.event.inputs.release_tag }} - owner: esp-rs - repo: rust-build + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: get upload url @@ -48,9 +35,8 @@ jobs: env: response: ${{ steps.get_release.outputs.data }} - build-idf-rust: - name: Build IDF Rust for ${{ matrix.os }} - # needs: create_release + build-xtensa-rust: + name: Build Xtensa rust-src needs: get_release runs-on: ${{ matrix.os }} strategy: @@ -58,12 +44,12 @@ jobs: os: [ubuntu-latest] include: - os: ubuntu-latest - ASSET_PATH: "rust/build/dist/rust-src-${{ github.event.inputs.rust_version }}.tar.xz" + ASSET_PATH: "rust/build/dist/rust-src-nightly.tar.xz" ASSET_NAME: "rust-src-${{ github.event.inputs.release_version }}.tar.xz" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: esp-rs/rust ref: esp-${{ github.event.inputs.release_version }} @@ -80,7 +66,6 @@ jobs: run: | python3 x.py dist rust-src - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml index 1f317ba..4769a05 100644 --- a/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml +++ b/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml @@ -1,36 +1,21 @@ -name: build-rust-macos-x86_64-self-hosted-dispatch +name: Xtensa Rust | $TARGET_TRIPLE on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" - required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" - required: true - default: "nightly" - rust_target: - description: "Target triple" + description: "Xtensa Rust rlease version to build" required: true - default: "x86_64-apple-darwin" + default: '1.73.0.0' release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e" +env: + TARGET_TRIPLE: x86_64-apple-darwin jobs: get_release: - # https://github.com/octokit/request-action name: Get release runs-on: ubuntu-latest outputs: @@ -39,9 +24,7 @@ jobs: - uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{owner}/{repo}/releases/tags/${{ github.event.inputs.release_tag }} - owner: esp-rs - repo: rust-build + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: get upload url @@ -52,9 +35,8 @@ jobs: env: response: ${{ steps.get_release.outputs.data }} - build-idf-rust: - name: Build IDF Rust for ${{ matrix.os }} - # needs: create_release + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} needs: get_release runs-on: ${{ matrix.os }} strategy: @@ -62,12 +44,12 @@ jobs: os: [macos-x86_64-self-hosted] include: - os: macos-x86_64-self-hosted - ASSET_PATH: "build/dist/rust-${{ github.event.inputs.rust_version }}-${{ github.event.inputs.rust_target }}.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.tar.xz" + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: esp-rs/rust ref: esp-${{ github.event.inputs.release_version }} @@ -78,7 +60,6 @@ jobs: - name: Build with x.py - dist packages run: python3 x.py dist --stage 2 || echo "Ignoring pkg failure" - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml index 92f2a3e..748a5c8 100644 --- a/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml +++ b/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml @@ -1,40 +1,22 @@ -name: build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch +name: Xtensa Rust | $TARGET_TRIPLE on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" - required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" + description: "Xtensa Rust rlease version to build" required: true - default: "nightly" - rust_target: - description: "Target triple" - required: true - default: "x86_64-pc-windows-gnu" - shutdown_vm: - description: "Shut down VM after finishing the build" - required: true - default: "no" + default: '1.73.0.0' release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: x86_64-pc-windows-gnu jobs: get_release: - # https://github.com/octokit/request-action name: Get release runs-on: ubuntu-latest outputs: @@ -43,9 +25,7 @@ jobs: - uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{owner}/{repo}/releases/tags/${{ github.event.inputs.release_tag }} - owner: esp-rs - repo: rust-build + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: get upload url @@ -56,8 +36,8 @@ jobs: env: response: ${{ steps.get_release.outputs.data }} - build-idf-rust: - name: Build IDF Rust for ${{ matrix.os }} + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} needs: get_release runs-on: ${{ matrix.os }} strategy: @@ -65,14 +45,14 @@ jobs: os: [x86_64-pc-windows-gnu-self-hosted] include: - os: x86_64-pc-windows-gnu-self-hosted - ASSET_PATH: "rust/build/dist/rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.zip" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.zip" + ASSET_PATH: "rust/build/dist/rust-nightly-$TARGET_TRIPLE.zip" + ASSET_NAME: "rust-nightly-$TARGET_TRIPLE.zip" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Checkout repository - esp-rs/rust - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: rust repository: esp-rs/rust @@ -111,7 +91,7 @@ jobs: run: | &"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" -DefaultHost x86_64-pc-windows-gnu - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' && steps.repackage-binary.outcome != 'failure' + if: steps.repackage-binary.outcome != 'failure' id: upload-release-asset continue-on-error: true uses: actions/upload-release-asset@v1 @@ -126,9 +106,6 @@ jobs: id: unount_path continue-on-error: true run: subst "R:" /D - - name: Shut down - if: github.event.inputs.shutdown_vm == 'yes' - run: shutdown /s /f /t 30 - name: Fail if build failed if: steps.repackage-binary.outcome == 'failure' run: exit 1 diff --git a/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml index 7510317..e3cbfcf 100644 --- a/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml +++ b/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml @@ -1,36 +1,22 @@ -name: build-rust-windows-x86_64-self-hosted-dispatch +name: Xtensa Rust | $TARGET_TRIPLE on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" - required: true - default: '1.73.0.1' - rust_version: - description: "Version of esp rust to use" + description: "Xtensa Rust rlease version to build" required: true - default: "nightly" - rust_target: - description: "Target triple" - required: true - default: "x86_64-pc-windows-msvc" + default: '1.73.0.0' release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: x86_64-pc-windows-msvc jobs: get_release: - # https://github.com/octokit/request-action name: Get release runs-on: ubuntu-latest outputs: @@ -39,9 +25,7 @@ jobs: - uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{owner}/{repo}/releases/tags/${{ github.event.inputs.release_tag }} - owner: esp-rs - repo: rust-build + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: get upload url @@ -52,9 +36,8 @@ jobs: env: response: ${{ steps.get_release.outputs.data }} - build-idf-rust: - name: Build IDF Rust for ${{ matrix.os }} - # needs: create_release + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} needs: get_release runs-on: ${{ matrix.os }} strategy: @@ -62,14 +45,14 @@ jobs: os: [windows-x86_64-self-hosted] include: - os: windows-x86_64-self-hosted - ASSET_PATH: "rust/build/dist/rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.zip" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.zip" + ASSET_PATH: "rust/build/dist/rust-nightly-$TARGET_TRIPLE.zip" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.zip" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Checkout repository - esp-rs/rust - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: rust repository: esp-rs/rust @@ -97,7 +80,6 @@ jobs: run: | &"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml index 47728bc..cfe3a74 100644 --- a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml +++ b/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml @@ -1,36 +1,22 @@ -name: build-rust-x86_64-linux-dispatch +name: Xtensa Rust | $TARGET_TRIPLE on: workflow_dispatch: inputs: - upload_artifacts: - description: "Upload final artifacts to Release?" - required: true - default: "yes" - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "build/1.73.0.1" release_version: - description: "Release Version for generation" - required: true - default: "1.73.0.1" - rust_version: - description: "Version of esp rust to use" + description: "Xtensa Rust rlease version to build" required: true - default: "nightly" - rust_target: - description: "Target triple" - required: true - default: "x86_64-unknown-linux-gnu" + default: "1.73.0.0" release_tag: - description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-06704172812884cde852" + default: "untagged-3ecdd54e672f465cad2e"s + +env: + TARGET_TRIPLE: x86_64-unknown-linux-gnus jobs: get_release: - # https://github.com/octokit/request-action name: Get release runs-on: ubuntu-latest outputs: @@ -39,9 +25,7 @@ jobs: - uses: octokit/request-action@v2.x id: get_release with: - route: GET /repos/{owner}/{repo}/releases/tags/${{ github.event.inputs.release_tag }} - owner: esp-rs - repo: rust-build + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: get upload url @@ -52,9 +36,8 @@ jobs: env: response: ${{ steps.get_release.outputs.data }} - build-idf-rust: - name: Build IDF Rust for ${{ matrix.os }} - # needs: create_release + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} needs: get_release runs-on: ${{ matrix.os }} strategy: @@ -62,18 +45,18 @@ jobs: os: [linux-x86_64-self-hosted] include: - os: linux-x86_64-self-hosted - ASSET_PATH: "build/dist/rust-${{ github.event.inputs.rust_version }}-${{ github.event.inputs.rust_target }}.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.tar.xz" + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" ASSET_CONTENT_TYPE: "application/x-tar" steps: - name: Initialize Docker run: | docker container rm rust-linux || echo "Container name rust-linux is available" - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build construction container run: | - cd support/rust-build/${{ github.event.inputs.rust_target }} + cd support/rust-build/$TARGET_TRIPLE docker build -f Containerfile -t ubuntu-builder . - name: Build Rust run: | @@ -81,7 +64,6 @@ jobs: mkdir -p build docker cp rust-linux:/home/rust/rust/build/dist build/dist - name: Upload Release Asset - if: github.event.inputs.upload_artifacts == 'yes' id: upload-release-asset uses: actions/upload-release-asset@v1 env: From c54fbca3ee9037557c62f03fc2e0f2cf9e133899 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:01:17 +0200 Subject: [PATCH 3/9] chore: Remove unused file --- .../actions/build/build-rust-std/action.yaml | 61 ------ .github/actions/build/build-rustc/action.yaml | 61 ------ .github/actions/build/build-src/action.yaml | 47 ----- .github/actions/build/build-tools/action.yaml | 78 ------- .../actions/tools/setup-libudev/action.yaml | 11 - .github/actions/tools/setup-ninja/action.yaml | 8 - .../actions/tools/setup-python/action.yaml | 10 - .../util/checkout-esp-rust/action.yaml | 13 -- .../actions/util/create-archive/action.yaml | 87 -------- .../actions/util/read-artifacts/action.yaml | 37 ---- .github/actions/util/setup-envs/action.yaml | 76 ------- .../util/symlink-working-dir/action.yaml | 14 -- .github/actions/util/upload/action.yaml | 18 -- .github/workflows/create-release.yaml | 25 --- .github/workflows/installer-check.yaml | 196 ------------------ .github/workflows/nigthly-check.yaml | 40 ---- .../publish-idf-rust-examples-image.yml | 42 ---- .../workflows/release-installer-dispatch.yaml | 61 ------ ...st-rust-aarch64-apple-darwin-dispatch.yaml | 104 ---------- ...est-rust-x86_64-apple-darwin-dispatch.yaml | 31 --- ...ust-x86_64-unknown-linux-gnu-dispatch.yaml | 68 ------ .github/workflows/verify-ci-readiness.yaml | 16 -- Dockerfile | 12 -- Install-RustToolchain.ps1 | 4 - .../aarch64-apple-darwin/build-llvm.sh | 19 -- .../build-toolchain-macos-m1.sh | 103 --------- .../aarch64-apple-darwin/clangwrap.cpp | 126 ----------- .../aarch64-unknown-linux-gnu/Containerfile | 15 -- .../aarch64-unknown-linux-gnu/README.md | 11 - .../build-toolchain-linux.sh | 62 ------ .../aarch64-unknown-linux-gnu/clangwrap.cpp | 126 ----------- support/rust-build/rename-rust-release.sh | 7 - .../x86_64-unknown-linux-gnu/Containerfile | 13 -- .../x86_64-unknown-linux-gnu/build.sh | 9 - test-rust-toolchain.sh | 184 ---------------- 35 files changed, 1795 deletions(-) delete mode 100644 .github/actions/build/build-rust-std/action.yaml delete mode 100644 .github/actions/build/build-rustc/action.yaml delete mode 100644 .github/actions/build/build-src/action.yaml delete mode 100644 .github/actions/build/build-tools/action.yaml delete mode 100644 .github/actions/tools/setup-libudev/action.yaml delete mode 100644 .github/actions/tools/setup-ninja/action.yaml delete mode 100644 .github/actions/tools/setup-python/action.yaml delete mode 100644 .github/actions/util/checkout-esp-rust/action.yaml delete mode 100644 .github/actions/util/create-archive/action.yaml delete mode 100644 .github/actions/util/read-artifacts/action.yaml delete mode 100644 .github/actions/util/setup-envs/action.yaml delete mode 100644 .github/actions/util/symlink-working-dir/action.yaml delete mode 100644 .github/actions/util/upload/action.yaml delete mode 100644 .github/workflows/create-release.yaml delete mode 100644 .github/workflows/installer-check.yaml delete mode 100644 .github/workflows/nigthly-check.yaml delete mode 100644 .github/workflows/publish-idf-rust-examples-image.yml delete mode 100644 .github/workflows/release-installer-dispatch.yaml delete mode 100644 .github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml delete mode 100644 .github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml delete mode 100644 .github/workflows/test-rust-x86_64-unknown-linux-gnu-dispatch.yaml delete mode 100644 .github/workflows/verify-ci-readiness.yaml delete mode 100644 Dockerfile delete mode 100644 Install-RustToolchain.ps1 delete mode 100755 support/llvm-project/aarch64-apple-darwin/build-llvm.sh delete mode 100755 support/llvm-project/aarch64-apple-darwin/build-toolchain-macos-m1.sh delete mode 100644 support/llvm-project/aarch64-apple-darwin/clangwrap.cpp delete mode 100644 support/llvm-project/aarch64-unknown-linux-gnu/Containerfile delete mode 100644 support/llvm-project/aarch64-unknown-linux-gnu/README.md delete mode 100755 support/llvm-project/aarch64-unknown-linux-gnu/build-toolchain-linux.sh delete mode 100644 support/llvm-project/aarch64-unknown-linux-gnu/clangwrap.cpp delete mode 100755 support/rust-build/rename-rust-release.sh delete mode 100644 support/rust-build/x86_64-unknown-linux-gnu/Containerfile delete mode 100755 support/rust-build/x86_64-unknown-linux-gnu/build.sh delete mode 100755 test-rust-toolchain.sh diff --git a/.github/actions/build/build-rust-std/action.yaml b/.github/actions/build/build-rust-std/action.yaml deleted file mode 100644 index e8af2fa..0000000 --- a/.github/actions/build/build-rust-std/action.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: "Build Ruststd" -description: "Build the rust std Library" - -runs: - using: "composite" - steps: - # Run the Windows Build using powershell - - - name: Prepare build - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --dist-compression-formats='xz' - - #- name: Build with x.py - Standard Library - # if: startsWith(matrix.os, 'windows') - # # Note excluding src/doc breaks build of 1.55 - # working-directory: ${{ env.work_dir }} - # shell: pwsh - # run: python3 x.py build --exclude src/doc --stage 2 library/std - - - name: Dist with x.py - Standard Library - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 x.py dist --stage 2 library/std - - # Run Linux builds using bash - - - name: Prepare build - if: startsWith(matrix.os, 'macos') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --dist-compression-formats='xz' --set rust.jemalloc - - - name: Prepare build - if: startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --dist-compression-formats='xz' - - - name: Build with x.py - Standard Library - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - # Note excluding src/doc breaks build of 1.55 - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py build --exclude src/doc --stage 2 library/std - - - name: Dist with x.py - Standard Library - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py dist --stage 2 library/std - - # Save the result - - - name: Save Artifact - Standard Library - uses: actions/upload-artifact@v2 - with: - name: rust-std-${{ env.build_suffix }}.tar.xz - path: ${{ env.dist_dir }}/rust-std-${{ env.build_suffix }}.tar.xz diff --git a/.github/actions/build/build-rustc/action.yaml b/.github/actions/build/build-rustc/action.yaml deleted file mode 100644 index 1476ba4..0000000 --- a/.github/actions/build/build-rustc/action.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: "Build Rustc" -description: "Build the rustc toolchain" - -runs: - using: "composite" - steps: - # Run the Windows Build using powershell - - - name: Prepare build - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --dist-compression-formats='xz' - - #- name: Build with x.py - Compiler - # if: startsWith(matrix.os, 'windows') - # # Note excluding src/doc breaks build of 1.55 - # working-directory: ${{ env.work_dir }} - # shell: pwsh - # run: python3 x.py build --exclude src/doc --stage 2 compiler/rustc - - - name: Dist with x.py - Compiler - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 x.py dist - - # Run Linux builds using bash - - - name: Prepare build - if: startsWith(matrix.os, 'macos') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --dist-compression-formats='xz' --set rust.jemalloc - - - name: Prepare build - if: startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --dist-compression-formats='xz' - - - name: Build with x.py - Compiler - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - # Note excluding src/doc breaks build of 1.55 - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py build --exclude src/doc --stage 2 compiler/rustc - - - name: Dist with x.py - Compiler - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py dist --stage 2 src/librustc - - # Save the result - - - name: Save Artifact - Rustc - uses: actions/upload-artifact@v2 - with: - name: rustc-${{ env.build_suffix }}.tar.xz - path: ${{ env.dist_dir }}/rustc-${{ env.build_suffix }}.tar.xz diff --git a/.github/actions/build/build-src/action.yaml b/.github/actions/build/build-src/action.yaml deleted file mode 100644 index 807275d..0000000 --- a/.github/actions/build/build-src/action.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: "Build Src" -description: "Build the rustc src" - -runs: - using: "composite" - steps: - # Run the Windows Build using powershell - - - name: Prepare build - Windows - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' - - - name: Dist with x.py - Src - Windows - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 x.py dist dist rust-src - - # Run Linux builds using bash - - - name: Prepare build - macOS - if: startsWith(matrix.os, 'macos') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --set rust.jemalloc - - - name: Prepare build - Unix - if: startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' - - - name: Dist with x.py - Src - Unix - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py dist rust-src - - # Save the result - - - name: Save Artifact - Src - uses: actions/upload-artifact@v2 - with: - name: rust-src-${{ env.rust_version }}.tar.xz - path: ${{ env.dist_dir }}/rust-src-${{ env.rust_version }}.tar.xz diff --git a/.github/actions/build/build-tools/action.yaml b/.github/actions/build/build-tools/action.yaml deleted file mode 100644 index db701fa..0000000 --- a/.github/actions/build/build-tools/action.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: "Build Tools" -description: "Build the rustc tools" - -runs: - using: "composite" - steps: - # Run the Windows Build using powershell - - - name: Prepare build - if: startsWith(matrix.os, 'windows') - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' - - #- name: Build with x.py - Tools - # if: startsWith(matrix.os, 'windows') - # # Note excluding src/doc breaks build of 1.55 - # working-directory: ${{ env.work_dir }} - # shell: pwsh - # # We only want to do cargo for windows builds - # run: python3 x.py build --exclude src/doc --stage 2 src/tools/clippy src/tools/rustfmt src/tools/cargo - - - name: Dist with x.py - Tools - if: startsWith(matrix.os, 'windows') - # We include cargo to get around https://github.com/esp-rs/rust-build/issues/17 - working-directory: ${{ env.work_dir }} - shell: pwsh - run: python3 x.py dist --stage 2 clippy rustfmt cargo - - # Run Linux builds using bash - - - name: Prepare build - if: startsWith(matrix.os, 'macos') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --set rust.jemalloc - - - name: Prepare build - if: startsWith(matrix.os, 'ubuntu') - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 src/bootstrap/configure.py ${{ matrix.llvm_root_option }} --experimental-targets=Xtensa --release-channel=nightly --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' - - - name: Build with x.py - Tools - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - # Note excluding src/doc breaks build of 1.55 - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py build --exclude src/doc --stage 2 src/tools/clippy src/tools/rustfmt - - - name: Dist with x.py - Tools - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - # We include cargo to get around https://github.com/esp-rs/rust-build/issues/17 - working-directory: ${{ env.work_dir }} - shell: bash - run: python3 x.py dist --stage 2 clippy rustfmt cargo - - # Save the result - - # We only want to do cargo for windows builds - - name: Save Artifact - Cargo - if: startsWith(matrix.os, 'windows') - uses: actions/upload-artifact@v2 - with: - name: cargo-${{ env.build_suffix }}.tar.xz - path: ${{ env.dist_dir }}/cargo-${{ env.build_suffix }}.tar.xz - - - name: Save Artifact - RustFmt - uses: actions/upload-artifact@v2 - with: - name: rustfmt-${{ env.build_suffix }}.tar.xz - path: ${{ env.dist_dir }}/rustfmt-${{ env.build_suffix }}.tar.xz - - - name: Save Artifact - Clippy - uses: actions/upload-artifact@v2 - with: - name: clippy-${{ env.build_suffix }}.tar.xz - path: ${{ env.dist_dir }}/clippy-${{ env.build_suffix }}.tar.xz diff --git a/.github/actions/tools/setup-libudev/action.yaml b/.github/actions/tools/setup-libudev/action.yaml deleted file mode 100644 index 02fe2cd..0000000 --- a/.github/actions/tools/setup-libudev/action.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: "Setup libudev-dev" -description: "Install libudev-dev" - -runs: - using: "composite" - steps: - - name: Install libudev-dev - if: startsWith(matrix.os, 'ubuntu') - shell: bash - run: | - sudo apt-get install -y libudev-dev diff --git a/.github/actions/tools/setup-ninja/action.yaml b/.github/actions/tools/setup-ninja/action.yaml deleted file mode 100644 index 43572dc..0000000 --- a/.github/actions/tools/setup-ninja/action.yaml +++ /dev/null @@ -1,8 +0,0 @@ -name: "Setup Ninja" -description: "Setup the Ninja Build System" - -runs: - using: "composite" - steps: - - name: Setup Ninja - uses: seanmiddleditch/gha-setup-ninja@master diff --git a/.github/actions/tools/setup-python/action.yaml b/.github/actions/tools/setup-python/action.yaml deleted file mode 100644 index 8e4cd08..0000000 --- a/.github/actions/tools/setup-python/action.yaml +++ /dev/null @@ -1,10 +0,0 @@ -name: "Setup Python" -description: "Setup the Python Install" - -runs: - using: "composite" - steps: - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.8" diff --git a/.github/actions/util/checkout-esp-rust/action.yaml b/.github/actions/util/checkout-esp-rust/action.yaml deleted file mode 100644 index 9117f32..0000000 --- a/.github/actions/util/checkout-esp-rust/action.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Checkout Source" -description: "Downloads the Source for esp-rs/rust" - -runs: - using: "composite" - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - repository: esp-rs/rust - ref: esp-${{ env.release_version }} - submodules: true - path: "rust" diff --git a/.github/actions/util/create-archive/action.yaml b/.github/actions/util/create-archive/action.yaml deleted file mode 100644 index f5a342d..0000000 --- a/.github/actions/util/create-archive/action.yaml +++ /dev/null @@ -1,87 +0,0 @@ -name: "Create Archive" -description: "Create a release archive for upload" - -# To avoid disk space issues under github workflow -# we need to split the build into multiple jobs - -# running x.py dist during the build generates a .tar.xz file -# (Note cp -r from stage2 is dangerous, because there is a src symlink to parent project dir which causes recursion) -# We take each of these from each build job and combine them into one here - -# Typically the final archive with the toolchain and tools should be extracted to -# ~/.rustup/toolchains. - -runs: - using: "composite" - steps: - # Read in the built files - - uses: ./rust-build/.github/actions/util/read-artifacts - - # Create Archive - Windows zip - - name: Create Archive - Windows (Zip) - if: startsWith(matrix.os, 'windows') - shell: bash - run: | - - mkdir esp - - # Copy in rust-std - tar -xvf ./rust-std-${{ env.build_suffix }}.tar.xz - cp -af ./rust-std-${{ env.build_suffix }}/rust-std-${{ matrix.target_name }}/* ./esp/ - - # Copy in the clippy tool - tar -xvf ./clippy-${{ env.build_suffix }}.tar.xz - cp -af ./clippy-${{ env.build_suffix }}/clippy-preview/* ./esp/ - - # Copy in the cargo tool - tar -xvf ./cargo-${{ env.build_suffix }}.tar.xz - cp -af ./cargo-${{ env.build_suffix }}/cargo/* ./esp/ - - # Copy in the rustfmt tool - tar -xvf ./rustfmt-${{ env.build_suffix }}.tar.xz - cp -af ./rustfmt-${{ env.build_suffix }}/rustfmt-preview/* ./esp/ - - # Copy in the rust-src content - tar -xvf ./rust-src-${{ env.rust_version }}-dev.tar.xz - cp -af ./rust-src-${{ env.rust_version }}-dev/rust-src/* ./esp/ - - # Copy in the rustc content - tar -xvf ./rustc-${{ env.build_suffix }}.tar.xz - cp -af ./rustc-${{ env.build_suffix }}/rustc/* ./esp/ - - # Build the final zip - 7z a ${{ env.asset_name }} esp/ - - # Create Archive - Linux tar.xz - - name: Create Archive - Linux (tar.xz) - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - shell: bash - run: | - - mkdir ${{ env.archive_dir }} - - # Copy in rust-std - tar -xvf ./rust-std-${{ env.build_suffix }}.tar.xz - cp -af ./rust-std-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/ - - # Copy in the clippy tool - tar -xvf ./clippy-${{ env.build_suffix }}.tar.xz - cp -af ./clippy-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/ - - # Copy in the rustfmt tool - tar -xvf ./rustfmt-${{ env.build_suffix }}.tar.xz - cp -af ./rustfmt-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/ - - # Copy in the rustc content - tar -xvf ./rustc-${{ env.build_suffix }}.tar.xz - cp -af ./rustc-${{ env.build_suffix }}/* ./${{ env.archive_dir }}/ - - # At this stage the components file will just contain "rustc" - # As this is the last one copied in - # Make sure the other components are recognised by the install script - echo "rust-std-${{ matrix.target_name }}" >> ./${{ env.archive_dir }}/components - echo "rustfmt-preview" >> ./${{ env.archive_dir }}/components - echo "clippy-preview" >> ./${{ env.archive_dir }}/components - - # Build the final tar - tar -cJf ${{ env.asset_name }} ${{ env.archive_dir }} diff --git a/.github/actions/util/read-artifacts/action.yaml b/.github/actions/util/read-artifacts/action.yaml deleted file mode 100644 index 5ed3516..0000000 --- a/.github/actions/util/read-artifacts/action.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Read Cache" -description: "Reads in all of the built artifact files prior to create-archive" - -runs: - using: "composite" - steps: - - name: Read Artifact - Rustc - uses: actions/download-artifact@v2 - with: - name: rustc-${{ env.build_suffix }}.tar.xz - - - name: Read Artifact - Standard Library - uses: actions/download-artifact@v2 - with: - name: rust-std-${{ env.build_suffix }}.tar.xz - - - name: Read Artifact - Clippy - uses: actions/download-artifact@v2 - with: - name: clippy-${{ env.build_suffix }}.tar.xz - - - name: Read Artifact - RustFmt - uses: actions/download-artifact@v2 - with: - name: rustfmt-${{ env.build_suffix }}.tar.xz - - - name: Read Artifact - Cargo - if: startsWith(matrix.os, 'windows') - uses: actions/download-artifact@v2 - with: - name: cargo-${{ env.build_suffix }}.tar.xz - - - name: Read Artifact - Src - if: startsWith(matrix.os, 'windows') - uses: actions/download-artifact@v2 - with: - name: rust-src-${{ env.rust_version }}-dev.tar.xz diff --git a/.github/actions/util/setup-envs/action.yaml b/.github/actions/util/setup-envs/action.yaml deleted file mode 100644 index d57e412..0000000 --- a/.github/actions/util/setup-envs/action.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: "Setup Env Variables - Rust Build" -description: "Setup Env Variables - Rust Build" - -# used for rust build - -inputs: - github_token: - # We can't use secrets directly in composite workflows - description: "Github secret token" - required: true - -runs: - using: "composite" - steps: - - name: Setup Env Variables - Common - shell: bash - run: | - - # Set the github token as an env variable for use with uploads - echo "GITHUB_TOKEN=${{ inputs.github_token }}" >> $GITHUB_ENV - - # esp rust version to checkout - echo "rust_version=${{ github.event.inputs.rust_version }}" >> $GITHUB_ENV - - # Describes part of the file name generated during the build - echo "build_suffix=${{ github.event.inputs.rust_version }}-dev-${{ matrix.target_name }}" >> $GITHUB_ENV - - # release version - echo "release_version=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV - - # release version - echo "archive_dir=rust-${{ github.event.inputs.rust_version }}-dev-${{ matrix.target_name }}" >> $GITHUB_ENV - - - name: Setup Env Variables - Windows - if: startsWith(matrix.os, 'windows') - shell: bash - run: | - - # Working / Source direcory for Windows - # Symlinked to get around long path issues - echo "work_dir=D:/rust" >> $GITHUB_ENV - - # The dist dir is where the final archives are stored during the build - echo "dist_dir=D:/rust/build/dist" >> $GITHUB_ENV - - # asset name for release - echo "asset_name=rust-${{ github.event.inputs.release_version }}-${{ matrix.target_name }}.zip" >> $GITHUB_ENV - - - name: Setup Env Variables - Unix - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - shell: bash - run: | - - # Working / Source direcory for Windows - # Symlinked to get around long path issues - echo "work_dir=${{ github.workspace }}/rust" >> $GITHUB_ENV - - # The dist dir is where the final archives are stored during the build - echo "dist_dir=${{ github.workspace }}/rust/build/dist" >> $GITHUB_ENV - - # asset name for release - echo "asset_name=rust-${{ github.event.inputs.release_version }}-${{ matrix.target_name }}.tar.xz" >> $GITHUB_ENV - - # Fixes issues when trying to do a dist with the src - mkdir -p ${{ github.workspace }}/.cache/cargo - echo "CARGO_HOME=${{ github.workspace }}/.cache/cargo" >> $GITHUB_ENV - - - name: Debug Output Env Variables - shell: bash - run: | - echo "rust_version: ${{ env.rust_version }}" - echo "build_suffix: ${{ env.build_suffix }}" - echo "release_version: ${{ env.release_version }}" - echo "asset_name: ${{ env.asset_name }}" - echo "work_dir: ${{ env.work_dir }}" - echo "dist_dir: ${{ env.dist_dir }}" diff --git a/.github/actions/util/symlink-working-dir/action.yaml b/.github/actions/util/symlink-working-dir/action.yaml deleted file mode 100644 index 47397c2..0000000 --- a/.github/actions/util/symlink-working-dir/action.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: "SymLink the working directory" -description: "SymLink the working directory" - -runs: - using: "composite" - steps: - # Windows typically can have long path issues - # To get around this we create a link - # from D:/a/rust-build/rust-build/rust to D:/rust to shorten the build path - - - name: Symlink working directory - shell: pwsh - if: startsWith(matrix.os, 'windows') - run: New-Item -Path ${{ env.work_dir }} -ItemType SymbolicLink -Value ${{ github.workspace }}/rust diff --git a/.github/actions/util/upload/action.yaml b/.github/actions/util/upload/action.yaml deleted file mode 100644 index 8f67ae8..0000000 --- a/.github/actions/util/upload/action.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: "Upload to github releases" -description: "Upload the final built archive to github" - -# In addition to uploading the file to the release -# * This also turns a tag into a release if one doesn't exist already -# * doesn't fail if the file is already uploaded to the release -# * Is a lot simpler than upload-release-asset -# * Seems to be more actively maintained -# * Doesn't require the use of octokit/request-action@v2.x / get latest release - -runs: - using: "composite" - steps: - - name: Upload Release Asset - uses: softprops/action-gh-release@v1 - with: - tag_name: v${{ env.release_version }} - files: ${{ env.asset_name }} diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml deleted file mode 100644 index b65ba65..0000000 --- a/.github/workflows/create-release.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: create-rust-release - -on: - workflow_dispatch: - inputs: - tag_name: - description: "Tag for draft release (e.g. v1.73.0.1)" - required: true - default: "v1.73.0.1" - -jobs: - create_release: - name: Create release - runs-on: ubuntu-latest - steps: - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.event.inputs.tag_name }} - release_name: Release ${{ github.event.inputs.tag_name }} - draft: true - prerelease: true diff --git a/.github/workflows/installer-check.yaml b/.github/workflows/installer-check.yaml deleted file mode 100644 index 26c8a9e..0000000 --- a/.github/workflows/installer-check.yaml +++ /dev/null @@ -1,196 +0,0 @@ -name: Test installer by building template projects - -env: - xtensa-toolchain-version: "1.73.0.1" - -on: - push: - paths: - - "install-rust-toolchain.sh" - - ".github/workflows/installer-check.yaml" - pull_request: - paths: - - "install-rust-toolchain.sh" - - ".github/workflows/installer-check.yaml" - workflow_dispatch: - -jobs: - esp-idf-v4-4: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - board: ["esp32", "esp32s3", "esp32s3", "esp32c3"] - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust-build-branch }} - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install ninja-build - - name: Install toolchain - run: | - ./install-rust-toolchain.sh \ - --extra-crates "ldproxy cargo-generate" \ - --build-target "${{ matrix.board }}" \ - --esp-idf-version "release/v4.4" \ - --minified-esp-idf "YES" \ - --export-file "${HOME}/export-esp.sh" - - name: Build template project - run: | - source ${HOME}/export-esp.sh - cargo generate --git https://github.com/esp-rs/esp-idf-template cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d advanced=false - cd test-${{ matrix.board }} - cargo build - # esp-idf-master: - # runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash - # strategy: - # fail-fast: false - # matrix: - # board: ['esp32', 'esp32s3', 'esp32s3', 'esp32c3'] - # steps: - # - - # name: Checkout - # uses: actions/checkout@v2 - # with: - # ref: ${{ github.event.inputs.rust-build-branch }} - # - name: Install dependencies - # run: | - # sudo apt-get update - # sudo apt-get install ninja-build - # - name: Install toolchain - # run: | - # ./install-rust-toolchain.sh \ - # --extra-crates "ldproxy cargo-generate" \ - # --build-target "${{ matrix.board }}" \ - # --esp-idf-version "master" \ - # --minified-esp-idf "YES" \ - # --export-file "${HOME}/export-esp.sh" - # - name: Build template project - # run: | - # source ${HOME}/export-esp.sh - # cargo generate --git https://github.com/esp-rs/esp-idf-template cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d std=true -d espidfver=mainline -d devcontainer=false - # cd test-${{ matrix.board }} - # cargo build - bare-metal: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - board: ["esp32", "esp32s3", "esp32s3", "esp32c3"] - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust-build-branch }} - - name: Install toolchain - run: | - ./install-rust-toolchain.sh \ - --extra-crates "ldproxy cargo-generate" \ - --build-target "${{ matrix.board }}" \ - --export-file "${HOME}/export-esp.sh" - - name: Build template project - run: | - rustup component add rustfmt - source ${HOME}/export-esp.sh - cargo generate -a esp-rs/esp-template --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d advanced=false - cd test-${{ matrix.board }} - cargo build - crate-check: - if: github.event_name == 'workflow_dispatch' - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - extra-crates: - [ - "", - "ldproxy", - "espflash cargo-espflash ldproxy cargo-generate wokwi-server web-flash", - ] - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust-build-branch }} - - name: Install toolchain - run: ./install-rust-toolchain.sh --extra-crates "${{ matrix.extra-crates }}" - minified-llvm: - if: github.event_name == 'workflow_dispatch' - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - minified-llvm: ["YES", "NO"] - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust-build-branch }} - - name: Install toolchain - run: | - ./install-rust-toolchain.sh \ - --minified-llvm "${{ matrix.minified-llvm }}" - installation-modes: - if: github.event_name == 'workflow_dispatch' - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install toolchain - run: | - ./install-rust-toolchain.sh --installation-mode "install" - - name: Reinstall toolchain - run: | - ./install-rust-toolchain.sh --installation-mode "reinstall" - - name: Uninstall toolchain - run: | - ./install-rust-toolchain.sh --installation-mode "uninstall" - test-arguments: - if: github.event_name == 'workflow_dispatch' - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - arguments: - [ - "", - "--toolchain-version $xtensa-toolchain-version --export-file export-esp-rust.sh", - "--build-target all", - ] - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install toolchain - run: | - ./install-rust-toolchain.sh "${{ matrix.arguments }}" \ No newline at end of file diff --git a/.github/workflows/nigthly-check.yaml b/.github/workflows/nigthly-check.yaml deleted file mode 100644 index b5a0aaf..0000000 --- a/.github/workflows/nigthly-check.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Rust nightly toolchain check - -on: - schedule: - - cron: "50 7 * * *" - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always - -jobs: - current-nightly: - name: Current nightly - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "windows-latest"] - steps: - - name: Setup | Rust - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: nightly - components: rust-src,rustfmt - - name: Setup | cargo-generate (Ubuntu binary) - if: matrix.os == 'ubuntu-latest' - id: binaries - continue-on-error: true - run: | - sudo curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1)-x86_64-unknown-linux-gnu.tar.gz" -o "/home/runner/.cargo/bin/cargo-generate.tar.gz" - tar xf "/home/runner/.cargo/bin/cargo-generate.tar.gz" -C /home/runner/.cargo/bin - chmod u+x /home/runner/.cargo/bin/cargo-generate - - name: Setup | cargo-generate - if: steps.binaries.outcome != 'success' || matrix.os == 'windows-latest' - run: cargo install cargo-generate - - uses: Swatinem/rust-cache@v2 - - name: Generate - run: cargo generate -a esp-rs/esp-template --name test --vcs none --silent -d mcu=esp32c3 -d advanced=false - - name: Build Project - run: cd test; cargo build diff --git a/.github/workflows/publish-idf-rust-examples-image.yml b/.github/workflows/publish-idf-rust-examples-image.yml deleted file mode 100644 index 0167783..0000000 --- a/.github/workflows/publish-idf-rust-examples-image.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Publish idf-rust-examples image on DockerHub - -on: - workflow_dispatch: - inputs: - rust_build_branch: - description: "Branch with test scripts" - required: true - default: "main" - release_version: - description: "Release version - long 4 places for tag" - required: true - default: "1.73.0.1" - rust_patch_version: - description: "Release patch version for generation - 3 places for tag" - required: true - default: "1.73.0" - rust_minor_version: - description: "Release minor version - 2 places for tag" - required: true - default: "1.60" - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust_build_branch }} - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Push to Docker Hub - uses: docker/build-push-action@v2 - with: - context: support/idf-rust-examples - push: true - tags: espressif/idf-rust-examples:latest,espressif/idf-rust-examples:${{ github.event.inputs.release_version }},espressif/idf-rust-examples:${{ github.event.inputs.rust_patch_version }},espressif/idf-rust-examples:${{ github.event.inputs.rust_minor_version }} diff --git a/.github/workflows/release-installer-dispatch.yaml b/.github/workflows/release-installer-dispatch.yaml deleted file mode 100644 index 3e256b3..0000000 --- a/.github/workflows/release-installer-dispatch.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Upload installers to release - -on: - workflow_dispatch: - inputs: - rust_build_branch: - description: "Branch of rust-build to use" - required: true - default: "main" - release_version: - description: "Release Version for generation" - required: true - default: "1.73.0.1" - rust_version: - description: "Version of esp rust to use" - required: true - default: "1.73.0" - -# We Break this down into individual jobs to avoid disk space issues -jobs: - get_release: - # https://github.com/octokit/request-action - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/{owner}/{repo}/releases/tags/v${{ github.event.inputs.release_version }} - owner: esp-rs - repo: rust-build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - upload-installers: - name: Upload installation scripts - runs-on: ubuntu-latest - needs: get_release - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust_build_branch }} - - name: Upload Bash installer - id: upload-bash-installer - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: install-rust-toolchain.sh - asset_name: install-rust-toolchain.sh - asset_content_type: text/plain diff --git a/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml b/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml deleted file mode 100644 index 439b9a9..0000000 --- a/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml +++ /dev/null @@ -1,104 +0,0 @@ -name: Test macOS M1 self-hosted - build of Rust examples - -on: - workflow_dispatch: - inputs: - rust_build_branch: - description: "Branch with test scripts" - required: true - default: "main" - toolchain_version: - description: "Version of Rust IDF toolchain" - required: true - default: "1.73.0.1" - target: - description: "Target to build (e.g. xtensa-esp32-espidf)" - required: true - default: "all" - -jobs: - get_release: - # https://github.com/octokit/request-action - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_latest_release - with: - route: GET /repos/{owner}/{repo}/releases/latest - owner: esp-rs - repo: rust-build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_latest_release.outputs.data }} - - build-idf-rust-examples: - name: Build IDF Rust Examples for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-m1-self-hosted] - steps: - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust_build_branch }} - - name: Set up Python - if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04' || matrix.os == 'windows-latest' }} - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - name: Setup Ninja - if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-18.04' || matrix.os == 'windows-latest' }} - uses: seanmiddleditch/gha-setup-ninja@master - - name: Test Rust toolchain by compiling STD demo - run: | - ./test-rust-toolchain.sh --toolchain-version ${{ github.event.inputs.toolchain_version }} --target ${{ github.event.inputs.target }} --clear-cache YES - # - name: Prepare artifact for upload - # working-directory: rust-esp32-std-demo/target/xtensa-esp32-espidf/debug/ - # run: zip ../../../../rust-esp32-std-demo-xtensa-esp32-espidf.zip rust-esp32-std-demo - # - name: Prepare artifact for upload - # working-directory: rust-esp32-std-demo/target/xtensa-esp32s2-espidf/debug/ - # run: zip ../../../../rust-esp32-std-demo-xtensa-esp32s2-espidf.zip rust-esp32-std-demo - # - name: Prepare artifact for upload - # working-directory: rust-esp32-std-demo/target/riscv32imc-esp-espidf/debug/ - # run: zip ../../../../rust-esp32-std-demo-riscv32imc-esp-espidf.zip rust-esp32-std-demo - # - name: Upload Release Asset - # id: upload-release-asset-esp32 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.get_release.outputs.upload_url }} - # asset_path: rust-esp32-std-demo-xtensa-esp32-espidf.zip - # asset_name: rust-esp32-std-demo-xtensa-esp32-espidf.zip - # asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} - # - name: Upload Release Asset - # id: upload-release-asset-esp32s2 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.get_release.outputs.upload_url }} - # asset_path: rust-esp32-std-demo-xtensa-esp32s2-espidf.zip - # asset_name: rust-esp32-std-demo-xtensa-esp32s2-espidf.zip - # asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} - # - name: Upload Release Asset - # id: upload-release-asset-esp32c3 - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.get_release.outputs.upload_url }} - # asset_path: rust-esp32-std-demo-riscv32imc-esp-espidf.zip - # asset_name: rust-esp32-std-demo-riscv32imc-esp-espidf.zip - # asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml b/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml deleted file mode 100644 index 39262b5..0000000 --- a/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Test macOS x86_64 - build of Rust examples - -on: - workflow_dispatch: - inputs: - rust_build_branch: - description: "Branch with test scripts" - required: true - default: "main" - toolchain_version: - description: "Version of Rust IDF toolchain" - required: true - default: "1.73.0.1" - -jobs: - build-idf-rust-examples: - name: Build IDF Rust Examples for ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest] - - steps: - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust_build_branch }} - - uses: ./.github/actions/tools/setup-python - - uses: ./.github/actions/tools/setup-ninja - - name: Test Rust toolchain by compiling STD demo - run: ./test-rust-toolchain.sh --toolchain-version ${{ github.event.inputs.toolchain_version }} diff --git a/.github/workflows/test-rust-x86_64-unknown-linux-gnu-dispatch.yaml b/.github/workflows/test-rust-x86_64-unknown-linux-gnu-dispatch.yaml deleted file mode 100644 index 6101b87..0000000 --- a/.github/workflows/test-rust-x86_64-unknown-linux-gnu-dispatch.yaml +++ /dev/null @@ -1,68 +0,0 @@ -name: Test Rust examples on specific host - -on: - workflow_dispatch: - inputs: - rust_build_branch: - description: "Branch with test scripts" - required: true - default: "main" - toolchain_version: - description: "Version of Rust IDF toolchain" - required: true - default: "1.73.0.1" - esp_idf_version: - description: "Version of ESP-IDF for the build" - required: true - default: "release/v4.4" - project: - description: "Name of project for the build" - required: true - default: "rust-esp32-std-demo" - project_repo: - description: "Git repository of the project" - required: true - default: "https://github.com/ivmarkov/rust-esp32-std-demo.git" - features: - description: "Features for the build, space separated list" - required: false - default: "" - test_mode: - description: "Testing mode: build, flash, monitor" - required: true - default: "build" - runs_on: - description: "runs_on Github runner name" - required: true - default: "ubuntu-latest" - -jobs: - build-idf-rust-examples: - name: Build IDF Rust Project - ${{ github.event.inputs.runs_on }} - runs-on: ${{ github.event.inputs.runs_on }} - strategy: - matrix: - target: - [ - xtensa-esp32-espidf, - xtensa-esp32s2-espidf, - xtensa-esp32s3-espidf, - riscv32imc-esp-espidf, - ] - fail-fast: false - - steps: - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.rust_build_branch }} - - uses: ./.github/actions/tools/setup-libudev - - uses: ./.github/actions/tools/setup-python - - uses: ./.github/actions/tools/setup-ninja - - name: Test Rust toolchain by compiling STD demo - run: | - ./test-rust-toolchain.sh --toolchain-version ${{ github.event.inputs.toolchain_version }} \ - --project ${{ github.event.inputs.project }} \ - --project-repo ${{ github.event.inputs.project_repo }} \ - --target ${{ matrix.target }} \ - --features "${{ github.event.inputs.features }}" diff --git a/.github/workflows/verify-ci-readiness.yaml b/.github/workflows/verify-ci-readiness.yaml deleted file mode 100644 index 893ec4f..0000000 --- a/.github/workflows/verify-ci-readiness.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Verify whether CI is ready for Rust Toolchain builds - -on: - workflow_dispatch - -jobs: - check-builders: - name: Check builders - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ "macos-m1-self-hosted", "macos-x86_64-self-hosted", "x86_64-pc-windows-gnu-self-hosted", "windows-x86_64-self-hosted" ] - steps: - - name: Simple test - run: echo "Test" diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 9d6b61d..0000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM espressif/idf - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV RUSTUP_HOME=/opt/rustup -ENV CARGO_HOME=/opt/cargo -ENV PATH=/opt/cargo/bin:/opt/rustup/bin:/opt/esp/tools/xtensa-esp32-elf-clang/esp-14.0.0-20220415-x86_64-unknown-linux-gnu/bin/:$PATH - -WORKDIR /opt - -COPY install-rust-toolchain.sh . -RUN ./install-rust-toolchain.sh diff --git a/Install-RustToolchain.ps1 b/Install-RustToolchain.ps1 deleted file mode 100644 index a28878e..0000000 --- a/Install-RustToolchain.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -"Warning: This installation method is outdated and no longer supported." -"Use following installation methods:" -" - Universal Online Installer (idf-installer) - https://dl.espressif.com/dl/esp-idf/" -" - espup - https://github.com/esp-rs/espup#installation" \ No newline at end of file diff --git a/support/llvm-project/aarch64-apple-darwin/build-llvm.sh b/support/llvm-project/aarch64-apple-darwin/build-llvm.sh deleted file mode 100755 index 16e8c64..0000000 --- a/support/llvm-project/aarch64-apple-darwin/build-llvm.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/bash - -# Clean up collision directory -XTENSA_CLANG_TOOLCHAIN=${HOME}/.espressif/tools/xtensa-clang-toolchain -rm -rf ${XTENSA_CLANG_TOOLCHAIN} -mkdir -p ${XTENSA_CLANG_TOOLCHAIN} - -export INSTALLPREFIX=${HOME}/xtensa-esp32-elf-clang -rm -rf ${INSTALLPREFIX} -mkdir ${INSTALLPREFIX} - - -cd llvm-project -cp clangwrap.cpp ${INSTALLPREFIX} -../build-toolchain-macos-m1.sh - -cd .. -tar cJf xtensa-esp32-elf-llvm14_0_0-esp-14.0.0-20220415-aarch64-apple-darwin.tar.xz xtensa-esp32-elf-clang - diff --git a/support/llvm-project/aarch64-apple-darwin/build-toolchain-macos-m1.sh b/support/llvm-project/aarch64-apple-darwin/build-toolchain-macos-m1.sh deleted file mode 100755 index fac7ef6..0000000 --- a/support/llvm-project/aarch64-apple-darwin/build-toolchain-macos-m1.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env bash -# -# Build and install Clang/LLVM, using `gcc`. -# -# You only need to run this if your distribution does not provide -# clang - or if you want to build your own version from a recent -# source tree. -# -if [ -z "$INSTALLPREFIX" ]; then - INSTALLPREFIX="/usr/local" -fi - -set -e -set -v - -if [ -z "$1" ]; then - CLANG_XTENSA_TOOLCHAIN="${INSTALLPREFIX}" -else - CLANG_XTENSA_TOOLCHAIN="$1" -fi - -function build() { - stage=$1 - mkdir -p $stage - pushd $stage &>/dev/null - cmake -G Ninja ../llvm \ - -DCMAKE_INSTALL_PREFIX=$INSTALLPREFIX \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_ASSERTIONS=OFF \ - -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=1 \ - -DLLVM_TARGETS_TO_BUILD="AArch64" \ - -DLLVM_EXTERNAL_CLANG_SOURCE_DIR=$PWD/../clang - ninja -j 8 - echo "Install clang" - ninja install - cp ./bin/llvm-tblgen ${INSTALLPREFIX}/bin/ - cp ./bin/clang-tblgen ${INSTALLPREFIX}/bin/ - cp ./bin/llvm-config ${INSTALLPREFIX}/bin/ - echo "" - echo "Done!" - echo "" - popd &>/dev/null -} - -build build -# -#OSXCROSS_TAR=osxcross-master-26ebac2.tar.bz2 -#wget --continue --no-verbose "https://dl.espressif.com/dl/toolchains/${OSXCROSS_TAR}" -#mkdir -v "osxcross" && tar xf "${OSXCROSS_TAR}" -C "osxcross" --strip-components 1 -# -#cd osxcross/tarballs/ -#wget --continue --no-verbose https://dl.espressif.com/dl/toolchains/MacOSX11.3.sdk.tar.xz -# -#cd .. -# -#export UNATTENDED=1 -#./build.sh -#export ENABLE_COMPILER_RT_INSTALL=1 -#./build_compiler_rt.sh -#cd .. -# -#export OSXCROSS_PATH=$PWD/osxcross/ -#export PATH=$OSXCROSS_PATH/target/bin:$PATH - -#Cross compile clang for MacOS -mkdir -p build_xtensa -cd build_xtensa -cmake -G Ninja $PWD/../llvm \ - -DCMAKE_CROSSCOMPILING=True \ - -DCMAKE_SYSTEM_NAME=Darwin \ - -DCMAKE_OSX_ARCHITECTURES=arm64 \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \ - -DCMAKE_SYSTEM_VERSION=10.9 \ - -DLLVM_TARGETS_TO_BUILD="AArch64" \ - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="Xtensa" \ - -DLLVM_DEFAULT_TARGET_TRIPLE="aarch64-apple-darwin20.4" \ - -DLLVM_TARGET_ARCH="AArch64" \ - -DLLVM_EXTERNAL_CLANG_SOURCE_DIR=$PWD/../clang \ - -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;" \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_TABLEGEN=${INSTALLPREFIX}/bin/llvm-tblgen \ - -DCLANG_TABLEGEN=${INSTALLPREFIX}/bin/clang-tblgen \ - -DLLVM_CONFIG_PATH=${INSTALLPREFIX}/bin/llvm-config \ - -DLLVM_ENABLE_LIBXML2=OFF - -ninja -j 8 - -cd .. - -#Assemble xtensa clang toolchain for MacOS -clang++ -std=c++11 clangwrap.cpp -o ${CLANG_XTENSA_TOOLCHAIN}/bin/xtensa-esp32-elf-clang -cp ${CLANG_XTENSA_TOOLCHAIN}/bin/xtensa-esp32-elf-clang ${CLANG_XTENSA_TOOLCHAIN}/bin/xtensa-esp32-elf-clang++ - -mv build_xtensa/bin/clang ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/bin/clang++ ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/bin/clang-12 ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/bin/clang-tidy ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/bin/clang-format ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/bin/scan-build ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/bin/llvm-config ${CLANG_XTENSA_TOOLCHAIN}/bin/ -mv build_xtensa/libexec/* ${CLANG_XTENSA_TOOLCHAIN}/libexec/ -mv build_xtensa/lib/clang ${CLANG_XTENSA_TOOLCHAIN}/lib/ -mv build_xtensa/lib/libclang.* ${CLANG_XTENSA_TOOLCHAIN}/lib/ diff --git a/support/llvm-project/aarch64-apple-darwin/clangwrap.cpp b/support/llvm-project/aarch64-apple-darwin/clangwrap.cpp deleted file mode 100644 index 05d87c0..0000000 --- a/support/llvm-project/aarch64-apple-darwin/clangwrap.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -int main(int argc, char *argv[]) { - string opt_clang_pre; - string opt_gcc; - string opt_clang; - bool is_c = true; - bool is_cc1 = false; - bool is_gcc = false; - - if (argc < 2) { - printf("ERROR: You need at least one argument.\n"); - return 1; - } - - for (int i = 1; argv[i] != nullptr; i++) { - string option(argv[i]); - - size_t start_pos = 0; - while ((start_pos = option.find("\"", start_pos)) != std::string::npos) { - option.replace(start_pos, 1, "\\\""); - start_pos += 2; - } - - opt_gcc.append(" "); - opt_gcc.append(option); - - if (std::strcmp("-dumpversion", argv[i]) == 0) { - cout << "8.4.0" << "\n"; - return 0; - } - if (std::strcmp("--version", argv[i]) == 0) { - cout << "xtensa-esp32-elf-gcc (crosstool-NG esp-2021r1) 8.4.0" << "\n"; - return 0; - } - if (std::strcmp("-mlongcalls", argv[i]) == 0) { - continue; - } - if (strcmp("-fstrict-volatile-bitfields", argv[i]) == 0) { - continue; - } - if (strcmp("-fno-test-coverage", argv[i]) == 0) { - continue; - } - if (strcmp("-freorder-blocks", argv[i]) == 0) { - continue; - } - if (strcmp("-fno-tree-switch-conversion", argv[i]) == 0) { - continue; - } - if (strcmp("-Wextra", argv[i]) == 0) { - continue; - } - if (strcmp("-Werror=all", argv[i]) == 0) { - continue; - } - if (strcmp("-Wno-frame-address", argv[i]) == 0) { - continue; - } - if (strcmp("-Wno-old-style-declaration", argv[i]) == 0) { - continue; - } - if (strcmp("-Wno-error=unused-but-set-variable", argv[i]) == 0) { - continue; - } - if (strcmp("-Wa,--compress-debug-sections", argv[i]) == 0) { - continue; - } - if (strcmp("-cc1", argv[i]) == 0) { - is_cc1 = true; - continue; - } - - if (strcmp("-x", argv[i]) == 0) { - if (strcmp("c++", argv[i+1]) == 0) - is_c = false; - - opt_clang.append(" "); - opt_clang.append(option); - continue; - } - opt_clang.append(" "); - opt_clang.append(option); - } - - if (is_cc1) { - opt_clang_pre =" -cc1 -nobuiltininc -nostdsysteminc -nostdinc++"; - opt_clang_pre += " -isystem../lib/clang/12.0.1/include"; - - if (is_c) { - opt_clang_pre += " -isystem../lib/gcc/xtensa-esp32-elf/8.4.0/include"; - opt_clang_pre += " -isystem../lib/gcc/xtensa-esp32-elf/8.4.0/include-fixed"; - opt_clang_pre += " -isystem../xtensa-esp32-elf/sys-include"; - opt_clang_pre += " -isystem../xtensa-esp32-elf/include"; - } - - opt_clang_pre += " -stdlib++-isystem../xtensa-esp32-elf/include/c++/8.4.0"; - opt_clang_pre += " -stdlib++-isystem../xtensa-esp32-elf/include/c++/8.4.0/xtensa-esp32-elf"; - opt_clang_pre += " -stdlib++-isystem../xtensa-esp32-elf/include/c++/8.4.0/backward"; - opt_clang_pre += " -std=gnu11 -Os -Wtypedef-redefinition -ffreestanding"; - } else { - opt_clang_pre = " -target xtensa -mcpu=esp32 -fomit-frame-pointer -Wtypedef-redefinition -ffreestanding -fcommon -fno-use-cxa-atexit "; - } - - string cmd = "clang " + opt_clang_pre + opt_clang; - - - if (is_gcc) { - if (!is_c) - cmd = "xtensa-esp32-elf-c++ " + opt_gcc; - else - cmd = "xtensa-esp32-elf-gcc " + opt_gcc; - } - - int result = system(cmd.c_str()); - - return result; -} diff --git a/support/llvm-project/aarch64-unknown-linux-gnu/Containerfile b/support/llvm-project/aarch64-unknown-linux-gnu/Containerfile deleted file mode 100644 index 00d3dab..0000000 --- a/support/llvm-project/aarch64-unknown-linux-gnu/Containerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:20.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -RUN apt-get update \ - && apt-get install -y vim nano git curl gcc ninja-build cmake libudev-dev python3 python3-pip libusb-1.0-0 libssl-dev \ - pkg-config libtinfo5 - -RUN adduser --disabled-password --gecos "" rust -USER rust -WORKDIR /home/rust -COPY build-toolchain-linux.sh /home/rust/build-toolchain-linux.sh -COPY clangwrap.cpp /home/rust/clangwrap.cpp - diff --git a/support/llvm-project/aarch64-unknown-linux-gnu/README.md b/support/llvm-project/aarch64-unknown-linux-gnu/README.md deleted file mode 100644 index e6ed1ce..0000000 --- a/support/llvm-project/aarch64-unknown-linux-gnu/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Build of llvm-project for Linux aarch64 - -- requires 8 GB of memory - -Steps - -``` -podman build -t xtensa-builder . -podman run -it xtensa-builder /bin/bash -build-toolchain-linux.sh - diff --git a/support/llvm-project/aarch64-unknown-linux-gnu/build-toolchain-linux.sh b/support/llvm-project/aarch64-unknown-linux-gnu/build-toolchain-linux.sh deleted file mode 100755 index 5976a88..0000000 --- a/support/llvm-project/aarch64-unknown-linux-gnu/build-toolchain-linux.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -set -e - -AVAILABLE_MEMORY=`awk '/MemAvailable/ { printf "%.0f \n", $2/1024 }' /proc/meminfo` -if [ "$AVAILABLE_MEMORY" -lt "6000" ]; then - echo "Insufficient memory for -j4 build. Increase memory or decrease number of processes for cmake" - exit 1 -fi - -git clone --recursive --depth 1 https://github.com/espressif/llvm-project.git - -# Clean up collision directory -CLANG_XTENSA_TOOLCHAIN=${HOME}/.espressif/tools/xtensa-clang-toolchain -rm -rf ${CLANG_XTENSA_TOOLCHAIN} -mkdir -p ${CLANG_XTENSA_TOOLCHAIN} - -export INSTALLPREFIX=${HOME}/xtensa-esp32-elf-clang -rm -rf ${INSTALLPREFIX} -mkdir ${INSTALLPREFIX} - - -cd llvm-project -cp ../clangwrap.cpp ${INSTALLPREFIX} - - -mkdir build -cd build -cmake ../llvm -DLLVM_TARGETS_TO_BUILD="AArch64" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=Xtensa -DCMAKE_BUILD_TYPE=Release -DLLVM_EXTERNAL_CLANG_SOURCE_DIR=../clang -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;" -cmake --build . -- -j4 -rm ../llvm/test/tools/llvm-ar/error-opening-permission.test -rm ../llvm/test/tools/llvm-elfabi/fail-file-write.test - -if cmake --build . --target check-llvm ; then - echo "LLVM tests passed" -else - echo "LLVM tests failed" - exit 1 -fi - - -g++ -std=c++11 ${INSTALLPREFIX}/clangwrap.cpp -o ${CLANG_XTENSA_TOOLCHAIN}/bin/xtensa-esp32-elf-clang - -cd .. -cp build/bin/xtensa-esp32-elf-clang ${CLANG_XTENSA_TOOLCHAIN}/bin/xtensa-esp32-elf-clang++ - -cp build/bin/clang ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/bin/clang++ ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/bin/clang-14 ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/bin/clang-tidy ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/bin/clang-format ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/bin/scan-build ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/bin/llvm-config ${CLANG_XTENSA_TOOLCHAIN}/bin/ -cp build/libexec/* ${CLANG_XTENSA_TOOLCHAIN}/libexec/ -cp -r build/lib/clang ${CLANG_XTENSA_TOOLCHAIN}/lib/clang -cp build/lib/libclang.* ${CLANG_XTENSA_TOOLCHAIN}/lib/ -#mv xtensa-esp32-elf-clang* ${CLANG_XTENSA_TOOLCHAIN}/bin/ - -cd .. -tar cJf xtensa-esp32-elf-llvm14_0_0-esp-14.0.0-20220415-aarch64-unknown-linux-gnu.tar.xz xtensa-esp32-elf-clang - - diff --git a/support/llvm-project/aarch64-unknown-linux-gnu/clangwrap.cpp b/support/llvm-project/aarch64-unknown-linux-gnu/clangwrap.cpp deleted file mode 100644 index 05d87c0..0000000 --- a/support/llvm-project/aarch64-unknown-linux-gnu/clangwrap.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -int main(int argc, char *argv[]) { - string opt_clang_pre; - string opt_gcc; - string opt_clang; - bool is_c = true; - bool is_cc1 = false; - bool is_gcc = false; - - if (argc < 2) { - printf("ERROR: You need at least one argument.\n"); - return 1; - } - - for (int i = 1; argv[i] != nullptr; i++) { - string option(argv[i]); - - size_t start_pos = 0; - while ((start_pos = option.find("\"", start_pos)) != std::string::npos) { - option.replace(start_pos, 1, "\\\""); - start_pos += 2; - } - - opt_gcc.append(" "); - opt_gcc.append(option); - - if (std::strcmp("-dumpversion", argv[i]) == 0) { - cout << "8.4.0" << "\n"; - return 0; - } - if (std::strcmp("--version", argv[i]) == 0) { - cout << "xtensa-esp32-elf-gcc (crosstool-NG esp-2021r1) 8.4.0" << "\n"; - return 0; - } - if (std::strcmp("-mlongcalls", argv[i]) == 0) { - continue; - } - if (strcmp("-fstrict-volatile-bitfields", argv[i]) == 0) { - continue; - } - if (strcmp("-fno-test-coverage", argv[i]) == 0) { - continue; - } - if (strcmp("-freorder-blocks", argv[i]) == 0) { - continue; - } - if (strcmp("-fno-tree-switch-conversion", argv[i]) == 0) { - continue; - } - if (strcmp("-Wextra", argv[i]) == 0) { - continue; - } - if (strcmp("-Werror=all", argv[i]) == 0) { - continue; - } - if (strcmp("-Wno-frame-address", argv[i]) == 0) { - continue; - } - if (strcmp("-Wno-old-style-declaration", argv[i]) == 0) { - continue; - } - if (strcmp("-Wno-error=unused-but-set-variable", argv[i]) == 0) { - continue; - } - if (strcmp("-Wa,--compress-debug-sections", argv[i]) == 0) { - continue; - } - if (strcmp("-cc1", argv[i]) == 0) { - is_cc1 = true; - continue; - } - - if (strcmp("-x", argv[i]) == 0) { - if (strcmp("c++", argv[i+1]) == 0) - is_c = false; - - opt_clang.append(" "); - opt_clang.append(option); - continue; - } - opt_clang.append(" "); - opt_clang.append(option); - } - - if (is_cc1) { - opt_clang_pre =" -cc1 -nobuiltininc -nostdsysteminc -nostdinc++"; - opt_clang_pre += " -isystem../lib/clang/12.0.1/include"; - - if (is_c) { - opt_clang_pre += " -isystem../lib/gcc/xtensa-esp32-elf/8.4.0/include"; - opt_clang_pre += " -isystem../lib/gcc/xtensa-esp32-elf/8.4.0/include-fixed"; - opt_clang_pre += " -isystem../xtensa-esp32-elf/sys-include"; - opt_clang_pre += " -isystem../xtensa-esp32-elf/include"; - } - - opt_clang_pre += " -stdlib++-isystem../xtensa-esp32-elf/include/c++/8.4.0"; - opt_clang_pre += " -stdlib++-isystem../xtensa-esp32-elf/include/c++/8.4.0/xtensa-esp32-elf"; - opt_clang_pre += " -stdlib++-isystem../xtensa-esp32-elf/include/c++/8.4.0/backward"; - opt_clang_pre += " -std=gnu11 -Os -Wtypedef-redefinition -ffreestanding"; - } else { - opt_clang_pre = " -target xtensa -mcpu=esp32 -fomit-frame-pointer -Wtypedef-redefinition -ffreestanding -fcommon -fno-use-cxa-atexit "; - } - - string cmd = "clang " + opt_clang_pre + opt_clang; - - - if (is_gcc) { - if (!is_c) - cmd = "xtensa-esp32-elf-c++ " + opt_gcc; - else - cmd = "xtensa-esp32-elf-gcc " + opt_gcc; - } - - int result = system(cmd.c_str()); - - return result; -} diff --git a/support/rust-build/rename-rust-release.sh b/support/rust-build/rename-rust-release.sh deleted file mode 100755 index 00365a3..0000000 --- a/support/rust-build/rename-rust-release.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -for I in *1.73.0-dev*; do - NEW_NAME=`echo $I | sed -e 's/1.73.0-dev/1.73.0.1/g'` - mv $I $NEW_NAME -done - diff --git a/support/rust-build/x86_64-unknown-linux-gnu/Containerfile b/support/rust-build/x86_64-unknown-linux-gnu/Containerfile deleted file mode 100644 index c10b72e..0000000 --- a/support/rust-build/x86_64-unknown-linux-gnu/Containerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ubuntu:20.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -RUN apt-get update \ - && apt-get install -y vim nano git curl gcc ninja-build cmake libudev-dev python3 python3-pip libusb-1.0-0 libssl-dev \ - pkg-config libtinfo5 - -RUN adduser --disabled-password --gecos "" rust -USER rust -WORKDIR /home/rust -COPY build.sh /home/rust/build.sh diff --git a/support/rust-build/x86_64-unknown-linux-gnu/build.sh b/support/rust-build/x86_64-unknown-linux-gnu/build.sh deleted file mode 100755 index 77b41f8..0000000 --- a/support/rust-build/x86_64-unknown-linux-gnu/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -e - -git clone --recursive --depth 1 --shallow-submodules https://github.com/esp-rs/rust.git -cd rust -python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${RELEASE_DESCRIPTION}" --enable-extended --enable-cargo-native-static --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --enable-lld -python3 x.py dist --stage 2 - diff --git a/test-rust-toolchain.sh b/test-rust-toolchain.sh deleted file mode 100755 index fe5f610..0000000 --- a/test-rust-toolchain.sh +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Default values -TOOLCHAIN_VERSION="1.73.0.1" -if [ -z "${RUSTUP_HOME}" ]; then - RUSTUP_HOME="${HOME}/.rustup" -fi -TOOLCHAIN_PREFIX="esp" -BUILD_TARGET="xtensa-esp32-espidf" # all, xtensa-esp32-espidf, xtensa-esp32s2-espidf, riscv32imc-esp-espidf -INSTALLATION_MODE="reinstall" # install, reinstall, uninstall, skip -LLVM_VERSION="esp-14.0.0-20220415" -TEST_MODE="compile" # compile, flash, monitor -TEST_PORT="/dev/ttyUSB0" -FEATURES="" # space separated features of the project -CLEAR_CACHE="no" -EXTRA_CRATES="ldproxy" -export ESP_IDF_VERSION="release/v4.4" -PROJECT="rust-esp32-std-demo" -PROJECT_USER="ivmarkov" -PROJECT_REPO="https://github.com/${PROJECT_USER}/${PROJECT}.git" - -# Process positional arguments -POSITIONAL=() -while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -c | --extra-crates) - EXTRA_CRATES="$2" - shift # past argument - shift # past value - ;; - -d | --test-port) - TEST_PORT="$2" - shift # past argument - shift # past value - ;; - -f | --features) - FEATURES="$2" - shift # past argument - shift # past value - ;; - -e | --esp-idf) - export ESP_IDF_VERSION="$2" - shift # past argument - shift # past value - ;; - -n | --toolchain-prefix) - TOOLCHAIN_PREFIX="$2" - shift # past argument - shift # past value - ;; - -b | --target) - BUILD_TARGET="$2" - shift # past argument - shift # past value - ;; - -i | --installation-mode) - INSTALLATION_MODE="$2" - shift # past argument - shift # past value - ;; - -l | --llvm-version) - LLVM_VERSION="$2" - shift # past argument - shift # past value - ;; - -m | --test-mode) - TEST_MODE="$2" - shift # past argument - shift # past value - ;; - -p | --project) - PROJECT="$2" - shift # past argument - shift # past value - ;; - -t | --toolchain-version) - TOOLCHAIN_VERSION="$2" - shift # past argument - shift # past value - ;; - -g | --project-repo) - PROJECT_REPO="$2" - shift # past argument - shift # past value - ;; - -u | --project-user) - PROJECT_USER="$2" - shift # past argument - shift # past value - ;; - -x | --clear-cache) - CLEAR_CACHE="YES" - shift - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done - -set -- "${POSITIONAL[@]}" # restore positional parameters - -echo "Processing configuration:" -echo "--clear-cache = ${CLEAR_CACHE}" -echo "--features = ${FEATURES}" -echo "--esp-idf = ${ESP_IDF_VERSION}" -echo "--extra-crates = ${EXTRA_CRATES}" -echo "--installation-mode = ${INSTALLATION_MODE}" -echo "--project = ${PROJECT}" -echo "--project-repo = ${PROJECT_REPO}" -echo "--target = ${BUILD_TARGET}" -echo "--test-mode = ${TEST_MODE}" -echo "--test-port = ${TEST_PORT}" -echo "--toolchain-prefix = ${TOOLCHAIN_PREFIX}" -echo "--toolchain-version = ${TOOLCHAIN_VERSION}" - -TOOLCHAIN_NAME="${TOOLCHAIN_PREFIX}-${TOOLCHAIN_VERSION}" -EXPORT_FILE="export-rust-${TOOLCHAIN_NAME}.sh" - -function source_cargo() { - if [ ! -z "${CARGO_HOME}" ]; then - source ${CARGO_HOME}/env - else - source ${HOME}/.cargo/env - fi -} - -if [ "${INSTALLATION_MODE}" != "skip" ]; then - ./install-rust-toolchain.sh --installation-mode ${INSTALLATION_MODE} \ - --clear-cache "${CLEAR_CACHE}" \ - --extra-crates "${EXTRA_CRATES}" \ - --export-file "${EXPORT_FILE}" \ - --llvm-version "${LLVM_VERSION}" \ - --toolchain-destination "${RUSTUP_HOME}/toolchains/${TOOLCHAIN_NAME}" \ - --toolchain-version ${TOOLCHAIN_VERSION} -fi - -source "./${EXPORT_FILE}" -command -v cargo || source_cargo - -# Prepare project -if [ "${CLEAR_CACHE}" == "YES" ]; then - rm -rf "${PROJECT}" -fi - -if [ ! -d "${PROJECT}" ]; then - git clone ${PROJECT_REPO} ${PROJECT} -fi - -cd "${PROJECT}" - -# Left over from other target might cause failure in the build, it's better to start from the scratch -cargo clean - -# Project specific setup -case ${PROJECT} in -rust-esp32-std-demo) - if [ -z "${RUST_ESP32_STD_DEMO_WIFI_SSID}" ]; then - export RUST_ESP32_STD_DEMO_WIFI_SSID="rust" - export RUST_ESP32_STD_DEMO_WIFI_PASS="for-esp32" - fi - ;; -esac - -if [ "${BUILD_TARGET}" == "all" ]; then - for TARGET in xtensa-esp32-espidf xtensa-esp32s2-espidf riscv32imc-esp-espidf; do - echo "Building target: ${TARGET}" - cargo +${TOOLCHAIN_NAME} build --target ${TARGET} --release --features "${FEATURES}" - done -else - echo "cargo +${TOOLCHAIN_NAME} build --target ${BUILD_TARGET}" --features "${FEATURES}" - cargo +${TOOLCHAIN_NAME} build --target "${BUILD_TARGET}" --release --features "${FEATURES}" - ELF_IMAGE="target/${BUILD_TARGET}/release/${RUST_STD_DEMO}" - if [ "${TEST_MODE}" == "flash" ]; then - cargo +${TOOLCHAIN_NAME} espflash --target "${BUILD_TARGET}" --release --features ${FEATURES} "${TEST_PORT}" - elif [ "${TEST_MODE}" == "monitor" ]; then - cargo +${TOOLCHAIN_NAME} espflash --monitor --target "${BUILD_TARGET}" --release --features "${FEATURES}" "${TEST_PORT}" - fi -fi From e9dfe751d8f491b5ac7a8d9bfb9019e3192464a8 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:16:56 +0200 Subject: [PATCH 4/9] docs: Add deprecation warning --- install-rust-toolchain.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install-rust-toolchain.sh b/install-rust-toolchain.sh index a4e1379..4ac600a 100755 --- a/install-rust-toolchain.sh +++ b/install-rust-toolchain.sh @@ -27,6 +27,7 @@ IS_SCCACHE_INSTALLED=0 EXPORT_FILE="export-esp.sh" echo "WARNING: This installation script is deprecated. Use espup(https://github.com/esp-rs/espup) instead." +echo "WARNING: This will be removed for Xtensa Rust 1.75.0." display_help() { echo "Usage: install-rust-toolchain.sh " echo "Arguments: " From edbaa5728d71b03c3c35704827f769c4df51caf4 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:17:42 +0200 Subject: [PATCH 5/9] ci: Rework releasing CI --- ...h.yaml => build-aarch64-apple-darwin.yaml} | 0 ...l => build-aarch64-unknown-linux-gnu.yaml} | 0 .github/workflows/build-rust-artifacts.yaml | 34 +++++++++++ ...-src-dispatch.yaml => build-rust-src.yaml} | 0 ...ch.yaml => build-x86_64-apple-darwin.yaml} | 0 ... => build-x86_64-pc-windows-gnu-self.yaml} | 0 ...yaml => build-x86_64-pc-windows-msvc.yaml} | 0 ...ml => build-x86_64-unknown-linux-gnu.yaml} | 2 +- .github/workflows/prepare-release.yaml | 58 +++++++++++++++++++ 9 files changed, 93 insertions(+), 1 deletion(-) rename .github/workflows/{build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml => build-aarch64-apple-darwin.yaml} (100%) rename .github/workflows/{build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml => build-aarch64-unknown-linux-gnu.yaml} (100%) create mode 100644 .github/workflows/build-rust-artifacts.yaml rename .github/workflows/{build-rust-src-dispatch.yaml => build-rust-src.yaml} (100%) rename .github/workflows/{build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml => build-x86_64-apple-darwin.yaml} (100%) rename .github/workflows/{build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml => build-x86_64-pc-windows-gnu-self.yaml} (100%) rename .github/workflows/{build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml => build-x86_64-pc-windows-msvc.yaml} (100%) rename .github/workflows/{build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml => build-x86_64-unknown-linux-gnu.yaml} (98%) create mode 100644 .github/workflows/prepare-release.yaml diff --git a/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-aarch64-apple-darwin.yaml similarity index 100% rename from .github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml rename to .github/workflows/build-aarch64-apple-darwin.yaml diff --git a/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-aarch64-unknown-linux-gnu.yaml similarity index 100% rename from .github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml rename to .github/workflows/build-aarch64-unknown-linux-gnu.yaml diff --git a/.github/workflows/build-rust-artifacts.yaml b/.github/workflows/build-rust-artifacts.yaml new file mode 100644 index 0000000..e72411e --- /dev/null +++ b/.github/workflows/build-rust-artifacts.yaml @@ -0,0 +1,34 @@ +name: Build Xtensa Rust toolchain + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust release version to build" + required: true + default: '1.73.0.0' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +jobs: + launch_workflows: + name: ${{ matrix.target }} + runs-on: ubuntu-latest + + strategy: + matrix: + target: [aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-gnu, x86_64-pc-windows-msvc, x86_64-unknown-linux-gnu, rust-src] + + steps: + - uses: actions/checkout@v4 + - name: Run ${{ matrix.target }} workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-${{ matrix.target }}.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' diff --git a/.github/workflows/build-rust-src-dispatch.yaml b/.github/workflows/build-rust-src.yaml similarity index 100% rename from .github/workflows/build-rust-src-dispatch.yaml rename to .github/workflows/build-rust-src.yaml diff --git a/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-x86_64-apple-darwin.yaml similarity index 100% rename from .github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml rename to .github/workflows/build-x86_64-apple-darwin.yaml diff --git a/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml similarity index 100% rename from .github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml rename to .github/workflows/build-x86_64-pc-windows-gnu-self.yaml diff --git a/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml b/.github/workflows/build-x86_64-pc-windows-msvc.yaml similarity index 100% rename from .github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml rename to .github/workflows/build-x86_64-pc-windows-msvc.yaml diff --git a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-x86_64-unknown-linux-gnu.yaml similarity index 98% rename from .github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml rename to .github/workflows/build-x86_64-unknown-linux-gnu.yaml index cfe3a74..a4746c1 100644 --- a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml +++ b/.github/workflows/build-x86_64-unknown-linux-gnu.yaml @@ -10,7 +10,7 @@ on: release_tag: description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true - default: "untagged-3ecdd54e672f465cad2e"s + default: "untagged-3ecdd54e672f465cad2e" env: TARGET_TRIPLE: x86_64-unknown-linux-gnus diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml new file mode 100644 index 0000000..d2ed54d --- /dev/null +++ b/.github/workflows/prepare-release.yaml @@ -0,0 +1,58 @@ +name: Prepare ${{ github.event.inputs.next_release }} Xtensa Rust Release + +on: + workflow_dispatch: + inputs: + last_release: + description: "Previous Xtensa Rust release version" + required: true + default: '1.73.0.0' + next_release: + description: "Next Xtensa Rust release version" + required: true + default: "1.73.0.1" + +jobs: + prepare-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Replace Xtensa Rust versions + run: | + find . -type f -exec sed -i 's/${{ github.event.inputs.last_release }}/${{ github.event.inputs.next_release }}/g' {} \; + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + add: '*' + message: 'Bump Xtensa Rust version to ${{ github.event.inputs.next_release }}' + new_branch: build/${{ github.event.inputs.next_release }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.PAT }} + branch: build/${{ github.event.inputs.next_release }} + base: main + delete-branch: false + title: 'Update Xtensa Rust version to ${{ github.event.inputs.next_release }}' + body: + draft: false + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.next_release }} + release_name: Release ${{ github.event.inputs.next_release }} + draft: true + prerelease: true + check-selfhoste-builders: + name: Check builders + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ "macos-m1-self-hosted", "macos-x86_64-self-hosted", "x86_64-pc-windows-gnu-self-hosted", "windows-x86_64-self-hosted" ] + steps: + - name: Simple test + run: echo "Test" From bcaee8e42a0155ced9e6f8a761d7764142e7fdc5 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:33:51 +0200 Subject: [PATCH 6/9] ci: Allow only triggering some builds --- .github/workflows/build-rust-artifacts.yaml | 139 ++++++++++++++++++-- .github/workflows/prepare-release.yaml | 2 +- 2 files changed, 131 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-rust-artifacts.yaml b/.github/workflows/build-rust-artifacts.yaml index e72411e..9d4fb20 100644 --- a/.github/workflows/build-rust-artifacts.yaml +++ b/.github/workflows/build-rust-artifacts.yaml @@ -11,24 +11,145 @@ on: description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" + aarch64-apple-darwin: + description: "aarch64-apple-darwin" + type: boolean + required: true + default: true + aarch64-unknown-linux-gnu: + description: "aarch64-unknown-linux-gnu" + type: boolean + required: true + default: true + x86_64-apple-darwin: + description: "x86_64-apple-darwin" + type: boolean + required: true + default: true + x86_64-pc-windows-gnu: + description: "x86_64-pc-windows-gnu" + type: boolean + required: true + default: true + x86_64-pc-windows-msvc: + description: "x86_64-pc-windows-msvc" + type: boolean + required: true + default: true + x86_64-unknown-linux-gnu: + description: "x86_64-unknown-linux-gnu" + type: boolean + required: true + default: true + rust-src: + description: "rust-src" + type: boolean + required: true + default: true jobs: - launch_workflows: - name: ${{ matrix.target }} + aarch64-apple-darwin: + if: ${{ github.event.inputs.aarch64-apple-darwin }} + name: aarch64-apple-darwin + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run aarch64-apple-darwin workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-aarch64-apple-darwin.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' + aarch64-unknown-linux-gnu: + if: ${{ github.event.inputs.aarch64-unknown-linux-gnu }} + name: aarch64-unknown-linux-gnu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run aarch64-unknown-linux-gnu workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-aarch64-unknown-linux-gnu.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' + x86_64-apple-darwin: + if: ${{ github.event.inputs.x86_64-apple-darwin }} + name: x86_64-apple-darwin + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run x86_64-apple-darwin workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-x86_64-apple-darwin.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' + x86_64-pc-windows-gnu: + if: ${{ github.event.inputs.x86_64-pc-windows-gnu }} + name: x86_64-pc-windows-gnu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run x86_64-pc-windows-gnu workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-x86_64-pc-windows-gnu.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' + x86_64-pc-windows-msvc: + if: ${{ github.event.inputs.x86_64-pc-windows-msvc }} + name: x86_64-pc-windows-msvc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run x86_64-pc-windows-msvc workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-x86_64-pc-windows-msvc.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' + x86_64-unknown-linux-gnu: + if: ${{ github.event.inputs.x86_64-unknown-linux-gnu }} + name: x86_64-unknown-linux-gnu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run x86_64-unknown-linux-gnu workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-x86_64-unknown-linux-gnu.yaml/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' + rust-src: + if: ${{ github.event.inputs.rust-src }} + name: rust-src runs-on: ubuntu-latest - - strategy: - matrix: - target: [aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-gnu, x86_64-pc-windows-msvc, x86_64-unknown-linux-gnu, rust-src] - steps: - uses: actions/checkout@v4 - - name: Run ${{ matrix.target }} workflow + - name: Run rust-src workflow run: | curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.PAT }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-${{ matrix.target }}.yaml/dispatches \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/build-rust-src.yaml/dispatches \ -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml index d2ed54d..c8d594a 100644 --- a/.github/workflows/prepare-release.yaml +++ b/.github/workflows/prepare-release.yaml @@ -1,4 +1,4 @@ -name: Prepare ${{ github.event.inputs.next_release }} Xtensa Rust Release +name: Prepare Release on: workflow_dispatch: From 532199c046ad3b01b1961b414a1a48eaafe3d97b Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:42:46 +0200 Subject: [PATCH 7/9] ci: Update last release versiomn --- .../workflows/build-aarch64-apple-darwin.yaml | 4 +- .../build-aarch64-unknown-linux-gnu.yaml | 4 +- ...h64-apple-darwin-self-hosted-dispatch.yaml | 72 ++++++++++++ ...nknown-linux-gnu-self-hosted-dispatch.yaml | 82 +++++++++++++ .github/workflows/build-rust-all.yaml | 48 ++++++++ .github/workflows/build-rust-artifacts.yaml | 4 +- .../workflows/build-rust-src-dispatch.yaml | 77 ++++++++++++ .github/workflows/build-rust-src.yaml | 4 +- ..._64-apple-darwin-self-hosted-dispatch.yaml | 71 +++++++++++ ...4-pc-windows-gnu-self-hosted-dispatch.yaml | 111 ++++++++++++++++++ ...-pc-windows-msvc-self-hosted-dispatch.yaml | 95 +++++++++++++++ ...nknown-linux-gnu-self-hosted-dispatch.yaml | 79 +++++++++++++ .../workflows/build-x86_64-apple-darwin.yaml | 4 +- .../build-x86_64-pc-windows-gnu-self.yaml | 4 +- .../build-x86_64-pc-windows-msvc.yaml | 4 +- .../build-x86_64-unknown-linux-gnu.yaml | 4 +- 16 files changed, 651 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml create mode 100644 .github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml create mode 100644 .github/workflows/build-rust-all.yaml create mode 100644 .github/workflows/build-rust-src-dispatch.yaml create mode 100644 .github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml create mode 100644 .github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml create mode 100644 .github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml create mode 100644 .github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml diff --git a/.github/workflows/build-aarch64-apple-darwin.yaml b/.github/workflows/build-aarch64-apple-darwin.yaml index d66f6c0..be84812 100644 --- a/.github/workflows/build-aarch64-apple-darwin.yaml +++ b/.github/workflows/build-aarch64-apple-darwin.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" diff --git a/.github/workflows/build-aarch64-unknown-linux-gnu.yaml b/.github/workflows/build-aarch64-unknown-linux-gnu.yaml index 1a39894..f420745 100644 --- a/.github/workflows/build-aarch64-unknown-linux-gnu.yaml +++ b/.github/workflows/build-aarch64-unknown-linux-gnu.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" diff --git a/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml new file mode 100644 index 0000000..be84812 --- /dev/null +++ b/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml @@ -0,0 +1,72 @@ +name: Xtensa Rust | $TARGET_TRIPLE + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: aarch64-apple-darwin + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-m1-self-hosted] + include: + - os: macos-m1-self-hosted + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: esp-rs/rust + ref: esp-${{ github.event.inputs.release_version }} + submodules: true + - name: Prepare build + run: | + arch -arm64 python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --enable-cargo-native-static --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --set rust.jemalloc --enable-lld + - name: Build with x.py - dist packages - with cached LLVM + run: arch -arm64 python3 x.py dist --stage 2 || echo "silence pkg build error" + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml new file mode 100644 index 0000000..f420745 --- /dev/null +++ b/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml @@ -0,0 +1,82 @@ +name: Xtensa Rust | $TARGET_TRIPLE + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: aarch64-unknown-linux-gnu + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-m1-self-hosted] + include: + - os: macos-m1-self-hosted + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Initialize Podman + run: | + podman ps >/dev/null 2>/dev/null || podman machine start + podman stop rust-linux || echo "ok" + podman container rm rust-linux || echo "Container name rust-linux is available" + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build construction container + run: | + cd support/rust-build/$TARGET_TRIPLE + podman build -t ubuntu-builder . + - name: Build Rust + run: | + podman run -e RELEASE_DESCRIPTION='${{ github.event.inputs.release_version }}' --name rust-linux ubuntu-builder ./build.sh + mkdir -p build + podman cp rust-linux:rust/build/dist build/dist + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} + - name: Clean up + run: | + podman container rm rust-linux + podman machine stop + rm -rf build diff --git a/.github/workflows/build-rust-all.yaml b/.github/workflows/build-rust-all.yaml new file mode 100644 index 0000000..54b727d --- /dev/null +++ b/.github/workflows/build-rust-all.yaml @@ -0,0 +1,48 @@ +name: Build Xtensa Rust toolchain + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust release version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +jobs: + launch_workflows: + name: ${{ matrix.workflow_name.target }} + runs-on: ubuntu-latest + + strategy: + matrix: + workflow_name: + - target: aarch64-apple-darwin + workflow: build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml + - target: aarch64-unknown-linux-gnu + workflow: build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml + - target: x86_64-apple-darwin + workflow: build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml + - target: x86_64-pc-windows-gnu + workflow: build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml + - target: x86_64-pc-windows-msvc + workflow: build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml + - target: x86_64-unknown-linux-gnu + workflow: build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml + - target: rust-src + workflow: build-rust-src-dispatch.yaml + + steps: + - uses: actions/checkout@v4 + - name: Run ${{ matrix.workflow_name }} workflow + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/esp-rs/rust-build/actions/workflows/${{ matrix.workflow_name.workflow }}/dispatches \ + -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' diff --git a/.github/workflows/build-rust-artifacts.yaml b/.github/workflows/build-rust-artifacts.yaml index 9d4fb20..3099336 100644 --- a/.github/workflows/build-rust-artifacts.yaml +++ b/.github/workflows/build-rust-artifacts.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust release version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" aarch64-apple-darwin: diff --git a/.github/workflows/build-rust-src-dispatch.yaml b/.github/workflows/build-rust-src-dispatch.yaml new file mode 100644 index 0000000..0f374a8 --- /dev/null +++ b/.github/workflows/build-rust-src-dispatch.yaml @@ -0,0 +1,77 @@ +name: Xtensa Rust | rust-src + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +env: + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa rust-src + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + include: + - os: ubuntu-latest + ASSET_PATH: "rust/build/dist/rust-src-nightly.tar.xz" + ASSET_NAME: "rust-src-${{ github.event.inputs.release_version }}.tar.xz" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: esp-rs/rust + ref: esp-${{ github.event.inputs.release_version }} + submodules: true + path: "rust" + - name: Setup Ninja + uses: seanmiddleditch/gha-setup-ninja@master + - name: Configure Rust project + working-directory: rust + run: | + python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --dist-compression-formats='xz' + - name: Build Rust src dist + working-directory: rust + run: | + python3 x.py dist rust-src + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/build-rust-src.yaml b/.github/workflows/build-rust-src.yaml index 6d0164b..0f374a8 100644 --- a/.github/workflows/build-rust-src.yaml +++ b/.github/workflows/build-rust-src.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" diff --git a/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml new file mode 100644 index 0000000..c0b87ff --- /dev/null +++ b/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml @@ -0,0 +1,71 @@ +name: Xtensa Rust | $TARGET_TRIPLE + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" +env: + TARGET_TRIPLE: x86_64-apple-darwin + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-x86_64-self-hosted] + include: + - os: macos-x86_64-self-hosted + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: esp-rs/rust + ref: esp-${{ github.event.inputs.release_version }} + submodules: true + - name: Prepare build + run: | + python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --enable-cargo-native-static --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --set rust.jemalloc --enable-lld + - name: Build with x.py - dist packages + run: python3 x.py dist --stage 2 || echo "Ignoring pkg failure" + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml new file mode 100644 index 0000000..26e200b --- /dev/null +++ b/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml @@ -0,0 +1,111 @@ +name: Xtensa Rust | $TARGET_TRIPLE + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: x86_64-pc-windows-gnu + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [x86_64-pc-windows-gnu-self-hosted] + include: + - os: x86_64-pc-windows-gnu-self-hosted + ASSET_PATH: "rust/build/dist/rust-nightly-$TARGET_TRIPLE.zip" + ASSET_NAME: "rust-nightly-$TARGET_TRIPLE.zip" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Checkout repository - esp-rs/rust + uses: actions/checkout@v4 + with: + path: rust + repository: esp-rs/rust + ref: esp-${{ github.event.inputs.release_version }} + submodules: true + - name: Unmount local drive + id: unount_path_before + continue-on-error: true + run: subst "R:" /D + - name: Map local long path to new drive + id: map_path + shell: powershell + run: subst "R:" "$env:GITHUB_WORKSPACE\rust" + - name: Prepare build + working-directory: "R:" + run: | + C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description='${{ github.event.inputs.release_version }}' --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --enable-lld" + - name: Build with x.py - dist packages + id: build-rust + working-directory: "R:" + continue-on-error: true + run: C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 x.py dist --stage 2" + # This step make sense only on Azure runners with 8 cores and 16 GB RAM, + # because LLVM OOMs. Either increase memory or decrease number of parallel processes. + #- name: Retry build with x.py - dist packages - in case of failure on LLVM OOM + # id: retry-build-rust + # if: steps.build-rust.outcome == 'failure' + # working-directory: "R:" + # continue-on-error: true + # run: C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 x.py dist --stage 2" + - name: Repackage binary + id: repackage-binary + continue-on-error: true + shell: powershell + working-directory: "R:/build/dist" + run: | + &"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" -DefaultHost x86_64-pc-windows-gnu + - name: Upload Release Asset + if: steps.repackage-binary.outcome != 'failure' + id: upload-release-asset + continue-on-error: true + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} + - name: Unmount local drive + id: unount_path + continue-on-error: true + run: subst "R:" /D + - name: Fail if build failed + if: steps.repackage-binary.outcome == 'failure' + run: exit 1 diff --git a/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml new file mode 100644 index 0000000..b307450 --- /dev/null +++ b/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml @@ -0,0 +1,95 @@ +name: Xtensa Rust | $TARGET_TRIPLE + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: '1.73.0.1' + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e" + +env: + TARGET_TRIPLE: x86_64-pc-windows-msvc + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-x86_64-self-hosted] + include: + - os: windows-x86_64-self-hosted + ASSET_PATH: "rust/build/dist/rust-nightly-$TARGET_TRIPLE.zip" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.zip" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Checkout repository - esp-rs/rust + uses: actions/checkout@v4 + with: + path: rust + repository: esp-rs/rust + ref: esp-${{ github.event.inputs.release_version }} + submodules: true + - name: Unmount local drive + id: unount_path_before + continue-on-error: true + run: subst "R:" /D + - name: Map local long path to new drive + id: map_path + shell: powershell + run: subst "R:" "$env:GITHUB_WORKSPACE\rust" + - name: Prepare build + working-directory: "R:" + run: | + python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --enable-lld + - name: Build with x.py - dist packages + working-directory: "R:" + continue-on-error: true + run: python3 x.py dist --stage 2 + - name: Repackage binary + shell: powershell + working-directory: "R:/build/dist" + run: | + &"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} + - name: Unmount local drive + id: unount_path + continue-on-error: true + run: subst "R:" /D diff --git a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml new file mode 100644 index 0000000..ad6544f --- /dev/null +++ b/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml @@ -0,0 +1,79 @@ +name: Xtensa Rust | $TARGET_TRIPLE + +on: + workflow_dispatch: + inputs: + release_version: + description: "Xtensa Rust rlease version to build" + required: true + default: "1.73.0.1" + release_tag: + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" + required: true + default: "untagged-3ecdd54e672f465cad2e"s + +env: + TARGET_TRIPLE: x86_64-unknown-linux-gnus + +jobs: + get_release: + name: Get release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.get_upload_url.outputs.url }} + steps: + - uses: octokit/request-action@v2.x + id: get_release + with: + route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: get upload url + id: get_upload_url + run: | + url=$(echo "$response" | jq -r '.upload_url') + echo "::set-output name=url::$url" + env: + response: ${{ steps.get_release.outputs.data }} + + build-xtensa-rust: + name: Build Xtensa Rust for ${{ matrix.os }} + needs: get_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [linux-x86_64-self-hosted] + include: + - os: linux-x86_64-self-hosted + ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" + ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" + ASSET_CONTENT_TYPE: "application/x-tar" + steps: + - name: Initialize Docker + run: | + docker container rm rust-linux || echo "Container name rust-linux is available" + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build construction container + run: | + cd support/rust-build/$TARGET_TRIPLE + docker build -f Containerfile -t ubuntu-builder . + - name: Build Rust + run: | + docker run -e RELEASE_DESCRIPTION='${{ github.event.inputs.release_version }}' --name rust-linux ubuntu-builder ./build.sh + mkdir -p build + docker cp rust-linux:/home/rust/rust/build/dist build/dist + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.get_release.outputs.upload_url }} + asset_path: ${{ matrix.ASSET_PATH }} + asset_name: ${{ matrix.ASSET_NAME }} + asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} + - name: Clean up + run: | + docker container rm rust-linux + rm -rf build diff --git a/.github/workflows/build-x86_64-apple-darwin.yaml b/.github/workflows/build-x86_64-apple-darwin.yaml index 4769a05..c0b87ff 100644 --- a/.github/workflows/build-x86_64-apple-darwin.yaml +++ b/.github/workflows/build-x86_64-apple-darwin.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" env: diff --git a/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml b/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml index 748a5c8..26e200b 100644 --- a/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml +++ b/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" diff --git a/.github/workflows/build-x86_64-pc-windows-msvc.yaml b/.github/workflows/build-x86_64-pc-windows-msvc.yaml index e3cbfcf..b307450 100644 --- a/.github/workflows/build-x86_64-pc-windows-msvc.yaml +++ b/.github/workflows/build-x86_64-pc-windows-msvc.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: '1.73.0.0' + default: '1.73.0.1' release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" diff --git a/.github/workflows/build-x86_64-unknown-linux-gnu.yaml b/.github/workflows/build-x86_64-unknown-linux-gnu.yaml index a4746c1..a68c4ca 100644 --- a/.github/workflows/build-x86_64-unknown-linux-gnu.yaml +++ b/.github/workflows/build-x86_64-unknown-linux-gnu.yaml @@ -6,9 +6,9 @@ on: release_version: description: "Xtensa Rust rlease version to build" required: true - default: "1.73.0.0" + default: "1.73.0.1" release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.0, untagged-00000)" + description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" required: true default: "untagged-3ecdd54e672f465cad2e" From baaa73a143db41ec62c8d638640900483d64269d Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:44:08 +0200 Subject: [PATCH 8/9] ci: Remove duplicated --- ...h64-apple-darwin-self-hosted-dispatch.yaml | 72 ------------ ...nknown-linux-gnu-self-hosted-dispatch.yaml | 82 ------------- .github/workflows/build-rust-all.yaml | 48 -------- .../workflows/build-rust-src-dispatch.yaml | 77 ------------ ..._64-apple-darwin-self-hosted-dispatch.yaml | 71 ----------- ...4-pc-windows-gnu-self-hosted-dispatch.yaml | 111 ------------------ ...-pc-windows-msvc-self-hosted-dispatch.yaml | 95 --------------- ...nknown-linux-gnu-self-hosted-dispatch.yaml | 79 ------------- 8 files changed, 635 deletions(-) delete mode 100644 .github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml delete mode 100644 .github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml delete mode 100644 .github/workflows/build-rust-all.yaml delete mode 100644 .github/workflows/build-rust-src-dispatch.yaml delete mode 100644 .github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml delete mode 100644 .github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml delete mode 100644 .github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml delete mode 100644 .github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml diff --git a/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml deleted file mode 100644 index be84812..0000000 --- a/.github/workflows/build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: Xtensa Rust | $TARGET_TRIPLE - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" - -env: - TARGET_TRIPLE: aarch64-apple-darwin - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa Rust for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-m1-self-hosted] - include: - - os: macos-m1-self-hosted - ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: esp-rs/rust - ref: esp-${{ github.event.inputs.release_version }} - submodules: true - - name: Prepare build - run: | - arch -arm64 python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --enable-cargo-native-static --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --set rust.jemalloc --enable-lld - - name: Build with x.py - dist packages - with cached LLVM - run: arch -arm64 python3 x.py dist --stage 2 || echo "silence pkg build error" - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml deleted file mode 100644 index f420745..0000000 --- a/.github/workflows/build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml +++ /dev/null @@ -1,82 +0,0 @@ -name: Xtensa Rust | $TARGET_TRIPLE - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" - -env: - TARGET_TRIPLE: aarch64-unknown-linux-gnu - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa Rust for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-m1-self-hosted] - include: - - os: macos-m1-self-hosted - ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Initialize Podman - run: | - podman ps >/dev/null 2>/dev/null || podman machine start - podman stop rust-linux || echo "ok" - podman container rm rust-linux || echo "Container name rust-linux is available" - - name: Checkout repository - uses: actions/checkout@v4 - - name: Build construction container - run: | - cd support/rust-build/$TARGET_TRIPLE - podman build -t ubuntu-builder . - - name: Build Rust - run: | - podman run -e RELEASE_DESCRIPTION='${{ github.event.inputs.release_version }}' --name rust-linux ubuntu-builder ./build.sh - mkdir -p build - podman cp rust-linux:rust/build/dist build/dist - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} - - name: Clean up - run: | - podman container rm rust-linux - podman machine stop - rm -rf build diff --git a/.github/workflows/build-rust-all.yaml b/.github/workflows/build-rust-all.yaml deleted file mode 100644 index 54b727d..0000000 --- a/.github/workflows/build-rust-all.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build Xtensa Rust toolchain - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust release version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" - -jobs: - launch_workflows: - name: ${{ matrix.workflow_name.target }} - runs-on: ubuntu-latest - - strategy: - matrix: - workflow_name: - - target: aarch64-apple-darwin - workflow: build-rust-aarch64-apple-darwin-self-hosted-dispatch.yaml - - target: aarch64-unknown-linux-gnu - workflow: build-rust-aarch64-unknown-linux-gnu-self-hosted-dispatch.yaml - - target: x86_64-apple-darwin - workflow: build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml - - target: x86_64-pc-windows-gnu - workflow: build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml - - target: x86_64-pc-windows-msvc - workflow: build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml - - target: x86_64-unknown-linux-gnu - workflow: build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml - - target: rust-src - workflow: build-rust-src-dispatch.yaml - - steps: - - uses: actions/checkout@v4 - - name: Run ${{ matrix.workflow_name }} workflow - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.PAT }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/esp-rs/rust-build/actions/workflows/${{ matrix.workflow_name.workflow }}/dispatches \ - -d '{"ref":"${{ github.ref_name }}", "inputs": { "release_version":"${{ github.event.inputs.release_version }}", "release_tag":"${{ github.event.inputs.release_tag }}" }}' diff --git a/.github/workflows/build-rust-src-dispatch.yaml b/.github/workflows/build-rust-src-dispatch.yaml deleted file mode 100644 index 0f374a8..0000000 --- a/.github/workflows/build-rust-src-dispatch.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: Xtensa Rust | rust-src - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" - -env: - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa rust-src - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - ASSET_PATH: "rust/build/dist/rust-src-nightly.tar.xz" - ASSET_NAME: "rust-src-${{ github.event.inputs.release_version }}.tar.xz" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: esp-rs/rust - ref: esp-${{ github.event.inputs.release_version }} - submodules: true - path: "rust" - - name: Setup Ninja - uses: seanmiddleditch/gha-setup-ninja@master - - name: Configure Rust project - working-directory: rust - run: | - python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --dist-compression-formats='xz' - - name: Build Rust src dist - working-directory: rust - run: | - python3 x.py dist rust-src - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml deleted file mode 100644 index c0b87ff..0000000 --- a/.github/workflows/build-rust-x86_64-apple-darwin-self-hosted-dispatch.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: Xtensa Rust | $TARGET_TRIPLE - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" -env: - TARGET_TRIPLE: x86_64-apple-darwin - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa Rust for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-x86_64-self-hosted] - include: - - os: macos-x86_64-self-hosted - ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: esp-rs/rust - ref: esp-${{ github.event.inputs.release_version }} - submodules: true - - name: Prepare build - run: | - python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --enable-cargo-native-static --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --set rust.jemalloc --enable-lld - - name: Build with x.py - dist packages - run: python3 x.py dist --stage 2 || echo "Ignoring pkg failure" - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} diff --git a/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml deleted file mode 100644 index 26e200b..0000000 --- a/.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch.yaml +++ /dev/null @@ -1,111 +0,0 @@ -name: Xtensa Rust | $TARGET_TRIPLE - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" - -env: - TARGET_TRIPLE: x86_64-pc-windows-gnu - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa Rust for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [x86_64-pc-windows-gnu-self-hosted] - include: - - os: x86_64-pc-windows-gnu-self-hosted - ASSET_PATH: "rust/build/dist/rust-nightly-$TARGET_TRIPLE.zip" - ASSET_NAME: "rust-nightly-$TARGET_TRIPLE.zip" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Checkout repository - esp-rs/rust - uses: actions/checkout@v4 - with: - path: rust - repository: esp-rs/rust - ref: esp-${{ github.event.inputs.release_version }} - submodules: true - - name: Unmount local drive - id: unount_path_before - continue-on-error: true - run: subst "R:" /D - - name: Map local long path to new drive - id: map_path - shell: powershell - run: subst "R:" "$env:GITHUB_WORKSPACE\rust" - - name: Prepare build - working-directory: "R:" - run: | - C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description='${{ github.event.inputs.release_version }}' --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --enable-lld" - - name: Build with x.py - dist packages - id: build-rust - working-directory: "R:" - continue-on-error: true - run: C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 x.py dist --stage 2" - # This step make sense only on Azure runners with 8 cores and 16 GB RAM, - # because LLVM OOMs. Either increase memory or decrease number of parallel processes. - #- name: Retry build with x.py - dist packages - in case of failure on LLVM OOM - # id: retry-build-rust - # if: steps.build-rust.outcome == 'failure' - # working-directory: "R:" - # continue-on-error: true - # run: C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 x.py dist --stage 2" - - name: Repackage binary - id: repackage-binary - continue-on-error: true - shell: powershell - working-directory: "R:/build/dist" - run: | - &"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" -DefaultHost x86_64-pc-windows-gnu - - name: Upload Release Asset - if: steps.repackage-binary.outcome != 'failure' - id: upload-release-asset - continue-on-error: true - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} - - name: Unmount local drive - id: unount_path - continue-on-error: true - run: subst "R:" /D - - name: Fail if build failed - if: steps.repackage-binary.outcome == 'failure' - run: exit 1 diff --git a/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml deleted file mode 100644 index b307450..0000000 --- a/.github/workflows/build-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: Xtensa Rust | $TARGET_TRIPLE - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: '1.73.0.1' - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e" - -env: - TARGET_TRIPLE: x86_64-pc-windows-msvc - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa Rust for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-x86_64-self-hosted] - include: - - os: windows-x86_64-self-hosted - ASSET_PATH: "rust/build/dist/rust-nightly-$TARGET_TRIPLE.zip" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.zip" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Checkout repository - esp-rs/rust - uses: actions/checkout@v4 - with: - path: rust - repository: esp-rs/rust - ref: esp-${{ github.event.inputs.release_version }} - submodules: true - - name: Unmount local drive - id: unount_path_before - continue-on-error: true - run: subst "R:" /D - - name: Map local long path to new drive - id: map_path - shell: powershell - run: subst "R:" "$env:GITHUB_WORKSPACE\rust" - - name: Prepare build - working-directory: "R:" - run: | - python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --enable-lld - - name: Build with x.py - dist packages - working-directory: "R:" - continue-on-error: true - run: python3 x.py dist --stage 2 - - name: Repackage binary - shell: powershell - working-directory: "R:/build/dist" - run: | - &"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} - - name: Unmount local drive - id: unount_path - continue-on-error: true - run: subst "R:" /D diff --git a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml b/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml deleted file mode 100644 index ad6544f..0000000 --- a/.github/workflows/build-rust-x86_64-unknown-linux-gnu-self-hosted-dispatch.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: Xtensa Rust | $TARGET_TRIPLE - -on: - workflow_dispatch: - inputs: - release_version: - description: "Xtensa Rust rlease version to build" - required: true - default: "1.73.0.1" - release_tag: - description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" - required: true - default: "untagged-3ecdd54e672f465cad2e"s - -env: - TARGET_TRIPLE: x86_64-unknown-linux-gnus - -jobs: - get_release: - name: Get release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.get_upload_url.outputs.url }} - steps: - - uses: octokit/request-action@v2.x - id: get_release - with: - route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: get upload url - id: get_upload_url - run: | - url=$(echo "$response" | jq -r '.upload_url') - echo "::set-output name=url::$url" - env: - response: ${{ steps.get_release.outputs.data }} - - build-xtensa-rust: - name: Build Xtensa Rust for ${{ matrix.os }} - needs: get_release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [linux-x86_64-self-hosted] - include: - - os: linux-x86_64-self-hosted - ASSET_PATH: "build/dist/rust-nightly-$TARGET_TRIPLE.tar.xz" - ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-$TARGET_TRIPLE.tar.xz" - ASSET_CONTENT_TYPE: "application/x-tar" - steps: - - name: Initialize Docker - run: | - docker container rm rust-linux || echo "Container name rust-linux is available" - - name: Checkout repository - uses: actions/checkout@v4 - - name: Build construction container - run: | - cd support/rust-build/$TARGET_TRIPLE - docker build -f Containerfile -t ubuntu-builder . - - name: Build Rust - run: | - docker run -e RELEASE_DESCRIPTION='${{ github.event.inputs.release_version }}' --name rust-linux ubuntu-builder ./build.sh - mkdir -p build - docker cp rust-linux:/home/rust/rust/build/dist build/dist - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.get_release.outputs.upload_url }} - asset_path: ${{ matrix.ASSET_PATH }} - asset_name: ${{ matrix.ASSET_NAME }} - asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} - - name: Clean up - run: | - docker container rm rust-linux - rm -rf build From 9df47137543860b3411cc67007963fc95b9a6b98 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Thu, 19 Oct 2023 11:45:34 +0200 Subject: [PATCH 9/9] fix: Fix typio --- .github/workflows/build-aarch64-apple-darwin.yaml | 2 +- .github/workflows/build-aarch64-unknown-linux-gnu.yaml | 2 +- .github/workflows/build-rust-src.yaml | 2 +- .github/workflows/build-x86_64-apple-darwin.yaml | 2 +- .github/workflows/build-x86_64-pc-windows-gnu-self.yaml | 2 +- .github/workflows/build-x86_64-pc-windows-msvc.yaml | 2 +- .github/workflows/build-x86_64-unknown-linux-gnu.yaml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-aarch64-apple-darwin.yaml b/.github/workflows/build-aarch64-apple-darwin.yaml index be84812..40aeb6d 100644 --- a/.github/workflows/build-aarch64-apple-darwin.yaml +++ b/.github/workflows/build-aarch64-apple-darwin.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: '1.73.0.1' release_tag: diff --git a/.github/workflows/build-aarch64-unknown-linux-gnu.yaml b/.github/workflows/build-aarch64-unknown-linux-gnu.yaml index f420745..2ff948d 100644 --- a/.github/workflows/build-aarch64-unknown-linux-gnu.yaml +++ b/.github/workflows/build-aarch64-unknown-linux-gnu.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: '1.73.0.1' release_tag: diff --git a/.github/workflows/build-rust-src.yaml b/.github/workflows/build-rust-src.yaml index 0f374a8..3f7afe7 100644 --- a/.github/workflows/build-rust-src.yaml +++ b/.github/workflows/build-rust-src.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: '1.73.0.1' release_tag: diff --git a/.github/workflows/build-x86_64-apple-darwin.yaml b/.github/workflows/build-x86_64-apple-darwin.yaml index c0b87ff..6671b3b 100644 --- a/.github/workflows/build-x86_64-apple-darwin.yaml +++ b/.github/workflows/build-x86_64-apple-darwin.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: '1.73.0.1' release_tag: diff --git a/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml b/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml index 26e200b..345a87f 100644 --- a/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml +++ b/.github/workflows/build-x86_64-pc-windows-gnu-self.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: '1.73.0.1' release_tag: diff --git a/.github/workflows/build-x86_64-pc-windows-msvc.yaml b/.github/workflows/build-x86_64-pc-windows-msvc.yaml index b307450..bf72ffa 100644 --- a/.github/workflows/build-x86_64-pc-windows-msvc.yaml +++ b/.github/workflows/build-x86_64-pc-windows-msvc.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: '1.73.0.1' release_tag: diff --git a/.github/workflows/build-x86_64-unknown-linux-gnu.yaml b/.github/workflows/build-x86_64-unknown-linux-gnu.yaml index a68c4ca..c1f6fc6 100644 --- a/.github/workflows/build-x86_64-unknown-linux-gnu.yaml +++ b/.github/workflows/build-x86_64-unknown-linux-gnu.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: release_version: - description: "Xtensa Rust rlease version to build" + description: "Xtensa Rust release version to build" required: true default: "1.73.0.1" release_tag: