-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Build): Fix "empty.c file not found" Error on Make v3.81 or Older (…
…#657) Co-authored-by: Sihyung Woo <[email protected]>
- Loading branch information
1 parent
8cfaec1
commit 31f54fe
Showing
8 changed files
with
214 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ jobs: | |
run: pip install -r .github/workflows/scripts/requirements.txt | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: Build_Examples | ||
- name: Build All Examples | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
run: | | ||
# This environment variable is required for the SBTs. | ||
|
@@ -184,3 +184,151 @@ jobs: | |
export MAXIM_PATH=$(pwd) | ||
python .github/workflows/scripts/build.py | ||
Regression_Test_Make_3_81: | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Update the submodules below, doing so here will convert ssh to https | ||
submodules: false | ||
fetch-depth: 0 | ||
ref: '${{ github.event.pull_request.head.ref }}' | ||
repository: '${{ github.event.pull_request.head.repo.full_name }}' | ||
|
||
- name: Install Make 3.81 | ||
run: | | ||
# Build and install Make version 3.81. | ||
cd $GITHUB_WORKSPACE | ||
ls -la | ||
wget https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | ||
tar -xvf make-3.81.tar.gz | ||
cd make-3.81 | ||
# Note: This patch is necessary to get make to build on Ubuntu-22.04. | ||
patch glob/glob.c $GITHUB_WORKSPACE/.github/workflows/patch/glob_patch.patch | ||
./configure --prefix=$GITHUB_WORKSPACE/make-3.81 | ||
make | ||
make install | ||
# Pre-prend 3.81 to path | ||
echo "$GITHUB_WORKSPACE/make-3.81/bin:$GITHUB_PATH" > $GITHUB_PATH | ||
make --version | ||
- name: Check Make Version | ||
run: | | ||
# If this fails, there is a setup issue with the workflow. | ||
VERSION_CHECK=$(make --version | grep 3.81) | ||
if [ ! "$VERSION_CHECK" ];then | ||
exit 2 | ||
fi | ||
- name: Check watch files | ||
id: check_watch | ||
run: | | ||
# Determine if we need to run the test | ||
RUN_TEST=0 | ||
# Always run test if a workflow_dispatch | ||
if [[ $GITHUB_EVENT_NAME == "workflow_dispatch" ]]; then | ||
RUN_TEST=1 | ||
fi | ||
# Check for changes made to these files | ||
WATCH_FILES="\ | ||
Build_Examples.yml \ | ||
.c \ | ||
.cpp \ | ||
.S \ | ||
.s \ | ||
.h \ | ||
.a \ | ||
.mk \ | ||
makefile \ | ||
Makefile" | ||
# Get the diff from main | ||
CHANGE_FILES=$(git diff --ignore-submodules --name-only remotes/origin/main) | ||
echo "Watching these locations and files" | ||
echo $WATCH_FILES | ||
echo "Checking the following changes" | ||
echo $CHANGE_FILES | ||
for watch_file in $WATCH_FILES; do | ||
for change_file in $CHANGE_FILES; do | ||
if [[ "${change_file,,}" == *"${watch_file,,}" ]]; then | ||
echo "Match found. Watch type: $watch_file, File: $change_file" | ||
RUN_TEST=1 | ||
fi | ||
done | ||
done | ||
# End the test early if there wasn't a significant change | ||
if [[ $RUN_TEST -eq 0 ]]; then | ||
echo "Skipping Build" | ||
else | ||
echo "Running Build" | ||
fi | ||
echo "RUN_TEST=$RUN_TEST" >> $GITHUB_OUTPUT | ||
- name: Install ARM GCC Toolchain (arm-none-eabi-gcc) | ||
uses: carlosperate/arm-none-eabi-gcc-action@v1 | ||
id: arm-none-eabi-gcc-action | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
with: | ||
release: '10.3-2021.10' # <-- The compiler release to use | ||
|
||
- name: Install RISCV GCC Toolchain (riscv-none-embed-gcc) | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
run: | | ||
# Install RISCV tools | ||
npm install --global xpm@latest | ||
TOOL_VER=10.2.0-1.2.1 | ||
xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@$TOOL_VER | ||
cp -r /home/runner/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc /home/runner/riscv-none-embed-gcc | ||
# Add riscv tools to path | ||
echo "/home/runner/riscv-none-embed-gcc/$TOOL_VER/.content/bin" >> $GITHUB_PATH | ||
- name: Install RISCV GCC Toolchain (riscv-none-elf-gcc) | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
run: | | ||
# Install RISCV tools (updated) | ||
npm install --global xpm@latest | ||
# https://www.npmjs.com/package/@xpack-dev-tools/riscv-none-elf-gcc | ||
TOOL_VER=12.2.0-3.1 | ||
xpm install --global @xpack-dev-tools/riscv-none-elf-gcc@$TOOL_VER | ||
cp -r /home/runner/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc /home/runner/riscv-none-elf-gcc | ||
# Add riscv tools to path | ||
echo "/home/runner/riscv-none-elf-gcc/$TOOL_VER/.content/bin" >> $GITHUB_PATH | ||
- name: Setup Python | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install packages | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
run: pip install -r .github/workflows/scripts/requirements.txt | ||
|
||
- name: Build PeriphDrivers and Hello_World | ||
if: ${{ steps.check_watch.outputs.RUN_TEST == '1' }} | ||
run: | | ||
# This environment variable is required for the SBTs. | ||
# It must be set to the absolute path inside the Github repo. | ||
export MAXIM_SBT_DIR=$(pwd)/Tools/SBT | ||
# Set MAXIM_PATH to limit warnings | ||
export MAXIM_PATH=$(pwd) | ||
python .github/workflows/scripts/build.py --projects Hello_World | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ jobs: | |
scopes: | | ||
Documentation | ||
Examples | ||
Build | ||
Tools | ||
BLE | ||
Boards | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- glob-old.c 2023-07-15 18:06:47.276205928 -0500 | ||
+++ glob.c 2023-07-15 18:08:24.256204829 -0500 | ||
@@ -207,7 +207,7 @@ | ||
#endif /* __GNU_LIBRARY__ */ | ||
|
||
|
||
-#if !defined __alloca && !defined __GNU_LIBRARY__ | ||
+#if !defined __alloca && defined __GNU_LIBRARY__ | ||
|
||
# ifdef __GNUC__ | ||
# undef alloca | ||
@@ -230,7 +230,7 @@ | ||
|
||
#endif | ||
|
||
-#ifndef __GNU_LIBRARY__ | ||
+#ifdef __GNU_LIBRARY__ | ||
# define __stat stat | ||
# ifdef STAT_MACROS_BROKEN | ||
# undef S_ISDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters