forked from SynoCommunity/spksrc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle unsupported builds in github build action (SynoCommunity#4029)
- move checks to spksrc.pre-check.mk - update build_status.sh to ignore errors due to unsupported builds - use synocommunity/spksrc for build status job to avoid access errors - ntopng: replace REQUIRED_DSM by UNSUPPORTED_ARCHS to allow build of armv7-1.2
- Loading branch information
Showing
11 changed files
with
132 additions
and
121 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 |
---|---|---|
@@ -1,20 +1,59 @@ | ||
#!/bin/bash | ||
# We do not terminate the build on errors as we want to build all packages. | ||
# | ||
# List the successfully built, the unsupported and the failed packages | ||
# by name an timestamp. | ||
# | ||
# We do not want to terminate the build on errors as we want to build all | ||
# packages. | ||
# Therfore failed builds are logged in the build error file defined by the | ||
# env variable $BUILD_ERROR_FILE | ||
# If this file exists and contains at least one line, we show here the content | ||
# of the file and exit with error. | ||
# Otherwise we show the other file containing the sucessfully built packages. | ||
# If this file exists and contains at least one line, we exit with error. | ||
# A special log file $BUILD_UNSUPPORTED_FILE contains known make errors that | ||
# are ignore here (unsupported ARCH or version of Toolchain) | ||
# Such packages are separately logged and removed from errors file. | ||
# | ||
# Variables: | ||
# BUILD_SUCCESS_FILE defines the name of the file with built packages | ||
# BUILD_UNSUPPORTED_FILE defines the name of the file with unsupported packages | ||
# BUILD_ERROR_FILE defines the name of the file with build errors | ||
# | ||
|
||
echo "" | ||
echo "BUILD STATUS" | ||
echo "" | ||
|
||
echo "SUCCESS:" | ||
if [ -f "${BUILD_SUCCESS_FILE}" ]; then | ||
cat "${BUILD_SUCCESS_FILE}" | ||
else | ||
echo "none." | ||
fi | ||
|
||
echo "" | ||
echo "UNSUPPORTED (skipped):" | ||
if [ -f "${BUILD_UNSUPPORTED_FILE}" ]; then | ||
cat "${BUILD_UNSUPPORTED_FILE}" | ||
if [ -f "${BUILD_ERROR_FILE}" ]; then | ||
# remove unsupported packages from errors: | ||
unsupported_packages=$(cat "${BUILD_UNSUPPORTED_FILE}" | grep -Po "\- \K.*:" | sort -u | tr '\n' '|' | sed -e 's/|$//') | ||
cat "${BUILD_ERROR_FILE}" | grep -Pv "\- (${unsupported_packages}) " > "${BUILD_ERROR_FILE}.tmp" | ||
rm -f "${BUILD_ERROR_FILE}" | ||
mv "${BUILD_ERROR_FILE}.tmp" "${BUILD_ERROR_FILE}" | ||
fi | ||
else | ||
echo "none." | ||
fi | ||
|
||
echo "" | ||
echo "ERRORS:" | ||
if [ -f "${BUILD_ERROR_FILE}" ]; then | ||
if [ $(cat "${BUILD_ERROR_FILE}" | wc -l) -gt 0 ]; then | ||
cat "${BUILD_ERROR_FILE}" | ||
echo "" | ||
echo "Please analyze the log file of the build job." | ||
echo "See log file of the build job to analyze the error(s)." | ||
echo "" | ||
# let build status job fail | ||
exit 1 | ||
fi | ||
fi | ||
if [ -f "${BUILD_SUCCESS_FILE}" ]; then | ||
cat "${BUILD_SUCCESS_FILE}" | ||
fi | ||
echo "none." | ||
echo "" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Common requirement checks | ||
|
||
# Check for build for generic archs, these are not supporting `require kernel`. | ||
ifneq ($(REQ_KERNEL),) | ||
ifneq (,$(findstring $(ARCH),x64 aarch64 armv7)) | ||
ifneq ($(BUILD_UNSUPPORTED_FILE),) | ||
$(shell echo $(date --date=now +"%Y.%m.%d %H:%M:%S") - $(NAME): Arch '$(ARCH)' cannot be used when REQ_KERNEL is set >> $(BUILD_UNSUPPORTED_FILE)) | ||
endif | ||
@$(error Arch '$(ARCH)' cannot be used when REQ_KERNEL is set) | ||
endif | ||
endif | ||
|
||
# Check whether package supports ARCH | ||
ifneq ($(UNSUPPORTED_ARCHS),) | ||
ifneq (,$(findstring $(ARCH),$(UNSUPPORTED_ARCHS))) | ||
ifneq (,$(BUILD_UNSUPPORTED_FILE)) | ||
$(shell echo $(date --date=now +"%Y.%m.%d %H:%M:%S") - $(NAME): Arch '$(ARCH)' is not a supported architecture >> $(BUILD_UNSUPPORTED_FILE)) | ||
endif | ||
@$(error Arch '$(ARCH)' is not a supported architecture) | ||
endif | ||
endif | ||
|
||
# Check minimum DSM requirements of package | ||
ifneq ($(REQUIRED_DSM),) | ||
ifeq (,$(findstring $(ARCH),$(SRM_ARCHS))) | ||
ifneq ($(REQUIRED_DSM),$(firstword $(sort $(TCVERSION) $(REQUIRED_DSM)))) | ||
ifneq (,$(BUILD_UNSUPPORTED_FILE)) | ||
$(shell echo $(date --date=now +"%Y.%m.%d %H:%M:%S") - $(NAME): DSM Toolchain $(TCVERSION) is lower than required version $(REQUIRED_DSM) >> $(BUILD_UNSUPPORTED_FILE)) | ||
endif | ||
@$(error DSM Toolchain $(TCVERSION) is lower than required version in Makefile $(REQUIRED_DSM)) | ||
endif | ||
endif | ||
endif | ||
|
||
# Check minimum SRM requirements of package | ||
ifneq ($(REQUIRED_SRM),) | ||
ifeq ($(ARCH),$(findstring $(ARCH),$(SRM_ARCHS))) | ||
ifneq ($(REQUIRED_SRM),$(firstword $(sort $(TCVERSION) $(REQUIRED_SRM)))) | ||
ifneq (,$(BUILD_UNSUPPORTED_FILE)) | ||
$(shell echo $(date --date=now +"%Y.%m.%d %H:%M:%S") - $(NAME): SRM Toolchain $(TCVERSION) is lower than required version $(REQUIRED_SRM) >> $(BUILD_UNSUPPORTED_FILE)) | ||
endif | ||
@$(error SRM Toolchain $(TCVERSION) is lower than required version in Makefile $(REQUIRED_SRM)) | ||
endif | ||
endif | ||
endif |
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