From 1ea1a07dab252446ab4d1771fff2cbb359347f46 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 20 Jan 2025 16:58:24 +0000 Subject: [PATCH 1/4] appveyor.yml: force rebuild/reinstall of custom prereqs (TBD: disable later) Signed-off-by: Jim Klimov --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d6bc008257..4347285d9c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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: From 147ad154ce7fa3cdac34fba272681ea8d6a36003 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 20 Jan 2025 15:46:10 +0000 Subject: [PATCH 2/4] scripts/Windows/build-mingw-prereqs.sh: comment progression through the script (whether we skip a component as already installed, or we fetch/build/install it) - tarball/netsnmp [#1491] Signed-off-by: Jim Klimov --- scripts/Windows/build-mingw-prereqs.sh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/scripts/Windows/build-mingw-prereqs.sh b/scripts/Windows/build-mingw-prereqs.sh index 2a52391105..1fab193b52 100755 --- a/scripts/Windows/build-mingw-prereqs.sh +++ b/scripts/Windows/build-mingw-prereqs.sh @@ -90,7 +90,10 @@ 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 ( @@ -98,11 +101,20 @@ provide_netsnmp() ( (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 @@ -113,14 +125,16 @@ 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="" \ @@ -139,6 +153,7 @@ 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 From 911f5d40c02114be52a27b3374d8aac0d53bdae5 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 20 Jan 2025 21:13:09 +0100 Subject: [PATCH 3/4] scripts/Windows/build-mingw-prereqs.sh: if component "configure" script fails, print its config.log - tarball/netsnmp [#1491] Signed-off-by: Jim Klimov --- scripts/Windows/build-mingw-prereqs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Windows/build-mingw-prereqs.sh b/scripts/Windows/build-mingw-prereqs.sh index 1fab193b52..b5beeef442 100755 --- a/scripts/Windows/build-mingw-prereqs.sh +++ b/scripts/Windows/build-mingw-prereqs.sh @@ -140,7 +140,7 @@ provide_netsnmp() ( --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 From c58acc26b7d7eec61d24d04c795394292f139c39 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 21 Jan 2025 04:24:36 +0100 Subject: [PATCH 4/4] scripts/Windows/build-mingw-prereqs.sh: report the prepared environment variables - tarball/netsnmp [#1491] Signed-off-by: Jim Klimov --- scripts/Windows/build-mingw-prereqs.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/Windows/build-mingw-prereqs.sh b/scripts/Windows/build-mingw-prereqs.sh index b5beeef442..d3122e928a 100755 --- a/scripts/Windows/build-mingw-prereqs.sh +++ b/scripts/Windows/build-mingw-prereqs.sh @@ -158,6 +158,9 @@ provide_netsnmp() ( 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 "$@"