Skip to content

ci: add build toolchain and project on mac#601

Draft
jsarzy wants to merge 1 commit into
masterfrom
jsarzy/build-mac
Draft

ci: add build toolchain and project on mac#601
jsarzy wants to merge 1 commit into
masterfrom
jsarzy/build-mac

Conversation

@jsarzy

@jsarzy jsarzy commented Feb 9, 2023

Copy link
Copy Markdown
Contributor

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

@nalajcie nalajcie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🥇

Comment thread .github/workflows/build-toolchain.yml Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread .github/workflows/nightly.yml Outdated
uses: dawidd6/action-download-artifact@v2
with:
workflow: build-toolchain.yml
path: /Users/runner

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread .github/workflows/nightly.yml Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread .github/workflows/build-toolchain.yml Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread .github/workflows/build-toolchain.yml Outdated
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
Copy Markdown
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
Copy Markdown
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

@jsarzy jsarzy Feb 14, 2023

Copy link
Copy Markdown
Contributor Author

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
jsarzy force-pushed the jsarzy/build-mac branch from 3cdc62f to 267ae6c Compare March 13, 2023 12:19
@jsarzy

jsarzy commented Mar 13, 2023

Copy link
Copy Markdown
Contributor Author

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.

2 participants