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

Fix appveyor CI custom prereq build debug #2780

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ before_build:
set CHERE_INVOKING=yes
REM Start a 64 bit Mingw environment:
set MSYSTEM=MINGW64
C:\msys64\usr\bin\bash -lc "date -u; export MSYS2_PATH ; bash ./scripts/Windows/build-mingw-prereqs.sh"
C:\msys64\usr\bin\bash -lc "date -u; export MSYS2_PATH ; bash ./scripts/Windows/build-mingw-prereqs.sh -f"


build_script:
Expand Down
30 changes: 24 additions & 6 deletions scripts/Windows/build-mingw-prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,31 @@ provide_netsnmp() (
set +e
if [ x"$FORCE" = x"false" ] ; then
# TODO: Check version
if pkg-config --exists "$PKGCFG_NAME" ; then return 0 ; fi
if pkg-config --exists "$PKGCFG_NAME" ; then
echo "SKIP: pkg-config says '$PKGCFG_NAME' exists" >&2
return 0
fi

# Quickly install if prebuilt
if [ -d "${WSDIR}/${DEP_DIRNAME}/.inst" ]; then (
cd "${WSDIR}/${DEP_DIRNAME}/.inst" || exit
(command -v rsync) && $SUDO rsync -cavPHK ./ / && exit
$SUDO cp -pr ./ / && exit
exit 1
) && return 0
) && {
echo "INST: (re-)applied '${WSDIR}/${DEP_DIRNAME}/.inst'" >&2
return 0
}
fi

# no stashed .inst; any Makefile at least?
if [ -s "${WSDIR}/${DEP_DIRNAME}/Makefile" ]; then ( cd "${WSDIR}/${DEP_DIRNAME}" && $SUDO $MAKE install ) && return ; fi
if [ -s "${WSDIR}/${DEP_DIRNAME}/Makefile" ]; then (
cd "${WSDIR}/${DEP_DIRNAME}" && $SUDO $MAKE install
) && {
echo "INST: ran 'make install' from '${WSDIR}/${DEP_DIRNAME}'" >&2
return
}
fi

# Not pre-built, fall through
fi
Expand All @@ -113,20 +125,22 @@ provide_netsnmp() (
# Funny ways to fetch from Sourceforge help get the archive,
# not the download page... For some reason, this bites CI
# builds on Appveyor but not local runs:
echo "FETCH: ${DEP_ARCHIVE}..." >&2
( cd "$DLDIR" && curl -vL "https://sourceforge.net/projects/${DEP_PRJNAME}/files/${DEP_PRJNAME}/${DEP_VERSION}/${DEP_ARCHIVE}" > "${DEP_ARCHIVE}" ) || \
( cd "$DLDIR" && wget -c "https://sourceforge.net/projects/${DEP_PRJNAME}/files/${DEP_PRJNAME}/${DEP_VERSION}/${DEP_ARCHIVE}" -O "${DEP_ARCHIVE}" )

cd "${WSDIR}"
echo "BUILD: '${WSDIR}/${DEP_DIRNAME}'..." >&2
cd "${WSDIR}" || exit
rm -rf ${DEP_DIRNAME} || echo ""

tar xzf "$DLDIR/${DEP_ARCHIVE}" || exit
cd "./${DEP_DIRNAME}"
cd "./${DEP_DIRNAME}" || exit

yes "" | ./configure --prefix="$PREFIX" --with-default-snmp-version=3 \
--disable-agent --disable-daemon --with-sys-contact="" --with-sys-location="" \
--with-logfile=none --with-persistent-directory="${PREFIX}/var/net-snmp" \
--disable-embedded-perl --without-perl-modules --disable-perl-cc-checks \
--enable-shared || exit
--enable-shared || { cat config.log ; exit 1; }

$MAKE LDFLAGS="-no-undefined -lws2_32 -lregex -Xlinker --ignore-unresolved-symbol=_app_name_long -Xlinker --ignore-unresolved-symbol=app_name_long" || exit

Expand All @@ -139,10 +153,14 @@ provide_netsnmp() (
find ./ -type f -name "*.dll" -o -name "*.dll.a";

$SUDO $MAKE install
echo "INST: ran 'make install' from '${WSDIR}/${DEP_DIRNAME}'" >&2
)

prepareEnv || exit

echo "Prepared environment for $0:" >&2
set | grep -E '^(ARCH|PREFIX|PREFIX_ROOT|MAKE|MAKEFLAGS|SUDO|DLDIR|WSDIR|CFLAGS|CXXFLAGS|LDFLAGS|PKG_CONFIG_PATH|BUILD_FLAG|HOST_FLAG|MINGW_CHOST|MINGW_PREFIX|MSYS2_PATH)=' >&2

# TODO: Loop, params, help, etc...
# For now, let it pass "-f" to the builder
provide_netsnmp "$@"
Loading