From 23400d0238d1225ec7eeeb9c3373a628c9f834d3 Mon Sep 17 00:00:00 2001 From: "chromebrew-actions[bot]" <220035932+chromebrew-actions[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:49:55 -0500 Subject: [PATCH] Build: mtools started at 2025-07-28-13UTC. (#12282) * mtools => 4.0.49 Signed-off-by: Satadru Pramanik * Adjust Build.yml Signed-off-by: Satadru Pramanik * Workflow adjustments Signed-off-by: Satadru Pramanik * Updating package files for linux/amd64 to branch mtools. * Adjust workflows Signed-off-by: Satadru Pramanik * Adjust workflows Signed-off-by: Satadru Pramanik --------- Signed-off-by: Satadru Pramanik Co-authored-by: Satadru Pramanik Co-authored-by: satmandu --- .github/workflows/Build.yml | 84 +++++++----- .github/workflows/Generate-PR.yml | 172 ++++++++++++++++++++++-- .github/workflows/No-Compile-Needed.yml | 44 +++--- bin/crew | 2 +- lib/const.rb | 2 +- packages/mtools.rb | 8 +- 6 files changed, 239 insertions(+), 73 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 87dc7d018..8667cf436 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -1,5 +1,6 @@ --- name: Build +run-name: Build ${{ inputs.branch || github.ref_name }} by @${{ github.actor }} on: workflow_dispatch: inputs: @@ -71,7 +72,7 @@ jobs: - name: Push rebase changes uses: ad-m/github-push-action@master with: - branch: ${{ env.BRANCH }} + branch: ${{ inputs.branch || github.ref_name }} force: true - name: Set Timestamp id: set-timestamp @@ -91,7 +92,7 @@ jobs: id: changed-packages run: | if [[ -z "${{ steps.changed-files.outputs.packages_all_changed_files }}" ]]; then - echo "Branch ${{ env.BRANCH }} has no changed package files." + echo "Branch ${{ inputs.branch || github.ref_name }} has no changed package files." exit 1 fi # Convert "packages/foo.rb packages/bar.rb" (from steps.changed-files.outputs.packages_all_changed_files) into "foo bar" @@ -106,7 +107,7 @@ jobs: if [[ -n ${GLIBC_232_COMPATIBLE_PACKAGES} ]]; then echo "GLIBC_232_COMPATIBLE_PACKAGES=${GLIBC_232_COMPATIBLE_PACKAGES}" >> "$GITHUB_ENV" echo "GLIBC_232_COMPATIBLE_PACKAGES=${GLIBC_232_COMPATIBLE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these possibly Glibc 2.32 compatible packages: ${GLIBC_232_COMPATIBLE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these possibly Glibc 2.32 compatible packages: ${GLIBC_232_COMPATIBLE_PACKAGES}" fi # If a package doesnt have a min_glibc value, or if it is below 2.37, add it to GLIBC_237_COMPATIBLE_PACKAGES. @@ -115,7 +116,7 @@ jobs: if [[ -n ${GLIBC_237_COMPATIBLE_PACKAGES} ]]; then echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> "$GITHUB_ENV" echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}" fi # If a package has a compatibility of 'all' or one that includes 'x86_64', add it to x86_64_PACKAGES. @@ -124,7 +125,7 @@ jobs: if [[ -n ${x86_64_PACKAGES} ]]; then echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> "$GITHUB_ENV" echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these x86_64 compatible packages: ${x86_64_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these x86_64 compatible packages: ${x86_64_PACKAGES}" fi ## If a package has a compatibility of 'all' or one that includes 'armv7l', add it to armv7l_PACKAGES. @@ -133,7 +134,7 @@ jobs: if [[ -n ${armv7l_PACKAGES} ]]; then echo "armv7l_PACKAGES=${armv7l_PACKAGES}" >> "$GITHUB_ENV" echo "armv7l_PACKAGES=${armv7l_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these armv7l compatible packages: ${armv7l_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these armv7l compatible packages: ${armv7l_PACKAGES}" fi ## If a package has a compatibility of 'all' or one that includes 'i686', add it to i686_PACKAGES. @@ -142,7 +143,7 @@ jobs: if [[ -n ${i686_PACKAGES} ]]; then echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_ENV" echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these i686 compatible packages: ${i686_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}" fi generate: strategy: @@ -173,7 +174,7 @@ jobs: armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }} if: ${{ !cancelled() }} concurrency: - group: ${{ matrix.arch }}-${{ github.workflow }}-${{ github.ref }} + group: ${{ matrix.arch }}-${{ github.workflow }}-${{ inputs.branch || github.ref_name }} cancel-in-progress: true steps: - name: Build Container cleanup @@ -233,21 +234,21 @@ jobs: run: | if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then # Exit the arm container if there are not armv7l compatible packages. - echo "Skipping armv7l container builds." + echo "Skipping armv7l container builds &/or package file updates" exit 0 elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then # Exit the x86_64 container if there are not x86_64 compatible packages. - echo "Skipping x86_64 container builds." + echo "Skipping x86_64 container builds &/or package file updates" exit 0 elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then # Exit the i686 container if there are not i686 compatible packages. - echo "Skipping i686 container builds." + echo "Skipping i686 container builds &/or package file updates" exit 0 fi git fetch origin - git checkout "${{ env.BRANCH }}" - git reset --hard "origin/${{ env.BRANCH }}" + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" git log --oneline -10 docker pull --platform "${PLATFORM}" "${CONTAINER}" sudo apt install -y acl @@ -265,7 +266,7 @@ jobs: -e GCONV_PATH="/usr/local/lib${LIB_SUFFIX}/gconv" \ -e CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES="${CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES}" \ -e CREW_REPO="${CREW_REPO}" \ - -e CREW_BRANCH="${CREW_BRANCH}" \ + -e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \ -e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \ -e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \ -v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \ @@ -282,8 +283,11 @@ jobs: if [ -n "$(git status --porcelain)" ]; then git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" + git stash + git pull + git stash pop git add -A - git commit -m "Build on ${PLATFORM} to branch ${{ env.BRANCH }}." && git push -f + git commit -m "${{ inputs.branch || github.ref_name }}: Build Run on ${PLATFORM}." && git push git log --oneline -10 fi update-package-files: @@ -317,7 +321,7 @@ jobs: armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }} if: ${{ !cancelled() }} concurrency: - group: ${{ matrix.arch }}-${{ github.workflow }}-${{ github.ref }} + group: ${{ matrix.arch }}-${{ github.workflow }}-${{ inputs.branch || github.ref_name }} cancel-in-progress: true steps: - name: fail if build jobs failed @@ -377,21 +381,21 @@ jobs: run: | if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then # Exit the arm container if there are not armv7l compatible packages. - echo "Skipping armv7l container builds." + echo "Skipping armv7l container builds &/or package file updates" exit 0 elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then # Exit the x86_64 container if there are not x86_64 compatible packages. - echo "Skipping x86_64 container builds." + echo "Skipping x86_64 container builds &/or package file updates" exit 0 elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then # Exit the i686 container if there are not i686 compatible packages. - echo "Skipping i686 container builds." + echo "Skipping i686 container builds &/or package file updates" exit 0 fi git fetch origin - git checkout "${{ env.BRANCH }}" - git reset --hard "origin/${{ env.BRANCH }}" + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" git log --oneline -10 docker pull --platform "${PLATFORM}" "${CONTAINER}" sudo apt install -y acl @@ -409,14 +413,14 @@ jobs: -e GCONV_PATH="/usr/local/lib${LIB_SUFFIX}/gconv" \ -e CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES="${CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES}" \ -e CREW_REPO="${CREW_REPO}" \ - -e CREW_BRANCH="${CREW_BRANCH}" \ + -e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \ -e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \ -e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \ -v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \ -v "$(pwd)":/output:rshared \ --tmpfs /tmp \ "${CONTAINER}" \ - /bin/chromebrewstart "/output/tools/github_actions_update_builder${{ github.event.inputs.allow_fail == 'true' && '_allowing_failures' || ''}}.sh" > >(tee -a /tmp/build.log) 2> >(tee -a /tmp/build.log >&2) + /bin/chromebrewstart "/output/tools/github_actions_update_builder_allowing_failures.sh" > >(tee -a /tmp/build.log) 2> >(tee -a /tmp/build.log >&2) grep "Built and Uploaded:" /tmp/build.log || true echo "Deleting build output directories." sudo rm -rf release pkg_cache @@ -426,8 +430,11 @@ jobs: if [ -n "$(git status --porcelain)" ]; then git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" + git stash + git pull + git stash pop git add -A - git commit -m "Updating package files for ${PLATFORM} to branch ${{ env.BRANCH }}." && git push -f + git commit -m "${{ inputs.branch || github.ref_name }}: Package File Update Run on ${PLATFORM} container." && git push git log --oneline -10 fi build-check: @@ -443,18 +450,27 @@ jobs: run: exit 1 - name: Report update & build success run: echo "Update & build jobs succeeded. Creating a PR." + - name: Get GH Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v4 + with: + application_id: ${{ secrets.APPLICATION_ID }} + application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} + organization: chromebrew + revoke_token: true - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: true ref: ${{ inputs.branch || github.ref_name }} + token: ${{ steps.get_workflow_token.outputs.token }} - name: Rebase to master run: | git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" git fetch origin - git checkout "${{ env.BRANCH }}" - git reset --hard "origin/${{ env.BRANCH }}" + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" git pull --rebase origin master && git push -f git log --oneline -10 - name: Get changed files @@ -474,14 +490,6 @@ jobs: - '!manifest/**' - '!packages/*.rb' - '!.github/**' - - name: Get GH Token - id: get_workflow_token - uses: peter-murray/workflow-application-token-action@v4 - with: - application_id: ${{ secrets.APPLICATION_ID }} - application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} - organization: chromebrew - revoke_token: true - name: Create Pull Request if: ${{ github.event.inputs.with_pr != 'No' }} env: @@ -498,7 +506,7 @@ jobs: run: | rm -rf /tmp/pr.txt echo -e "## Description" >> /tmp/pr.txt - echo -e "- This PR was built using the Build.yml workflow, which was pointed to the ${{ env.BRANCH }} branch.\n" >> /tmp/pr.txt + echo -e "- This PR was built using the Build.yml workflow, which was pointed to the ${{ inputs.branch || github.ref_name }} branch.\n" >> /tmp/pr.txt if [[ "${CHANGED_GITHUB_CONFIG_FILES}" != "" ]]; then echo -e "### Updated GitHub configuration files:" >> /tmp/pr.txt for file in ${CHANGED_GITHUB_CONFIG_FILES} @@ -528,12 +536,12 @@ jobs: echo -e "##\n- [x] This PR has no manifest .filelist changes. _(Package changes have neither added nor removed files.)_" >> /tmp/pr.txt fi echo -e "##\n### Run the following to get this pull request's changes locally for testing.\n\`\`\`bash" >> /tmp/pr.txt - echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ env.BRANCH }} crew update \\" >> /tmp/pr.txt + echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ inputs.branch || github.ref_name }} crew update \\" >> /tmp/pr.txt echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt cat /tmp/pr.txt [[ $PR_TYPE == 'Draft Pull Request' ]] && export PR_DRAFT_FLAG='-d' if [[ -z ${PR_NUMBER} ]]; then - PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "Build: ${{ env.BRANCH }} started at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "Build: ${{ inputs.branch || github.ref_name }} started at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) else gh pr edit -F /tmp/pr.txt fi @@ -545,3 +553,5 @@ jobs: fi echo "PR_NUMBER is ${PR_NUMBER}" echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV" + # Trigger workflow run: + gh workflow run Unit-Test.yml ${PR_NUMBER} diff --git a/.github/workflows/Generate-PR.yml b/.github/workflows/Generate-PR.yml index 46813a668..1861049bd 100644 --- a/.github/workflows/Generate-PR.yml +++ b/.github/workflows/Generate-PR.yml @@ -1,5 +1,6 @@ --- name: Generate PR +run-name: Generate PR for ${{ inputs.branch || github.ref_name }} by @${{ github.actor }} on: workflow_dispatch: inputs: @@ -62,7 +63,7 @@ jobs: - name: Push rebase changes uses: ad-m/github-push-action@master with: - branch: ${{ env.BRANCH }} + branch: ${{ inputs.branch || github.ref_name }} force: true - name: Set Timestamp id: set-timestamp @@ -93,7 +94,7 @@ jobs: if [[ -n ${GLIBC_232_COMPATIBLE_PACKAGES} ]]; then echo "GLIBC_232_COMPATIBLE_PACKAGES=${GLIBC_232_COMPATIBLE_PACKAGES}" >> "$GITHUB_ENV" echo "GLIBC_232_COMPATIBLE_PACKAGES=${GLIBC_232_COMPATIBLE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these possibly Glibc 2.32 compatible packages: ${GLIBC_232_COMPATIBLE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these possibly Glibc 2.32 compatible packages: ${GLIBC_232_COMPATIBLE_PACKAGES}" fi # If a package doesnt have a min_glibc value, or if it is below 2.37, add it to GLIBC_237_COMPATIBLE_PACKAGES. @@ -102,7 +103,7 @@ jobs: if [[ -n ${GLIBC_237_COMPATIBLE_PACKAGES} ]]; then echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> "$GITHUB_ENV" echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}" fi # If a package has a compatibility of 'all' or one that includes 'x86_64', add it to x86_64_PACKAGES. @@ -111,7 +112,7 @@ jobs: if [[ -n ${x86_64_PACKAGES} ]]; then echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> "$GITHUB_ENV" echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these x86_64 compatible packages: ${x86_64_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these x86_64 compatible packages: ${x86_64_PACKAGES}" fi ## If a package has a compatibility of 'all' or one that includes 'armv7l', add it to armv7l_PACKAGES. @@ -120,7 +121,7 @@ jobs: if [[ -n ${armv7l_PACKAGES} ]]; then echo "armv7l_PACKAGES=${armv7l_PACKAGES}" >> "$GITHUB_ENV" echo "armv7l_PACKAGES=${armv7l_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these armv7l compatible packages: ${armv7l_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these armv7l compatible packages: ${armv7l_PACKAGES}" fi ## If a package has a compatibility of 'all' or one that includes 'i686', add it to i686_PACKAGES. @@ -129,12 +130,159 @@ jobs: if [[ -n ${i686_PACKAGES} ]]; then echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_ENV" echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these i686 compatible packages: ${i686_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}" fi + update-package-files: + strategy: + max-parallel: 1 + matrix: + arch: [i686, x86_64, armv7l] + runner: + - ubuntu-24.04 + - ubuntu-24.04-arm + exclude: + - arch: x86_64 + runner: ubuntu-24.04-arm + - arch: i686 + runner: ubuntu-24.04-arm + - arch: armv7l + runner: ubuntu-24.04 + runs-on: ${{ matrix.runner }} + needs: + - setup + env: + CREW_REPO: ${{ github.event.repository.clone_url }} + CREW_BRANCH: ${{ inputs.branch || github.ref_name }} + TARGET_ARCH: ${{ matrix.arch }} + TIMESTAMP: ${{ needs.setup.outputs.timestamp }} + GLIBC_232_COMPATIBLE_PACKAGES: ${{ needs.setup.outputs.glibc_232_compat }} + GLIBC_237_COMPATIBLE_PACKAGES: ${{ needs.setup.outputs.glibc_237_compat }} + i686_PACKAGES: ${{ needs.setup.outputs.i686_packages }} + x86_64_PACKAGES: ${{ needs.setup.outputs.x86_64_packages }} + armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }} + if: ${{ !cancelled() }} + concurrency: + group: ${{ matrix.arch }}-${{ github.workflow }}-${{ inputs.branch || github.ref_name }} + cancel-in-progress: true + steps: + - name: fail if build jobs failed + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump job context + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Dump runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + - name: Dump strategy context + env: + STRATEGY_CONTEXT: ${{ toJson(strategy) }} + run: echo "$STRATEGY_CONTEXT" + - name: Dump matrix context + env: + MATRIX_CONTEXT: ${{ toJson(matrix) }} + run: echo "$MATRIX_CONTEXT" + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: true + - name: Export target docker container to github context + run: | + case $TARGET_ARCH in + x86_64) + echo "CONTAINER=satmandu/crew-pre-glibc-standalone:nocturne-x86_64.m90" >> "$GITHUB_ENV" + echo "PLATFORM=linux/amd64" >> "$GITHUB_ENV" + echo "LIB_SUFFIX=64" >> "$GITHUB_ENV" + ;; + armv7l) + echo "CONTAINER=satmandu/crew-pre-glibc-standalone:fievel-armv7l.m91" >> "$GITHUB_ENV" + echo "PLATFORM=linux/arm/v7" >> "$GITHUB_ENV" + echo "LIB_SUFFIX=" >> "$GITHUB_ENV" + ;; + i686) + # There is only one i686 container based upon M58 with glibc 2.23. + echo "CONTAINER=satmandu/crew-pre-glibc-standalone:alex-i686.m58" >> "$GITHUB_ENV" + echo "PLATFORM=linux/386" >> "$GITHUB_ENV" + echo "LIB_SUFFIX=" >> "$GITHUB_ENV" + ;; + esac + - name: Run Updater in container + id: run-updater + if: ${{ contains(needs.*.result, 'failure') || !cancelled() }} + run: | + if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then + # Exit the arm container if there are not armv7l compatible packages. + echo "Skipping armv7l container builds &/or package file updates." + exit 0 + elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then + # Exit the x86_64 container if there are not x86_64 compatible packages. + echo "Skipping x86_64 container builds &/or package file updates" + exit 0 + elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then + # Exit the i686 container if there are not i686 compatible packages. + echo "Skipping i686 container builds &/or package file updates" + exit 0 + fi + + git fetch origin + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" + git log --oneline -10 + docker pull --platform "${PLATFORM}" "${CONTAINER}" + sudo apt install -y acl + # Detection of /output/pkg_cache dir triggers setting + # CREW_CACHE_DIR=1 and CREW_CACHE_ENABLED=1 in the build + # container. Without these, upload fails. + mkdir pkg_cache + sudo setfacl -R -m u:1000:rwx . + docker run \ + --rm \ + --platform "${PLATFORM}" \ + -e PUID=1000 \ + -e PGID=1000 \ + --privileged \ + -e GCONV_PATH="/usr/local/lib${LIB_SUFFIX}/gconv" \ + -e CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES="${CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES}" \ + -e CREW_REPO="${CREW_REPO}" \ + -e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \ + -e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \ + -e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \ + -v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \ + -v "$(pwd)":/output:rshared \ + --tmpfs /tmp \ + "${CONTAINER}" \ + /bin/chromebrewstart "/output/tools/github_actions_update_builder_allowing_failures.sh" > >(tee -a /tmp/build.log) 2> >(tee -a /tmp/build.log >&2) + grep "Built and Uploaded:" /tmp/build.log || true + echo "Deleting build output directories." + sudo rm -rf release pkg_cache + - name: Add updated packages to branch. + id: push-check + run: | + if [ -n "$(git status --porcelain)" ]; then + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + git stash + git pull + git stash pop + git add -A + git commit -m "${{ inputs.branch || github.ref_name }}: Package File Update Run on ${PLATFORM} container." && git push + git log --oneline -10 + fi build-check: runs-on: ubuntu-24.04 needs: - setup + - update-package-files if: ${{ !cancelled() }} steps: - name: fail if update or build jobs failed, otherwise create a PR @@ -152,8 +300,8 @@ jobs: git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" git fetch origin - git checkout "${{ env.BRANCH }}" - git reset --hard "origin/${{ env.BRANCH }}" + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" git pull --rebase origin master && git push -f git log --oneline -10 - name: Get changed files @@ -226,13 +374,13 @@ jobs: echo -e "##\n- [x] This PR has no manifest .filelist changes. _(Package changes have neither added nor removed files.)_" >> /tmp/pr.txt fi echo -e "##\n### Run the following to get this pull request's changes locally for testing.\n\`\`\`bash" >> /tmp/pr.txt - echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ env.BRANCH }} crew update \\" >> /tmp/pr.txt + echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ inputs.branch || github.ref_name }} crew update \\" >> /tmp/pr.txt echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt cat /tmp/pr.txt [[ $DRAFT_PR == 'true' ]] && export PR_DRAFT_FLAG='-d' - PR_NUMBER=$(gh pr list -H ${CREW_BRANCH}| cut -f1) + PR_NUMBER=$(gh pr list -H ${{ inputs.branch || github.ref_name }}| cut -f1) if [[ -z ${PR_NUMBER} ]]; then - PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "${{ env.BRANCH }} at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "${{ inputs.branch || github.ref_name }} at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) else gh pr edit -F /tmp/pr.txt fi @@ -244,3 +392,5 @@ jobs: fi echo "PR_NUMBER is ${PR_NUMBER}" echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV" + # Trigger workflow run: + gh workflow run Unit-Test.yml ${PR_NUMBER} diff --git a/.github/workflows/No-Compile-Needed.yml b/.github/workflows/No-Compile-Needed.yml index 3a8edfad8..55d1361d3 100644 --- a/.github/workflows/No-Compile-Needed.yml +++ b/.github/workflows/No-Compile-Needed.yml @@ -1,5 +1,6 @@ --- name: No-Compile-Needed +run-name: Generate No-Compile-Needed PR for ${{ inputs.branch || github.ref_name }} by @${{ github.actor }} on: workflow_dispatch: inputs: @@ -64,7 +65,7 @@ jobs: - name: Push rebase changes uses: ad-m/github-push-action@master with: - branch: ${{ env.BRANCH }} + branch: ${{ inputs.branch || github.ref_name }} force: true - name: Set Timestamp id: set-timestamp @@ -84,7 +85,7 @@ jobs: id: changed-packages run: | if [[ -z "${{ steps.changed-files.outputs.packages_all_changed_files }}" ]]; then - echo "Branch ${{ env.BRANCH }} has no changed package files." + echo "Branch ${{ inputs.branch || github.ref_name }} has no changed package files." exit 1 fi # Convert "packages/foo.rb packages/bar.rb" (from steps.changed-files.outputs.packages_all_changed_files) into "foo bar" @@ -99,9 +100,9 @@ jobs: if [[ -n ${NO_COMPILE_PACKAGES} ]]; then echo "NO_COMPILE_PACKAGES=${NO_COMPILE_PACKAGES}" >> "$GITHUB_ENV" echo "NO_COMPILE_PACKAGES=${NO_COMPILE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these no_compile_needed packages: ${NO_COMPILE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these no_compile_needed packages: ${NO_COMPILE_PACKAGES}" else - echo "Branch ${{ env.BRANCH }} is missing no_compile_needed packages that require updates." + echo "Branch ${{ inputs.branch || github.ref_name }} is missing no_compile_needed packages that require updates." exit 1 fi @@ -111,7 +112,7 @@ jobs: if [[ -n ${GLIBC_232_COMPATIBLE_PACKAGES} ]]; then echo "GLIBC_232_COMPATIBLE_PACKAGES=${GLIBC_232_COMPATIBLE_PACKAGES}" >> "$GITHUB_ENV" echo "GLIBC_232_COMPATIBLE_PACKAGES=${GLIBC_232_COMPATIBLE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these possibly Glibc 2.32 compatible packages: ${GLIBC_232_COMPATIBLE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these possibly Glibc 2.32 compatible packages: ${GLIBC_232_COMPATIBLE_PACKAGES}" fi # If a package doesnt have a min_glibc value, or if it is below 2.37, add it to GLIBC_237_COMPATIBLE_PACKAGES. @@ -120,7 +121,7 @@ jobs: if [[ -n ${GLIBC_237_COMPATIBLE_PACKAGES} ]]; then echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> "$GITHUB_ENV" echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}" fi # If a package has a compatibility of 'all' or one that includes 'x86_64', add it to x86_64_PACKAGES. @@ -129,7 +130,7 @@ jobs: if [[ -n ${x86_64_PACKAGES} ]]; then echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> "$GITHUB_ENV" echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these x86_64 compatible packages: ${x86_64_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these x86_64 compatible packages: ${x86_64_PACKAGES}" fi ## If a package has a compatibility of 'all' or one that includes 'armv7l', add it to armv7l_PACKAGES. @@ -138,7 +139,7 @@ jobs: if [[ -n ${armv7l_PACKAGES} ]]; then echo "armv7l_PACKAGES=${armv7l_PACKAGES}" >> "$GITHUB_ENV" echo "armv7l_PACKAGES=${armv7l_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these armv7l compatible packages: ${armv7l_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these armv7l compatible packages: ${armv7l_PACKAGES}" fi ## If a package has a compatibility of 'all' or one that includes 'i686', add it to i686_PACKAGES. @@ -147,7 +148,7 @@ jobs: if [[ -n ${i686_PACKAGES} ]]; then echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_ENV" echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT" - echo "Branch ${{ env.BRANCH }} has these i686 compatible packages: ${i686_PACKAGES}" + echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}" fi generate: strategy: @@ -179,7 +180,7 @@ jobs: armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }} if: ${{ !cancelled() }} concurrency: - group: ${{ matrix.arch }}-${{ github.workflow }}-${{ github.ref }} + group: ${{ matrix.arch }}-${{ github.workflow }}-${{ inputs.branch || github.ref_name }} cancel-in-progress: true steps: - name: Container cleanup @@ -266,8 +267,8 @@ jobs: fi git fetch origin - git checkout "${{ env.BRANCH }}" - git reset --hard "origin/${{ env.BRANCH }}" + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" git log --oneline -10 docker pull --platform "${PLATFORM}" "${CONTAINER}" sudo apt install -y acl @@ -286,7 +287,7 @@ jobs: -e LD_LIBRARY_PATH="/usr/local/lib${LIB_SUFFIX}" \ -e GCONV_PATH="/usr/local/lib${LIB_SUFFIX}/gconv" \ -e CREW_REPO="${CREW_REPO}" \ - -e CREW_BRANCH="${CREW_BRANCH}" \ + -e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \ -e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \ -e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \ -v "$(pwd)":/output \ @@ -301,8 +302,11 @@ jobs: if [ -n "$(git status --porcelain)" ]; then git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" + git stash + git pull + git stash pop git add -A - git commit -m "Add updated packages for ${PLATFORM} to ${{ env.BRANCH }}" && git push -f + git commit -m "${{ inputs.branch || github.ref_name }}: Package File Update Run on ${PLATFORM} container." && git push git log --oneline -10 fi update-check: @@ -327,8 +331,8 @@ jobs: git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" git fetch origin - git checkout "${{ env.BRANCH }}" - git reset --hard "origin/${{ env.BRANCH }}" + git checkout "${{ inputs.branch || github.ref_name }}" + git reset --hard "origin/${{ inputs.branch || github.ref_name }}" git pull --rebase origin master && git push -f git log --oneline -10 - name: Get changed files @@ -371,7 +375,7 @@ jobs: run: | rm -rf /tmp/pr.txt echo -e "## Description" >> /tmp/pr.txt - echo -e "- This PR was built using the No-Compile-Needed.yml workflow, which was pointed to the ${{ env.BRANCH }} branch.\n" >> /tmp/pr.txt + echo -e "- This PR was built using the No-Compile-Needed.yml workflow, which was pointed to the ${{ inputs.branch || github.ref_name }} branch.\n" >> /tmp/pr.txt if [[ "${CHANGED_GITHUB_CONFIG_FILES}" != "" ]]; then echo -e "### Updated GitHub configuration files:" >> /tmp/pr.txt for file in ${CHANGED_GITHUB_CONFIG_FILES} @@ -401,12 +405,12 @@ jobs: echo -e "##\n- [x] This PR has no manifest .filelist changes. _(Package changes have neither added nor removed files.)_" >> /tmp/pr.txt fi echo -e "##\n### Run the following to get this pull request's changes locally for testing.\n\`\`\`bash" >> /tmp/pr.txt - echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ env.BRANCH }} crew update \\" >> /tmp/pr.txt + echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ inputs.branch || github.ref_name }} crew update \\" >> /tmp/pr.txt echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt cat /tmp/pr.txt [[ $DRAFT_PR == 'true' ]] && export PR_DRAFT_FLAG='-d' if [[ -z ${PR_NUMBER} ]]; then - PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "Build: ${{ env.BRANCH }} started at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + PR_NUMBER=$(gh pr create ${PR_DRAFT_FLAG} --reviewer chromebrew/active --title "Build: ${{ inputs.branch || github.ref_name }} started at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) else gh pr edit -F /tmp/pr.txt fi @@ -418,3 +422,5 @@ jobs: fi echo "PR_NUMBER is ${PR_NUMBER}" echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV" + # Trigger workflow run: + gh workflow run Unit-Test.yml ${PR_NUMBER} diff --git a/bin/crew b/bin/crew index 78db8fd6e..e8a53e823 100755 --- a/bin/crew +++ b/bin/crew @@ -1691,7 +1691,7 @@ def upload(pkg_name = nil, pkg_version = nil, gitlab_token = nil, gitlab_token_u # currently running architecture are saved locally. (This is used # by build workflows to make sure updated manifests get # uploaded.) - install_command(@pkg.name) + @device[:installed_packages].any? { |pkg| pkg[:name] == @pkg.name } ? reinstall_command(@pkg.name) : install_command(@pkg.name) end puts "\e[1A\e[KšŸŽ‰ Uploads complete for #{package}. šŸŽ‰\r\n".lightgreen end diff --git a/lib/const.rb b/lib/const.rb index 45d1ad019..e98ce4acc 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -4,7 +4,7 @@ require 'etc' require 'open3' OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0' -CREW_VERSION ||= '1.63.4' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION +CREW_VERSION ||= '1.63.6' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION # Kernel architecture. KERN_ARCH ||= Etc.uname[:machine] diff --git a/packages/mtools.rb b/packages/mtools.rb index 08f6f405a..9babdea87 100644 --- a/packages/mtools.rb +++ b/packages/mtools.rb @@ -3,7 +3,7 @@ require 'buildsystems/autotools' class Mtools < Autotools description 'Mtools is a collection of utilities to access MS-DOS disks from GNU and Unix without mounting them.' homepage 'https://www.gnu.org/software/mtools/' - version '4.0.47' + version '4.0.49' license 'GPL-3' compatibility 'aarch64 armv7l x86_64' source_url "https://ftpmirror.gnu.org/mtools/mtools-#{version}.tar.lz" @@ -11,9 +11,9 @@ class Mtools < Autotools binary_compression 'tar.zst' binary_sha256({ - aarch64: '41d6d66f37bd90245b560acd8aef124c26362058e47838c1969473641eb2ed45', - armv7l: '41d6d66f37bd90245b560acd8aef124c26362058e47838c1969473641eb2ed45', - x86_64: 'e469d2c99cdcc1757492b67032f60eeac0a21f622f46620c9234da13f2d616b3' + aarch64: '4782d387473bb5f49ee14aaedfeda9579e3b22479b20f9b9d33b05dce86a78fe', + armv7l: '4782d387473bb5f49ee14aaedfeda9579e3b22479b20f9b9d33b05dce86a78fe', + x86_64: '649e44c6ae13ab3834149702d321a6f23c09abcb49c703a6bf36420e99e652ad' }) depends_on 'glibc' # R