Skip to content

Commit

Permalink
Merge pull request #953 from AMDmi3/allow-disable-log-grepping
Browse files Browse the repository at this point in the history
Allow to disable grepping logs for failure reason
  • Loading branch information
bdrewery authored Dec 1, 2021
2 parents 164d012 + 068a878 commit 4ef8d40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/etc/poudriere.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,7 @@ DISTFILES_CACHE=/usr/ports/distfiles
# be fetched.
# Default: everything
#PACKAGE_FETCH_WHITELIST="gcc* rust llvm*"

# Grep build logs to determine a possible build failure reason.
# Default: yes
#DETERMINE_BUILD_FAILURE_REASON=yes
11 changes: 7 additions & 4 deletions src/share/poudriere/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5093,7 +5093,7 @@ build_pkg() {
local failed_status failed_phase
local clean_rdepends
local log
local errortype
local errortype="???"
local ret=0
local tmpfs_blacklist_dir
local elapsed now pkgname_varname jpkg originspec
Expand Down Expand Up @@ -5223,9 +5223,11 @@ build_pkg() {
# Symlink the buildlog into errors/
ln -s "../${pkgname}.log" \
"${log}/logs/errors/${pkgname}.log"
errortype=$(/bin/sh ${SCRIPTPREFIX}/processonelog.sh \
"${log}/logs/errors/${pkgname}.log" \
2> /dev/null)
if [ "${DETERMINE_BUILD_FAILURE_REASON}" = "yes" ]; then
errortype=$(/bin/sh ${SCRIPTPREFIX}/processonelog.sh \
"${log}/logs/errors/${pkgname}.log" \
2> /dev/null)
fi
badd ports.failed "${originspec} ${pkgname} ${failed_phase} ${errortype} ${elapsed}"
COLOR_ARROW="${COLOR_FAIL}" job_msg "${COLOR_FAIL}Finished ${COLOR_PORT}${port}${FLAVOR:+@${FLAVOR}} | ${pkgname}${COLOR_FAIL}: Failed: ${COLOR_PHASE}${failed_phase}"
run_hook pkgbuild failed "${port}" "${pkgname}" "${failed_phase}" \
Expand Down Expand Up @@ -8913,6 +8915,7 @@ fi
: ${FORCE_MOUNT_HASH:=no}
: ${DELETE_UNQUEUED_PACKAGES:=no}
: ${DELETE_UNKNOWN_FILES:=yes}
: ${DETERMINE_BUILD_FAILURE_REASON:=yes}
DRY_RUN=0
INTERACTIVE_MODE=0

Expand Down

0 comments on commit 4ef8d40

Please sign in to comment.