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

ci: add build toolchain and project on mac #601

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

jsarzy
Copy link
Contributor

@jsarzy jsarzy commented Feb 9, 2023

Description

Add build-toolchain workflow to build toolchain for macos host using github actions. Now it only includes i386 compiler and takes around 30 minutes to finish. Workflow can be triggered manually in Actions tab, but we can also run it weekly or biweekly. The result is artifact with toolchain.

Add nightly build on macos host for ia32-generic-qemu target that is triggered every 24 hours at 2 AM UTC+1. Toolchain is downloaded from the last build-toolchain workflow.

Also, for now, disable Azure SDK port on ia32-generic-qemu due to compile errors on macos. It requires more effort to make it compilable on mac.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@jsarzy jsarzy requested review from damianloew and nalajcie and removed request for damianloew February 10, 2023 10:25
Copy link
Member

@nalajcie nalajcie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

mkdir ~/toolchain-macos-i386
git rev-parse --short HEAD > ~/toolchain-macos-i386/git-version
cd phoenix-rtos-build/toolchain/
./build-toolchain.sh i386-pc-phoenix $HOME/toolchain-macos-i386/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add " everywhere where applicable (avoid errors on $HOME with spaces)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

uses: dawidd6/action-download-artifact@v2
with:
workflow: build-toolchain.yml
path: /Users/runner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be some GITHUB env variable? Is this value future-proof?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I use workspace dir

echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
echo "$(brew --prefix gnu-sed)/libexec/gnubin" >> $GITHUB_PATH

- name: Download toolchain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add TODO: download from github packages/releases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


- name: Build
run: |
TARGET=ia32-generic-qemu ./phoenix-rtos-build/build.sh clean all tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!!! do not build with clean !!!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, I moved TARGET to env

git rev-parse --short HEAD > ~/toolchain-macos-i386/git-version
cd phoenix-rtos-build/toolchain/
./build-toolchain.sh i386-pc-phoenix $HOME/toolchain-macos-i386/
rm -rf ~/toolchain-macos-i386/*.patch ~/toolchain-macos-i386/binutils-* ~/toolchain-macos-i386/gcc-*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe explicitly compress only toolchain-macos-i386/i386-pc-phoenix dir instead of removing other files (more future-proof)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

cd phoenix-rtos-build/toolchain/
./build-toolchain.sh i386-pc-phoenix $HOME/toolchain-macos-i386/
rm -rf ~/toolchain-macos-i386/*.patch ~/toolchain-macos-i386/binutils-* ~/toolchain-macos-i386/gcc-*
tar -C $HOME -cvf ~/toolchain-macos-i386.tar toolchain-macos-i386
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate comment why compression here is not needed / useless

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

matrix:
target: [ia32-generic-qemu]
include:
- toolchain: i386-pc-phoenix
Copy link
Contributor Author

@jsarzy jsarzy Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added toolchain to matrix. In future it will be easier to add other compilers.

@jsarzy jsarzy requested a review from nalajcie February 14, 2023 17:47
Add toolchain build workflow to build toolchain on macos host. It is
triggered by workflow dispatch event.
Add nightly build every 24 hours at 2 AM UTC+1 of ia32-generic-qemu
target on macos host.
Disable Azure SDK port on ia32-generic-qemu target due to compile
errors.

JIRA: CI-158
@jsarzy
Copy link
Contributor Author

jsarzy commented Mar 13, 2023

I'm converting to draft until toolchain building issues are investigated.

@jsarzy jsarzy marked this pull request as draft March 13, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants