Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When building nuttx-apps, CI Workflow checks out the Incorrect Branch of nuttx repo #14513

Open
1 task done
lupyuen opened this issue Oct 26, 2024 · 3 comments · May be fixed by #14518 or apache/nuttx-apps#2780
Open
1 task done
Assignees
Labels
Arch: all Issues that apply to all architectures OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working

Comments

@lupyuen
Copy link
Member

lupyuen commented Oct 26, 2024

Description / Steps to reproduce the issue

  1. When compiling the Release Branch of nuttx-apps, our CI Workflow nuttx-apps/build.yml checks out the Master Branch of nuttx repo, which is incorrect: {Bp-2655} examples: fix noteprint compile error  nuttx-apps#2770 (comment)

    the CI does not use the right branch
    modified: boards/arm/mps/mps3-an547/configs/ap/defconfig
    modified: boards/arm/mps/mps3-an547/configs/bl/defconfig
    we do not have those configs in releases/12.7

  2. This comes from the arm-05 log: https://github.com/apache/nuttx-apps/actions/runs/11518661640/job/32069572079#step:7:96

   Configuration/Tool: mps3-an547/bl,CONFIG_ARM_TOOLCHAIN_GNU_EABI
     Normalize mps3-an547/bl
   83d82
   < # CONFIG_NSH_DISABLE_WAIT is not set
   Saving the new configuration file
   On branch master
   Your branch is up to date with 'origin/master'.

   Changes not staged for commit:
     (use "git add <file>..." to update what will be committed)
     (use "git restore <file>..." to discard changes in working directory)
	   modified:   boards/arm/mps/mps3-an547/configs/bl/defconfig
  1. This happens because mps3-an547:bl doesn't exist in the releases/12.7 branch. (It exists in master)

  2. Fetch-Source Log shows that CI is indeed checking out the Master Branch of nuttx repo (instead of releases/12.7): https://github.com/apache/nuttx-apps/actions/runs/11518661640/job/32069568370#step:3:66

    /usr/bin/git checkout --progress --force -B master refs/remotes/origin/master
    
  3. Which might be caused by a typo in nuttx-apps/build.yml: https://github.com/apache/nuttx-apps/blob/master/.github/workflows/build.yml#L92

          - name: Checkout nuttx repo
            uses: actions/checkout@v4
            with:
              repository: apache/nuttx
              ref: ${{ steps.gittargets.outputs.os_ref }}
  4. The workflow above says we are checking out Branch os_ref. But os_ref is undefined! It's actually named name: https://github.com/apache/nuttx-apps/blob/master/.github/workflows/build.yml#L85

      Fetch-Source:
        runs-on: ubuntu-latest
        steps:
          - name: Determine Target Branches
              ...
              echo "name=$OS_REF" >> $GITHUB_OUTPUT
              echo "app_ref=$APPS_REF" >> $GITHUB_OUTPUT
  5. I propose to change name to os_ref:

              echo "os_ref=$OS_REF" >> $GITHUB_OUTPUT
              echo "app_ref=$APPS_REF" >> $GITHUB_OUTPUT
  6. Tracking back to the original code: It seems plausible that there's a typo: https://github.com/apache/nuttx/pull/9289/files

              echo ::set-output name=os_ref::$OS_REF
              echo ::set-output name=apps_ref::$APPS_REF

    Suspiciously became:

              echo "name=$OS_REF" >> $GITHUB_OUTPUT
              echo "app_ref=$APPS_REF" >> $GITHUB_OUTPUT
  7. Note the apps_ref vs app_ref. I patched it to apps_ref (which needs to be backported to releases/12.7 of nuttx-apps)

  8. In our Test Repo for nuttx-apps: Changing name to os_ref seems to work OK: https://github.com/lupyuen5/label-nuttx-apps/actions/runs/11528123257/job/32094821811#step:3:57

/usr/bin/git checkout --progress --force -B releases/12.7 refs/remotes/origin/releases/12.7

Hi @simbit18: Do you agree with my findings? Do you think it will cause issues in the NuttX Repo when we change name to os_ref? Thanks!

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

CI Workflow

NuttX Version

master

Issue Architecture

[Arch: all]

Issue Area

[Area: Other]

Verification

  • I have verified before submitting the report.
@lupyuen lupyuen added the Type: Bug Something isn't working label Oct 26, 2024
@github-actions github-actions bot added Arch: all Issues that apply to all architectures OS: Linux Issues related to Linux (building system, etc) labels Oct 26, 2024
@lupyuen lupyuen self-assigned this Oct 26, 2024
@lupyuen
Copy link
Member Author

lupyuen commented Oct 26, 2024

Update: We should never apply this fix to releases/12.7 of nuttx-apps. It will fail because the Newer CI Jobs don't exist in releases/12.7 of nuttx repo: arm64_01.dat, x86_64-01.dat, risc-v-03.dat, etc

+ /github/workspace/sources/nuttx/tools/testbuild.sh -A -N -R -S -j 4 -e '-Wno-cpp -Werror' testlist/arm64-01.dat
ERROR: No readable file exists at testlist/arm64-01.dat

https://github.com/lupyuen5/label-nuttx-apps/actions/runs/11528123257/job/32094855996#step:7:81

In Future: We should always backport the Latest CI Jobs tools/ci/testlist/*.dat to the releases branch. Right now things are a little messy because we're cutting GitHub Runners: #14376

lupyuen added a commit to lupyuen2/wip-nuttx that referenced this issue Oct 27, 2024
When compiling the Release Branch of `nuttx-apps`, our CI Workflow `build.yml` checks out the Master Branch of `nuttx` repo, which is incorrect. This happens due to a typo in `build.yml`: apache#14513

This PR fixes the typo in `build.yml` to checkout the correct branch of `nuttx` repo.
lupyuen added a commit to lupyuen2/wip-nuttx-apps that referenced this issue Oct 27, 2024
When compiling the Release Branch of `nuttx-apps`, our CI Workflow `build.yml` checks out the Master Branch of `nuttx` repo, which is incorrect. This happens due to a typo in `build.yml`: apache/nuttx#14513

This PR fixes the typo in `build.yml` to checkout the correct branch of `nuttx` repo.
@simbit18
Copy link
Contributor

Hi @lupyuen yes, I think so too that there is a typo due to this change github actions
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

maybe after coming out of the 30/10 tunnel it would be better to create a workflow release with everything (docker, macos, msys2 and msvc)
build_dev.yml -> development
release.yml -> release
what do you think ?

@lupyuen
Copy link
Member Author

lupyuen commented Oct 28, 2024

Thanks @simbit18! Yep let's reorg the CI Workflow after 30 Oct. I'm keen to hear your ideas, maybe you can share an outline of the proposed workflow? Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: all Issues that apply to all architectures OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working
Projects
None yet
2 participants