diff --git a/.github/actions/build/build-rust-std/action.yaml b/.github/actions/build/build-rust-std/action.yaml index bf55c2a5..e8af2fad 100644 --- a/.github/actions/build/build-rust-std/action.yaml +++ b/.github/actions/build/build-rust-std/action.yaml @@ -1,10 +1,9 @@ -name: 'Build Ruststd' -description: 'Build the rust std Library' +name: "Build Ruststd" +description: "Build the rust std Library" runs: using: "composite" steps: - # Run the Windows Build using powershell - name: Prepare build @@ -26,7 +25,6 @@ runs: shell: pwsh run: python3 x.py dist --stage 2 library/std - # Run Linux builds using bash - name: Prepare build @@ -54,7 +52,6 @@ runs: shell: bash run: python3 x.py dist --stage 2 library/std - # Save the result - name: Save Artifact - Standard Library diff --git a/.github/actions/build/build-rustc/action.yaml b/.github/actions/build/build-rustc/action.yaml index 582c0d56..1476ba40 100644 --- a/.github/actions/build/build-rustc/action.yaml +++ b/.github/actions/build/build-rustc/action.yaml @@ -1,10 +1,9 @@ -name: 'Build Rustc' -description: 'Build the rustc toolchain' +name: "Build Rustc" +description: "Build the rustc toolchain" runs: using: "composite" steps: - # Run the Windows Build using powershell - name: Prepare build @@ -26,7 +25,6 @@ runs: shell: pwsh run: python3 x.py dist - # Run Linux builds using bash - name: Prepare build @@ -54,7 +52,6 @@ runs: shell: bash run: python3 x.py dist --stage 2 src/librustc - # Save the result - name: Save Artifact - Rustc diff --git a/.github/actions/build/build-src/action.yaml b/.github/actions/build/build-src/action.yaml index 2afc8d2f..292009b6 100644 --- a/.github/actions/build/build-src/action.yaml +++ b/.github/actions/build/build-src/action.yaml @@ -1,10 +1,9 @@ -name: 'Build Src' -description: 'Build the rustc src' +name: "Build Src" +description: "Build the rustc src" runs: using: "composite" steps: - # Run the Windows Build using powershell - name: Prepare build - Windows @@ -19,7 +18,6 @@ runs: shell: pwsh run: python3 x.py dist dist rust-src - # Run Linux builds using bash - name: Prepare build - macOS @@ -40,7 +38,6 @@ runs: shell: bash run: python3 x.py dist rust-src - # Save the result - name: Save Artifact - Src diff --git a/.github/actions/build/build-tools/action.yaml b/.github/actions/build/build-tools/action.yaml index 10be50ba..5ca0e1ae 100644 --- a/.github/actions/build/build-tools/action.yaml +++ b/.github/actions/build/build-tools/action.yaml @@ -1,10 +1,9 @@ -name: 'Build Tools' -description: 'Build the rustc tools' +name: "Build Tools" +description: "Build the rustc tools" runs: using: "composite" steps: - # Run the Windows Build using powershell - name: Prepare build @@ -28,7 +27,6 @@ runs: shell: pwsh run: python3 x.py dist --stage 2 clippy rustfmt cargo - # Run Linux builds using bash - name: Prepare build @@ -57,7 +55,6 @@ runs: shell: bash run: python3 x.py dist --stage 2 clippy rustfmt cargo - # Save the result # We only want to do cargo for windows builds diff --git a/.github/actions/tools/setup-libudev/action.yaml b/.github/actions/tools/setup-libudev/action.yaml index 6a0db67c..02fe2cda 100644 --- a/.github/actions/tools/setup-libudev/action.yaml +++ b/.github/actions/tools/setup-libudev/action.yaml @@ -1,10 +1,9 @@ -name: 'Setup libudev-dev' -description: 'Install libudev-dev' +name: "Setup libudev-dev" +description: "Install libudev-dev" runs: using: "composite" steps: - - name: Install libudev-dev if: startsWith(matrix.os, 'ubuntu') shell: bash diff --git a/.github/actions/tools/setup-ninja/action.yaml b/.github/actions/tools/setup-ninja/action.yaml index 4eb9ca32..43572dcf 100644 --- a/.github/actions/tools/setup-ninja/action.yaml +++ b/.github/actions/tools/setup-ninja/action.yaml @@ -1,9 +1,8 @@ -name: 'Setup Ninja' -description: 'Setup the Ninja Build System' +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 index 8f5f4edd..8e4cd081 100644 --- a/.github/actions/tools/setup-python/action.yaml +++ b/.github/actions/tools/setup-python/action.yaml @@ -1,11 +1,10 @@ -name: 'Setup Python' -description: 'Setup the Python Install' +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' + python-version: "3.8" diff --git a/.github/actions/util/checkout-esp-rust/action.yaml b/.github/actions/util/checkout-esp-rust/action.yaml index 6b364324..9117f32a 100644 --- a/.github/actions/util/checkout-esp-rust/action.yaml +++ b/.github/actions/util/checkout-esp-rust/action.yaml @@ -1,10 +1,9 @@ -name: 'Checkout Source' -description: 'Downloads the Source for esp-rs/rust' +name: "Checkout Source" +description: "Downloads the Source for esp-rs/rust" runs: using: "composite" steps: - - name: Checkout repository uses: actions/checkout@v2 with: diff --git a/.github/actions/util/create-archive/action.yaml b/.github/actions/util/create-archive/action.yaml index 7ddf8e46..f5a342de 100644 --- a/.github/actions/util/create-archive/action.yaml +++ b/.github/actions/util/create-archive/action.yaml @@ -1,5 +1,5 @@ -name: 'Create Archive' -description: 'Create a release archive for upload' +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 @@ -14,7 +14,6 @@ description: 'Create a release archive for upload' runs: using: "composite" steps: - # Read in the built files - uses: ./rust-build/.github/actions/util/read-artifacts @@ -53,7 +52,6 @@ runs: # 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') diff --git a/.github/actions/util/read-artifacts/action.yaml b/.github/actions/util/read-artifacts/action.yaml index 6552a57e..5ed35162 100644 --- a/.github/actions/util/read-artifacts/action.yaml +++ b/.github/actions/util/read-artifacts/action.yaml @@ -1,10 +1,9 @@ -name: 'Read Cache' -description: 'Reads in all of the built artifact files prior to create-archive' +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: diff --git a/.github/actions/util/setup-envs/action.yaml b/.github/actions/util/setup-envs/action.yaml index 64cd639b..d57e412d 100644 --- a/.github/actions/util/setup-envs/action.yaml +++ b/.github/actions/util/setup-envs/action.yaml @@ -1,5 +1,5 @@ -name: 'Setup Env Variables - Rust Build' -description: 'Setup Env Variables - Rust Build' +name: "Setup Env Variables - Rust Build" +description: "Setup Env Variables - Rust Build" # used for rust build @@ -12,7 +12,6 @@ inputs: runs: using: "composite" steps: - - name: Setup Env Variables - Common shell: bash run: | @@ -47,7 +46,6 @@ runs: # 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 diff --git a/.github/actions/util/symlink-working-dir/action.yaml b/.github/actions/util/symlink-working-dir/action.yaml index edf97ff7..47397c21 100644 --- a/.github/actions/util/symlink-working-dir/action.yaml +++ b/.github/actions/util/symlink-working-dir/action.yaml @@ -1,13 +1,12 @@ -name: 'SymLink the working directory' -description: 'SymLink the working directory' +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 + # 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 diff --git a/.github/actions/util/upload/action.yaml b/.github/actions/util/upload/action.yaml index f45fa489..8f67ae85 100644 --- a/.github/actions/util/upload/action.yaml +++ b/.github/actions/util/upload/action.yaml @@ -1,5 +1,5 @@ -name: 'Upload to github releases' -description: 'Upload the final built archive to github' +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 @@ -11,11 +11,8 @@ description: 'Upload the final built archive to github' 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 }} + tag_name: v${{ env.release_version }} + files: ${{ env.asset_name }} 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 8dfe43ec..156baaff 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,29 +1,28 @@ - name: build-rust-macos-m1-dispatch on: workflow_dispatch: inputs: upload_artifacts: - description: 'Upload final artifacts to Release?' + description: "Upload final artifacts to Release?" required: true - default: 'yes' + default: "yes" rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: '1.64.0.0' rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: 'nightly' + default: "nightly" rust_target: - description: 'Target triple' + description: "Target triple" required: true - default: 'aarch64-apple-darwin' + default: "aarch64-apple-darwin" jobs: get_release: @@ -33,21 +32,21 @@ jobs: 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 }} + - 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 }} build-idf-rust: name: Build IDF Rust for ${{ matrix.os }} @@ -56,12 +55,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-m1-self-hosted ] + 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_CONTENT_TYPE: 'application/x-tar' + - 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_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository uses: actions/checkout@v2 @@ -85,4 +84,3 @@ jobs: 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 index 762c6df4..54552da6 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,29 +1,28 @@ - name: build-rust-aarch64-linux-dispatch on: workflow_dispatch: inputs: upload_artifacts: - description: 'Upload final artifacts to Release?' + description: "Upload final artifacts to Release?" required: true - default: 'yes' + default: "yes" rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: '1.64.0.0' rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: 'nightly' + default: "nightly" rust_target: - description: 'Target triple' + description: "Target triple" required: true - default: 'aarch64-unknown-linux-gnu' + default: "aarch64-unknown-linux-gnu" jobs: get_release: @@ -33,21 +32,21 @@ jobs: 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 }} + - 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 }} build-idf-rust: name: Build IDF Rust for ${{ matrix.os }} @@ -56,12 +55,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-m1-self-hosted ] + 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_CONTENT_TYPE: 'application/x-tar' + - 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_CONTENT_TYPE: "application/x-tar" steps: - name: Initialize Podman run: | diff --git a/.github/workflows/build-rust-on-tag.yaml b/.github/workflows/build-rust-on-tag.yaml index 1ba9d7f6..73c75248 100644 --- a/.github/workflows/build-rust-on-tag.yaml +++ b/.github/workflows/build-rust-on-tag.yaml @@ -3,7 +3,7 @@ name: create-rust-release on: push: tags: - - 'v*' + - "v*" jobs: create_release: diff --git a/.github/workflows/build-rust-src-dispatch.yaml b/.github/workflows/build-rust-src-dispatch.yaml index 81c1c601..ead39922 100644 --- a/.github/workflows/build-rust-src-dispatch.yaml +++ b/.github/workflows/build-rust-src-dispatch.yaml @@ -4,21 +4,21 @@ on: workflow_dispatch: inputs: upload_artifacts: - description: 'Upload final artifacts to Release?' + description: "Upload final artifacts to Release?" required: true - default: 'yes' + default: "yes" rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: '1.64.0.0' rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: 'nightly' + default: "nightly" jobs: get_release: @@ -28,21 +28,21 @@ jobs: 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 }} + - 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 }} build-idf-rust: name: Build IDF Rust for ${{ matrix.os }} @@ -51,12 +51,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest ] + os: [ubuntu-latest] include: - - os: ubuntu-latest - ASSET_PATH: 'rust/build/dist/rust-src-${{ github.event.inputs.rust_version }}.tar.xz' - ASSET_NAME: 'rust-src-${{ github.event.inputs.release_version }}.tar.xz' - ASSET_CONTENT_TYPE: 'application/x-tar' + - os: ubuntu-latest + ASSET_PATH: "rust/build/dist/rust-src-${{ github.event.inputs.rust_version }}.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 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 39a78034..5de5d08b 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,29 +1,28 @@ - name: build-rust-macos-x86_64-self-hosted-dispatch on: workflow_dispatch: inputs: upload_artifacts: - description: 'Upload final artifacts to Release?' + description: "Upload final artifacts to Release?" required: true - default: 'yes' + default: "yes" rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: '1.64.0.0' rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: 'nightly' + default: "nightly" rust_target: - description: 'Target triple' + description: "Target triple" required: true - default: 'x86_64-apple-darwin' + default: "x86_64-apple-darwin" jobs: get_release: @@ -33,21 +32,21 @@ jobs: 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 }} + - 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 }} build-idf-rust: name: Build IDF Rust for ${{ matrix.os }} @@ -56,12 +55,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-x86_64-self-hosted ] + 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_CONTENT_TYPE: 'application/x-tar' + - 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_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository uses: actions/checkout@v2 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 37e4292f..66433054 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,29 +1,28 @@ - name: build-rust-windows-x86_64-self-hosted-dispatch on: workflow_dispatch: inputs: upload_artifacts: - description: 'Upload final artifacts to Release?' + description: "Upload final artifacts to Release?" required: true - default: 'yes' + default: "yes" rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: '1.64.0.0' rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: 'nightly' + default: "nightly" rust_target: - description: 'Target triple' + description: "Target triple" required: true - default: 'x86_64-pc-windows-msvc' + default: "x86_64-pc-windows-msvc" jobs: get_release: @@ -33,21 +32,21 @@ jobs: 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 }} + - 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 }} build-idf-rust: name: Build IDF Rust for ${{ matrix.os }} @@ -56,12 +55,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-x86_64-self-hosted ] + 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_CONTENT_TYPE: 'application/x-tar' + - 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_CONTENT_TYPE: "application/x-tar" steps: - name: Checkout repository uses: actions/checkout@v2 @@ -108,4 +107,3 @@ jobs: 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 index 446039b4..7fad63c7 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,29 +1,28 @@ - name: build-rust-x86_64-linux-dispatch on: workflow_dispatch: inputs: upload_artifacts: - description: 'Upload final artifacts to Release?' + description: "Upload final artifacts to Release?" required: true - default: 'yes' + default: "yes" rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: "1.64.0.0" rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: 'nightly' + default: "nightly" rust_target: - description: 'Target triple' + description: "Target triple" required: true - default: 'x86_64-unknown-linux-gnu' + default: "x86_64-unknown-linux-gnu" jobs: get_release: @@ -33,21 +32,21 @@ jobs: 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 }} + - 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 }} build-idf-rust: name: Build IDF Rust for ${{ matrix.os }} @@ -56,12 +55,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-x86_64-self-hosted ] + 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_CONTENT_TYPE: 'application/x-tar' + - 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_CONTENT_TYPE: "application/x-tar" steps: - name: Initialize Podman run: | diff --git a/.github/workflows/installer-check.yaml b/.github/workflows/installer-check.yaml index 772642de..e7345ccf 100644 --- a/.github/workflows/installer-check.yaml +++ b/.github/workflows/installer-check.yaml @@ -1,7 +1,7 @@ name: Test installer by building template projects env: - xtensa-toolchain-version: '1.62.1.0' + xtensa-toolchain-version: "1.64.0.0" on: push: @@ -103,7 +103,7 @@ jobs: - name: Build template project run: | source ${HOME}/export-esp.sh - cargo generate --git https://github.com/esp-rs/esp-template --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d devcontainer=false + cargo generate --git https://github.com/esp-rs/esp-template --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d devcontainer=false -d alloc=false cd test-${{ matrix.board }} cargo build crate-check: @@ -112,7 +112,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - extra-crates: ["", "ldproxy", "espflash cargo-espflash ldproxy cargo-generate wokwi-server web-flash"] + extra-crates: + [ + "", + "ldproxy", + "espflash cargo-espflash ldproxy cargo-generate wokwi-server web-flash", + ] runs-on: ${{ matrix.os }} defaults: run: @@ -172,7 +177,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - arguments: ["", "--toolchain-version $xtensa-toolchain-version --export-file export-esp-rust.sh", "--build-target all"] + arguments: + [ + "", + "--toolchain-version $xtensa-toolchain-version --export-file export-esp-rust.sh", + "--build-target all", + ] runs-on: ${{ matrix.os }} defaults: run: diff --git a/.github/workflows/nigthly-check.yaml b/.github/workflows/nigthly-check.yaml new file mode 100644 index 00000000..0052b872 --- /dev/null +++ b/.github/workflows/nigthly-check.yaml @@ -0,0 +1,97 @@ +name: Nightly checks + +on: + schedule: + - cron: "50 7 * * *" + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + current-nightly: + name: Current nightly + runs-on: ubuntu-latest + steps: + - name: Setup | Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rustfmt, clippy + - name: Setup | Std + run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu + - name: Setup | Default to nightly + run: rustup default nightly + - name: Setup | cargo-generate (binary) + 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 (cargo) + if: steps.binaries.outcome != 'success' + run: cargo install cargo-generate + - uses: Swatinem/rust-cache@v1 + - name: Generate + run: cargo generate --git https://github.com/esp-rs/esp-template --name test --vcs none --silent -d mcu=esp32c3 -d devcontainer=false -d alloc=false + - name: Build Project + run: cd test; cargo build + prior-nightly: + name: Prior nightly + runs-on: ubuntu-latest + steps: + - name: Set env + run: echo "NIGHTLY_VERSION=nightly-$(date -d '-1 day' '+%Y-%m-%d')" >> $GITHUB_ENV + - name: Setup | Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.NIGHTLY_VERSION }} + - name: Setup | Std + run: rustup component add rust-src --toolchain ${{ env.NIGHTLY_VERSION }}-x86_64-unknown-linux-gnu + - name: Setup | Default to nightly + run: rustup default ${{ env.NIGHTLY_VERSION }} + - name: Setup | cargo-generate (binary) + 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 (cargo) + if: steps.binaries.outcome != 'success' + run: cargo install cargo-generate + - uses: Swatinem/rust-cache@v1 + - name: Generate + run: cargo generate --git https://github.com/esp-rs/esp-template --name test --vcs none --silent -d mcu=esp32c3 -d devcontainer=false -d alloc=false + - name: Build Project + run: cd test; cargo +${{ env.NIGHTLY_VERSION }} build + next-prior-nightly: + name: Next prior nightly + runs-on: ubuntu-latest + steps: + - name: Set env + run: echo "NIGHTLY_VERSION=nightly-$(date -d '-2 day' '+%Y-%m-%d')" >> $GITHUB_ENV + - name: Setup | Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.NIGHTLY_VERSION }} + - name: Setup | Std + run: rustup component add rust-src --toolchain ${{ env.NIGHTLY_VERSION }}-x86_64-unknown-linux-gnu + - name: Setup | Default to nightly + run: rustup default ${{ env.NIGHTLY_VERSION }} + - name: Setup | cargo-generate (binary) + 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 (cargo) + if: steps.binaries.outcome != 'success' + run: cargo install cargo-generate + - uses: Swatinem/rust-cache@v1 + - name: Generate + run: cargo generate --git https://github.com/esp-rs/esp-template --name test --vcs none --silent -d mcu=esp32c3 -d devcontainer=false -d alloc=false + - name: Build Project + run: cd test; cargo +${{ env.NIGHTLY_VERSION }} build diff --git a/.github/workflows/publish-idf-rust-examples-image.yml b/.github/workflows/publish-idf-rust-examples-image.yml index 57235010..59d14c55 100644 --- a/.github/workflows/publish-idf-rust-examples-image.yml +++ b/.github/workflows/publish-idf-rust-examples-image.yml @@ -4,21 +4,21 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" release_version: - description: 'Release version - long 4 places for tag' + description: "Release version - long 4 places for tag" required: true - default: '1.63.0.2' + default: "1.64.0.0" rust_patch_version: - description: 'Release patch version for generation - 3 places for tag' + description: "Release patch version for generation - 3 places for tag" required: true - default: '1.63.0' + default: "1.63.0" rust_minor_version: - description: 'Release minor version - 2 places for tag' + description: "Release minor version - 2 places for tag" required: true - default: '1.60' + default: "1.60" jobs: push_to_registry: @@ -40,4 +40,3 @@ jobs: 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/publish-idf-rust-image.yml b/.github/workflows/publish-idf-rust-image.yml index 84258f7f..2ef9c9af 100644 --- a/.github/workflows/publish-idf-rust-image.yml +++ b/.github/workflows/publish-idf-rust-image.yml @@ -4,21 +4,21 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" release_version: - description: 'Release version - long 4 places for tag' + description: "Release version - long 4 places for tag" required: true - default: '1.63.0.2' + default: "1.64.0.0" rust_patch_version: - description: 'Release patch version for generation - 3 places for tag' + description: "Release patch version for generation - 3 places for tag" required: true - default: '1.63.0' + default: "1.63.0" rust_minor_version: - description: 'Release minor version - 2 places for tag' + description: "Release minor version - 2 places for tag" required: true - default: '1.60' + default: "1.60" jobs: push_to_registry: diff --git a/.github/workflows/publish-idf-rust-tags.yml b/.github/workflows/publish-idf-rust-tags.yml index 6cb7599d..21d55169 100644 --- a/.github/workflows/publish-idf-rust-tags.yml +++ b/.github/workflows/publish-idf-rust-tags.yml @@ -10,7 +10,7 @@ on: toolchain-version: description: "Version of Rust toolchain" required: true - default: '1.63.0.2' + default: "1.64.0.0" jobs: esp-idf: diff --git a/.github/workflows/release-installer-dispatch.yaml b/.github/workflows/release-installer-dispatch.yaml index 40a6b641..f58f4479 100644 --- a/.github/workflows/release-installer-dispatch.yaml +++ b/.github/workflows/release-installer-dispatch.yaml @@ -4,18 +4,17 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch of rust-build to use' + description: "Branch of rust-build to use" required: true - default: 'main' + default: "main" release_version: - description: 'Release Version for generation' + description: "Release Version for generation" required: true - default: '1.63.0.2' + default: "1.64.0.0" rust_version: - description: 'Version of esp rust to use' + description: "Version of esp rust to use" required: true - default: '1.63.0' - + default: "1.63.0" # We Break this down into individual jobs to avoid disk space issues jobs: @@ -26,21 +25,21 @@ jobs: 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 }} + - 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 @@ -69,4 +68,4 @@ jobs: upload_url: ${{ needs.get_release.outputs.upload_url }} asset_path: Install-RustToolchain.ps1 asset_name: Install-RustToolchain.ps1 - asset_content_type: text/x-shellscript + asset_content_type: text/x-shellscript diff --git a/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml b/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml index 0f2e143c..c235494a 100644 --- a/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml +++ b/.github/workflows/test-rust-aarch64-apple-darwin-dispatch.yaml @@ -4,17 +4,17 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" toolchain_version: - description: 'Version of Rust IDF toolchain' + description: "Version of Rust IDF toolchain" required: true - default: '1.63.0.2' + default: "1.64.0.0" target: - description: 'Target to build (e.g. xtensa-esp32-espidf)' + description: "Target to build (e.g. xtensa-esp32-espidf)" required: true - default: 'all' + default: "all" jobs: get_release: @@ -24,21 +24,21 @@ jobs: 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 }} + - 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 }} @@ -46,7 +46,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-m1-self-hosted ] + os: [macos-m1-self-hosted] steps: - name: Check out the repo uses: actions/checkout@v2 @@ -56,7 +56,7 @@ jobs: 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' + 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 diff --git a/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml b/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml index 9a402686..b6334fc3 100644 --- a/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml +++ b/.github/workflows/test-rust-x86_64-apple-darwin-dispatch.yaml @@ -4,13 +4,13 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" toolchain_version: - description: 'Version of Rust IDF toolchain' + description: "Version of Rust IDF toolchain" required: true - default: '1.63.0.2' + default: "1.64.0.0" jobs: build-idf-rust-examples: diff --git a/.github/workflows/test-rust-x86_64-pc-windows-msvc-dispatch.yaml b/.github/workflows/test-rust-x86_64-pc-windows-msvc-dispatch.yaml index fc09f02f..eea296de 100644 --- a/.github/workflows/test-rust-x86_64-pc-windows-msvc-dispatch.yaml +++ b/.github/workflows/test-rust-x86_64-pc-windows-msvc-dispatch.yaml @@ -4,13 +4,13 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" toolchain_version: - description: 'Version of Rust IDF toolchain' + description: "Version of Rust IDF toolchain" required: true - default: '1.63.0.2' + default: "1.64.0.0" jobs: build-idf-rust-examples: diff --git a/.github/workflows/test-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml b/.github/workflows/test-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml index d3ee1d5e..76ea035b 100644 --- a/.github/workflows/test-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml +++ b/.github/workflows/test-rust-x86_64-pc-windows-msvc-self-hosted-dispatch.yaml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" jobs: build-idf-rust-examples: @@ -14,15 +14,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-self-hosted ] + os: [windows-self-hosted] include: - - os: windows-self-hosted - ARCH: '' - TARGET: win-x64 - ASSET_PATH: 'build/dist/esp.zip' - ASSET_NAME: 'rust-1.63.0.2-x86_64-pc-windows-msvc.zip' - ASSET_CONTENT_TYPE: 'application/zip' - LLVM_ROOT_OPTION: '--llvm-root=C:/llvm-project' + - os: windows-self-hosted + ARCH: "" + TARGET: win-x64 + ASSET_PATH: "build/dist/esp.zip" + ASSET_NAME: "rust-1.64.0.0-x86_64-pc-windows-msvc.zip" + ASSET_CONTENT_TYPE: "application/zip" + LLVM_ROOT_OPTION: "--llvm-root=C:/llvm-project" steps: - name: Check out the repo uses: actions/checkout@v2 @@ -32,7 +32,7 @@ jobs: 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' + 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 @@ -55,4 +55,3 @@ jobs: . ..\Export-Rust.ps1 $env:IDF_CCACHE_ENABLE="" cargo +esp build - 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 index b30b2d89..2532b543 100644 --- a/.github/workflows/test-rust-x86_64-unknown-linux-gnu-dispatch.yaml +++ b/.github/workflows/test-rust-x86_64-unknown-linux-gnu-dispatch.yaml @@ -4,37 +4,37 @@ on: workflow_dispatch: inputs: rust_build_branch: - description: 'Branch with test scripts' + description: "Branch with test scripts" required: true - default: 'main' + default: "main" toolchain_version: - description: 'Version of Rust IDF toolchain' + description: "Version of Rust IDF toolchain" required: true - default: '1.63.0.2' + default: "1.64.0.0" esp_idf_version: - description: 'Version of ESP-IDF for the build' + description: "Version of ESP-IDF for the build" required: true - default: 'release/v4.4' + default: "release/v4.4" project: - description: 'Name of project for the build' + description: "Name of project for the build" required: true - default: 'rust-esp32-std-demo' + default: "rust-esp32-std-demo" project_repo: - description: 'Git repository of the project' + description: "Git repository of the project" required: true - default: 'https://github.com/ivmarkov/rust-esp32-std-demo.git' + default: "https://github.com/ivmarkov/rust-esp32-std-demo.git" features: - description: 'Features for the build, space separated list' + description: "Features for the build, space separated list" required: false - default: '' + default: "" test_mode: - description: 'Testing mode: build, flash, monitor' + description: "Testing mode: build, flash, monitor" required: true - default: 'build' + default: "build" runs_on: - description: 'runs_on Github runner name' + description: "runs_on Github runner name" required: true - default: 'ubuntu-latest' + default: "ubuntu-latest" jobs: build-idf-rust-examples: @@ -42,7 +42,13 @@ jobs: runs-on: ${{ github.event.inputs.runs_on }} strategy: matrix: - target: [ xtensa-esp32-espidf, xtensa-esp32s2-espidf, xtensa-esp32s3-espidf, riscv32imc-esp-espidf ] + target: + [ + xtensa-esp32-espidf, + xtensa-esp32s2-espidf, + xtensa-esp32s3-espidf, + riscv32imc-esp-espidf, + ] fail-fast: false steps: diff --git a/Install-RustToolchain.ps1 b/Install-RustToolchain.ps1 index 67ecee9b..37148a7a 100644 --- a/Install-RustToolchain.ps1 +++ b/Install-RustToolchain.ps1 @@ -5,9 +5,9 @@ param ( [ValidateSet("x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu")] $DefaultHost = "x86_64-pc-windows-msvc", [String] - $ExportFile = '', + $ExportFile = 'Export-EspRust.ps1', [String] - $ToolchainVersion = '1.63.0.2', + $ToolchainVersion = '1.64.0.0', [String] $ToolchainDestination = "${HOME}/.rustup/toolchains/esp", [String] diff --git a/README.md b/README.md index 8f426ae6..68d2d1e4 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,14 @@ Download the installer from the [Release section](https://github.com/esp-rs/rust #### Download installer in Bash ```bash -curl -LO https://github.com/esp-rs/rust-build/releases/download/v1.63.0.2/install-rust-toolchain.sh +curl -LO https://github.com/esp-rs/rust-build/releases/download/v1.64.0.0/install-rust-toolchain.sh chmod a+x install-rust-toolchain.sh ``` #### Download installer in PowerShell ```powershell -Invoke-WebRequest 'https://github.com/esp-rs/rust-build/releases/download/v1.63.0.2/Install-RustToolchain.ps1' -OutFile .\Install-RustToolchain.ps1 +Invoke-WebRequest 'https://github.com/esp-rs/rust-build/releases/download/v1.64.0.0/Install-RustToolchain.ps1' -OutFile .\Install-RustToolchain.ps1 ``` ### Linux and macOS @@ -72,27 +72,38 @@ No prerequisites are needed for macOS. git clone https://github.com/esp-rs/rust-build.git cd rust-build ./install-rust-toolchain.sh +. export-esp.sh ``` Run `./install-rust-toolchain.sh --help` for more information about arguments. -Export variables are displayed at the end of the script. -> **Note** -> If the export variables are added to the shell startup script, the shell may need to be refreshed. - Installation of different version of the toolchain: ``` -./install-rust-toolchain.sh --toolchain-version 1.63.0.2 --export-file export-esp-rust.sh -source export-esp-rust.sh +./install-rust-toolchain.sh --toolchain-version 1.64.0.0 +. export-esp.sh ``` +#### Set up the environment variables +We need to update enviornment variables as some of the installed tools are not +yet added to the PATH environment variable, we also need to add LIBCLANG_PATH +environment variable to avoid conflicts with the system Clang. The enviroment +variables that we need to update are shown at the end of the install script and +stored in an export file. By default this export file is `export-esp.sh` but can +be modified with the `-f|--export-file` argument. + +We must set the environmet variables in every terminal session. + + +> **Note** +> If the export variables are added to the shell startup script, the shell may need to be refreshed. + #### Arguments - `-b|--build-target`: Comma separated list of targets [`esp32,esp32s2,esp32s3,esp32c3,all`]. Defaults to: `esp32,esp32s2,esp32s3` - `-c|--cargo-home`: Cargo path. - `-d|--toolchain-destination`: Toolchain instalation folder. Defaults to: `/toolchains/esp` - `-e|--extra-crates`: Extra crates to install. Defaults to: `ldproxy cargo-espflash` -- `-f|--export-file`: Destination of the export file generated. +- `-f|--export-file`: Destination of the export file generated. Defaults to: `export-esp.sh` - `-i|--installation-mode`: Installation mode: [`install, reinstall, uninstall`]. Defaults to: `install` - `-k|--minified-llvm`: Use minified LLVM. Possible values: [`YES, NO`]. Defaults to: `YES` - `-l|--llvm-version`: LLVM version. @@ -162,10 +173,23 @@ Export variables are displayed at the end of the output from the script. Installation of different versions of toolchain: ```sh -./Install-RustToolchain.ps1 -ToolchainVersion 1.63.0.2 -ExportFile Export-EspRust.ps1 +./Install-RustToolchain.ps1 -ToolchainVersion 1.64.0.0 . ./Export-EspRust.ps1 ``` +#### Set up the environment variables +We need to update enviornment variables as some of the installed tools are not +yet added to the PATH environment variable, we also need to add LIBCLANG_PATH +environment variable to avoid conflicts with the system Clang. The enviroment +variables that we need to update are stored in an export file. By default this +export file is `Export-EspRust.ps1` but can be modified with the `-ExportFile` argument. + +We must set the environmet variables in every terminal session. + + +> **Note** +> If the export variables are added to the shell startup script, the shell may need to be refreshed. + ## RISC-V Installation The following instructions are specific for ESP32-C based on RISC-V architecture. diff --git a/Test-RustToolchain.ps1 b/Test-RustToolchain.ps1 index 93aa8791..0796d8fc 100644 --- a/Test-RustToolchain.ps1 +++ b/Test-RustToolchain.ps1 @@ -5,7 +5,7 @@ param ( [ValidateSet("x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu")] $DefaultHost = "x86_64-pc-windows-msvc", [String] - $ToolchainVersion = '1.63.0.2', + $ToolchainVersion = '1.64.0.0', [String] [ValidateSet("xtensa-esp32-espidf", "xtensa-esp32s2-espidf", "xtensa-esp32s3-espidf", "riscv32imc-esp-espidf")] $Target = "xtensa-esp32-espidf", diff --git a/build-template-project.sh b/build-template-project.sh index dc52fafc..2be037f0 100644 --- a/build-template-project.sh +++ b/build-template-project.sh @@ -5,7 +5,7 @@ source /home/esp/export-esp.sh if [[ "$1" == 'esp-idf-template' ]]; then cargo generate --git https://github.com/esp-rs/esp-idf-template cargo --name test-$2 --vcs none --silent -d mcu=$2 -d std=true -d espidfver=$3 -d devcontainer=false elif [[ "$1" == 'esp-template' ]]; then - cargo generate --git https://github.com/esp-rs/esp-template --name test-$2 --vcs none --silent -d mcu=$2 -d devcontainer=false + cargo generate --git https://github.com/esp-rs/esp-template --name test-$2 --vcs none --silent -d mcu=$2 -d devcontainer=false -d alloc=false fi cd test-$2 cargo build diff --git a/idf-rust.Containerfile b/idf-rust.Containerfile index 7facc02b..e0637972 100644 --- a/idf-rust.Containerfile +++ b/idf-rust.Containerfile @@ -8,7 +8,7 @@ ENV LANG=C.UTF-8 ARG CONTAINER_USER=esp ARG CONTAINER_GROUP=esp ARG NIGHTLY_TOOLCHAIN_VERSION=nightly -ARG XTENSA_TOOLCHAIN_VERSION=1.63.0.2 +ARG XTENSA_TOOLCHAIN_VERSION=1.64.0.0 ARG ESP_IDF_VERSION="" ARG ESP_BOARD=esp32,esp32s2,esp32s3 ARG INSTALL_RUST_TOOLCHAIN=install-rust-toolchain.sh @@ -28,7 +28,7 @@ ADD --chown=${CONTAINER_USER}:${CONTAINER_GROUP} \ ${INSTALL_RUST_TOOLCHAIN} RUN chmod a+x ${INSTALL_RUST_TOOLCHAIN} \ && ./${INSTALL_RUST_TOOLCHAIN} \ - --extra-crates "ldproxy cargo-espflash cargo-generate" \ + --extra-crates "ldproxy cargo-espflash cargo-generate sccache" \ --build-target "${ESP_BOARD}" \ --nightly-version "${NIGHTLY_TOOLCHAIN_VERSION}" \ --esp-idf-version "${ESP_IDF_VERSION}" \ diff --git a/install-rust-toolchain.sh b/install-rust-toolchain.sh index 3608bf1d..50fa3d6a 100755 --- a/install-rust-toolchain.sh +++ b/install-rust-toolchain.sh @@ -4,7 +4,7 @@ set -eu #set -v # Default values -TOOLCHAIN_VERSION="1.63.0.2" +TOOLCHAIN_VERSION="1.64.0.0" RUSTUP_HOME="${RUSTUP_HOME:-${HOME}/.rustup}" CARGO_HOME="${CARGO_HOME:-${HOME}/.cargo}" TOOLCHAIN_DESTINATION_DIR="${RUSTUP_HOME}/toolchains/esp" @@ -24,8 +24,8 @@ EXTRA_CRATES="ldproxy cargo-espflash" ESP_IDF_VERSION="" MINIFIED_ESP_IDF="NO" IS_XTENSA_INSTALLED=0 -SYSTEM_PACKAGES="openssl@3" -EXPORT_FILE="" +IS_SCCACHE_INSTALLED=0 +EXPORT_FILE="export-esp.sh" display_help() { echo "Usage: install-rust-toolchain.sh " @@ -34,13 +34,12 @@ display_help() { echo "-c|--cargo-home Cargo path" echo "-d|--toolchain-destination Toolchain installation folder." echo "-e|--extra-crates Extra crates to install. Defaults to: ldproxy cargo-espflash" - echo "-f|--export-file Destination of the export file generated." + echo "-f|--export-file Destination of the export file generated. Defaults to: export-esp.sh" echo "-i|--installation-mode Installation mode: [install, reinstall, uninstall]. Defaults to: install" echo "-k|--minified-llvm Use minified LLVM. Possible values [YES, NO]" echo "-l|--llvm-version LLVM version" echo "-m|--minified-esp-idf [Only applies if using -s|--esp-idf-version]. Deletes some esp-idf folder to save space. Possible values [YES, NO]" echo "-n|--nightly-version Nightly Rust toolchain version" - echo "-p|--system-packages Install missing system packages" echo "-r|--rustup-home Path to .rustup" echo "-s|--esp-idf-version ESP-IDF version. When empty, no esp-idf is installed. Default: \"\"" echo "-t|--toolchain-version Xtensa Rust toolchain version" @@ -106,11 +105,6 @@ while [[ $# -gt 0 ]]; do shift # past argument shift # past value ;; - -p | --system-packages) - SYSTEM_PACKAGES="$2" - shift # past argument - shift # past value - ;; -r | --rustup-home) RUSTUP_HOME="$2" shift # past argument @@ -151,7 +145,6 @@ echo "--minified-esp-idf = ${MINIFIED_ESP_IDF}" echo "--minified-llvm = ${MINIFIED_LLVM}" echo "--nightly-version = ${NIGHTLY_VERSION}" echo "--rustup-home = ${RUSTUP_HOME}" -echo "--system-packages = ${SYSTEM_PACKAGES}" echo "--toolchain-version = ${TOOLCHAIN_VERSION}" echo "--toolchain-destination = ${TOOLCHAIN_DESTINATION_DIR}" @@ -348,6 +341,7 @@ function install_crate_from_xz() { function install_crate_from_tar_gz() { CRATE_URL="$1" CRATE_BIN="$2" + STRIP_COMPONENTS="$3" if [[ -z "${CRATE_BIN}" ]]; then return @@ -361,7 +355,11 @@ function install_crate_from_tar_gz() { if [[ ! -e "${CRATE_BIN}" ]]; then echo "Downloading ${CRATE_URL} to ${CRATE_BIN}.tar.gz" curl -L "${CRATE_URL}" -o "${CRATE_BIN}.tar.gz" - tar xf "${CRATE_BIN}.tar.gz" -C ${CARGO_HOME}/bin + if [[ -z "${STRIP_COMPONENTS}" ]]; then + tar xf "${CRATE_BIN}.tar.gz" -C ${CARGO_HOME}/bin + else + tar xf "${CRATE_BIN}.tar.gz" -C ${CARGO_HOME}/bin --strip-components 1 + fi chmod u+x "${CRATE_BIN}" echo "Using ${CRATE_BIN} binary release" fi @@ -388,6 +386,14 @@ function install_extra_crates() { EXTRA_CRATES="${EXTRA_CRATES/cargo-generate/}" fi + if [[ "${EXTRA_CRATES}" =~ "sccache" ]]; then + IS_SCCACHE_INSTALLED=1 + if [[ -n "${SCCACHE_URL}" ]] && [[ -n "${SCCACHE_BIN}" ]]; then + install_crate_from_tar_gz "${SCCACHE_URL}" "${SCCACHE_BIN}" "STRIP" + EXTRA_CRATES="${EXTRA_CRATES/sccache/}" + fi + fi + if [[ "${EXTRA_CRATES}" =~ "web-flash" ]]; then if [[ -n "${WEB_FLASH_URL}" ]] && [[ -n "${WEB_FLASH_BIN}" ]]; then install_crate_from_zip "${WEB_FLASH_URL}" "${WEB_FLASH_BIN}" @@ -411,38 +417,6 @@ function install_extra_crates() { fi } -function install_system_packages() { - if [[ -z "${SYSTEM_PACKAGES}" ]]; then - return - fi - - echo "Installing system packages: ${SYSTEM_PACKAGES}" - - if [[ ${ARCH} == "aarch64-apple-darwin" || ${ARCH} == "x86_64-apple-darwin" ]]; then - command -v brew || { - echo "Warning: Unable to find command brew. Skipping installation of system package." - return - } - brew list "${SYSTEM_PACKAGES}" || brew install "${SYSTEM_PACKAGES}" - fi -} - -function install_system_packages() { - if [ -z "${SYSTEM_PACKAGES}" ]; then - return - fi - - echo "Installing system packages: ${SYSTEM_PACKAGES}" - - if [[ ${ARCH} == "aarch64-apple-darwin" || ${ARCH} == "x86_64-apple-darwin" ]]; then - command -v brew || { - echo "Warning: Unable to find command brew. Skipping installation of system package." - return - } - brew list "${SYSTEM_PACKAGES}" || brew install "${SYSTEM_PACKAGES}" - fi -} - # Check required tooling - rustc, rustfmt command -v rustup || install_rustup @@ -486,6 +460,8 @@ LDPROXY_URL="" LDPROXY_BIN="" GENERATE_URL="" GENERATE_BIN="" +SCCACHE_URL="" +SCCACHE_BIN="" WOKWI_SERVER_URL="" WOKWI_SERVER_BIN="" WEB_FLASH_URL="" @@ -493,6 +469,9 @@ WEB_FLASH_BIN="" if [[ "${EXTRA_CRATES}" =~ "cargo-generate" ]]; then GENERATE_VERSION=$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1) fi +if [[ "${EXTRA_CRATES}" =~ "sccache" ]]; then + SCCACHE_VERSION=$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/mozilla/sccache" | cut -d/ -f3- | tail -n1) +fi # Configuration overrides for specific architectures if [[ ${ARCH} == "aarch64-apple-darwin" ]]; then @@ -504,6 +483,10 @@ if [[ ${ARCH} == "aarch64-apple-darwin" ]]; then ESPFLASH_BIN="${CARGO_HOME}/bin/espflash" LDPROXY_URL="https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-${ARCH}.zip" LDPROXY_BIN="${CARGO_HOME}/bin/ldproxy" + if [[ "${EXTRA_CRATES}" =~ "sccache" ]]; then + SCCACHE_URL="https://github.com/mozilla/sccache/releases/latest/download/sccache-${SCCACHE_VERSION}-${ARCH}.tar.gz" + fi + SCCACHE_BIN="${CARGO_HOME}/bin/sccache" WOKWI_SERVER_URL="https://github.com/MabezDev/wokwi-server/releases/latest/download/wokwi-server-${ARCH}.zip" WOKWI_SERVER_BIN="${CARGO_HOME}/bin/wokwi-server" WEB_FLASH_URL="https://github.com/bjoernQ/esp-web-flash-server/releases/latest/download/web-flash-${ARCH}.zip" @@ -517,6 +500,10 @@ elif [[ ${ARCH} == "x86_64-apple-darwin" ]]; then ESPFLASH_BIN="${CARGO_HOME}/bin/espflash" LDPROXY_URL="https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-${ARCH}.zip" LDPROXY_BIN="${CARGO_HOME}/bin/ldproxy" + if [[ "${EXTRA_CRATES}" =~ "sccache" ]]; then + SCCACHE_URL="https://github.com/mozilla/sccache/releases/latest/download/sccache-${SCCACHE_VERSION}-${ARCH}.tar.gz" + fi + SCCACHE_BIN="${CARGO_HOME}/bin/sccache" if [[ "${EXTRA_CRATES}" =~ "cargo-generate" ]]; then GENERATE_URL="https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-${GENERATE_VERSION}-${ARCH}.tar.gz" fi @@ -528,7 +515,6 @@ elif [[ ${ARCH} == "x86_64-apple-darwin" ]]; then elif [[ ${ARCH} == "x86_64-unknown-linux-gnu" ]]; then GCC_ARCH="linux-amd64" LLVM_ARCH="linux-amd64" - SYSTEM_PACKAGES="" CARGO_ESPFLASH_URL="https://github.com/esp-rs/espflash/releases/latest/download/cargo-espflash-${ARCH}.zip" CARGO_ESPFLASH_BIN="${CARGO_HOME}/bin/cargo-espflash" ESPFLASH_URL="https://github.com/esp-rs/espflash/releases/latest/download/espflash-${ARCH}.zip" @@ -546,7 +532,6 @@ elif [[ ${ARCH} == "x86_64-unknown-linux-gnu" ]]; then elif [[ ${ARCH} == "aarch64-unknown-linux-gnu" ]]; then GCC_ARCH="linux-arm64" MINIFIED_LLVM="YES" - SYSTEM_PACKAGES="" # if [[ "${EXTRA_CRATES}" =~ "cargo-generate" ]]; then # GENERATE_URL="https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-${GENERATE_VERSION}-${ARCH}.tar.gz" # fi @@ -558,13 +543,16 @@ elif [[ ${ARCH} == "aarch64-unknown-linux-gnu" ]]; then elif [[ ${ARCH} == "x86_64-pc-windows-msvc" ]]; then GCC_ARCH="win64" LLVM_ARCH="win64" - SYSTEM_PACKAGES="" CARGO_ESPFLASH_URL="https://github.com/esp-rs/espflash/releases/latest/download/cargo-espflash-${ARCH}.zip" CARGO_ESPFLASH_BIN="${CARGO_HOME}/bin/cargo-espflash.exe" ESPFLASH_URL="https://github.com/esp-rs/espflash/releases/latest/download/espflash-${ARCH}.zip" ESPFLASH_BIN="${CARGO_HOME}/bin/espflash.exe" LDPROXY_URL="https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-${ARCH}.zip" LDPROXY_BIN="${CARGO_HOME}/bin/ldproxy.exe" + if [[ "${EXTRA_CRATES}" =~ "sccache" ]]; then + SCCACHE_URL="https://github.com/mozilla/sccache/releases/latest/download/sccache-${SCCACHE_VERSION}-${ARCH}.tar.gz" + fi + SCCACHE_BIN="${CARGO_HOME}/bin/sccache" if [[ "${EXTRA_CRATES}" =~ "cargo-generate" ]]; then GENERATE_URL="https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-${GENERATE_VERSION}-${ARCH}.tar.gz" fi @@ -577,8 +565,6 @@ fi echo "Processing toolchain for ${ARCH} - operation: ${INSTALLATION_MODE}" -install_system_packages - RUST_DIST="rust-${TOOLCHAIN_VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${TOOLCHAIN_VERSION}" LLVM_ARTIFACT_VERSION=$(echo ${LLVM_VERSION} | sed -e 's/.*esp-//g' -e 's/-.*//g' -e 's/\./_/g') @@ -630,19 +616,43 @@ if [[ "${CLEAR_DOWNLOAD_CACHE}" == "YES" ]]; then clear_download_cache fi -# Either store the export instructions in a file to be sourced later or print instructions -# directly to the terminal to be used immediately. +printf "\n IMPORTANT!" +printf "\n The following environment variables need to be updated:\n" +if [[ ${IS_XTENSA_INSTALLED} -eq 1 ]]; then + echo export LIBCLANG_PATH=\"${IDF_TOOL_XTENSA_ELF_CLANG}/lib/\" +fi +if [[ -n "${ESP_IDF_VERSION}" ]]; then + echo "export IDF_TOOLS_PATH=${IDF_TOOLS_PATH}" + echo ". ${IDF_PATH}/export.sh" +else + echo export PATH=\"${IDF_TOOL_GCC_PATH}:\$PATH\" +fi +PROFILE_NAME="your default shell" +if grep -q "zsh" <<<"$SHELL"; then + PROFILE_NAME=~/.zshrc +elif grep -q "bash" <<<"$SHELL"; then + PROFILE_NAME=~/.bashrc +fi +printf "\n If you want to activate the ESP-RS environment in every terminal session automatically, you can the previous commands to \"$PROFILE_NAME\"" +printf "\n However, it is not recommended, as doing so activates ESP-RS virtual environment in every terminal session (including those where ESP-RS is not needed), defeating the purpose of the virtual environment and likely affecting other software." + if [[ -n "${EXPORT_FILE:-}" ]]; then + printf "\n The reccomended approach is to source the export file: \". ${EXPORT_FILE}\"" + printf "\n Note: This should be done in every terminal session.\n" echo -n "" >"${EXPORT_FILE}" if [[ ${IS_XTENSA_INSTALLED} -eq 1 ]]; then echo export LIBCLANG_PATH=\"${IDF_TOOL_XTENSA_ELF_CLANG}/lib/\" >>"${EXPORT_FILE}" fi if [[ -n "${ESP_IDF_VERSION}" ]]; then echo "export IDF_TOOLS_PATH=${IDF_TOOLS_PATH}" >>"${EXPORT_FILE}" - echo "source ${IDF_PATH}/export.sh /dev/null 2>&1" >>"${EXPORT_FILE}" + echo ". ${IDF_PATH}/export.sh /dev/null 2>&1" >>"${EXPORT_FILE}" else echo export PATH=\"${IDF_TOOL_GCC_PATH}:\$PATH\" >>"${EXPORT_FILE}" fi + if [[ ${IS_SCCACHE_INSTALLED} -eq 1 ]]; then + echo "export CARGO_INCREMENTAL=0" >>"${EXPORT_FILE}" + echo "export RUSTC_WRAPPER=$(which sccache)" >>"${EXPORT_FILE}" + fi else PROFILE_NAME="your default shell" if grep -q "zsh" <<<"$SHELL"; then @@ -660,4 +670,8 @@ else else echo export PATH=\"${IDF_TOOL_GCC_PATH}:\$PATH\" fi + if [[ ${IS_SCCACHE_INSTALLED} -eq 1 ]]; then + echo "export CARGO_INCREMENTAL=0" + echo "export RUSTC_WRAPPER=$(which sccache)" + fi fi diff --git a/support/esp-rs-rust/Containerfile b/support/esp-rs-rust/Containerfile index 0b8313a2..9f1f0f0f 100644 --- a/support/esp-rs-rust/Containerfile +++ b/support/esp-rs-rust/Containerfile @@ -11,8 +11,8 @@ ENV LANG=C.UTF-8 #ENV ESP_IDF_TOOLS_INSTALL_DIR=custom:/opt/.espressif 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 libssl1.1 + && 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 libssl1.1 #RUN useradd -c "ESP Rust" rust -d /opt; chown rust:rust /opt RUN adduser --disabled-password --gecos "" rust 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 index e8774f31..fac7ef6e 100755 --- a/support/llvm-project/aarch64-apple-darwin/build-toolchain-macos-m1.sh +++ b/support/llvm-project/aarch64-apple-darwin/build-toolchain-macos-m1.sh @@ -19,8 +19,7 @@ else CLANG_XTENSA_TOOLCHAIN="$1" fi -function build() -{ +function build() { stage=$1 mkdir -p $stage pushd $stage &>/dev/null @@ -63,27 +62,26 @@ build build #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 + -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 @@ -103,4 +101,3 @@ 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/rust-build/Repackage-RustRelease.ps1 b/support/rust-build/Repackage-RustRelease.ps1 index 8c73c99e..3eff05a1 100644 --- a/support/rust-build/Repackage-RustRelease.ps1 +++ b/support/rust-build/Repackage-RustRelease.ps1 @@ -11,7 +11,7 @@ param ( $ErrorActionPreference = "Stop" $RustVersion="nightly" -$ReleaseVersion="1.63.0.2" +$ReleaseVersion="1.64.0.0" if (Test-Path -Path esp -PathType Container) { Remove-Item -Recurse -Force -Path esp diff --git a/support/rust-build/aarch64-unknown-linux-gnu/build.sh b/support/rust-build/aarch64-unknown-linux-gnu/build.sh index 7627a894..d60d297b 100755 --- a/support/rust-build/aarch64-unknown-linux-gnu/build.sh +++ b/support/rust-build/aarch64-unknown-linux-gnu/build.sh @@ -6,4 +6,3 @@ git clone --recursive --depth 1 --shallow-submodules https://github.com/esp-rs/r cd rust python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --enable-extended --enable-cargo-native-static --tools=clippy,cargo,rustfmt --dist-compression-formats='xz' python3 x.py dist --stage 2 - diff --git a/support/rust-build/rename-rust-release.sh b/support/rust-build/rename-rust-release.sh index 45d71f6a..3f94502b 100755 --- a/support/rust-build/rename-rust-release.sh +++ b/support/rust-build/rename-rust-release.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash for I in *1.63.0-dev*; do - NEW_NAME=`echo $I | sed -e 's/1.63.0-dev/1.63.0.2/g'` + NEW_NAME=`echo $I | sed -e 's/1.63.0-dev/1.64.0.0/g'` mv $I $NEW_NAME done diff --git a/test-rust-toolchain.sh b/test-rust-toolchain.sh index b750e9ea..b1a90645 100755 --- a/test-rust-toolchain.sh +++ b/test-rust-toolchain.sh @@ -3,7 +3,7 @@ set -e # Default values -TOOLCHAIN_VERSION="1.63.0.2" +TOOLCHAIN_VERSION="1.64.0.0" if [ -z "${RUSTUP_HOME}" ]; then RUSTUP_HOME="${HOME}/.rustup" fi