mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[Build] Keep Windows installs free of build-tree artifacts (#7316)
* [Build] Keep Windows installs free of build-tree artifacts
Several Windows packaging gaps could leak Visual Studio CMake build
output into the installed application or the NSIS installer:
- The per-app DLL sweep used
${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}, which is
empty on multi-config generators, collapsing the recursive
DIRECTORY install into the whole build tree (containing *.dir,
*_autogen, .qt, .qsb, x64, ...). Point it at the real per-config
output with $<TARGET_FILE_DIR:...> and exclude build artifacts.
- install(FILES ${OPENSSL_INCLUDE_DIRS} ...) tried to install OpenSSL
include directories as files. CMake refuses this
("install FILES given directory"); it only slipped through CI
because the vcpkg OpenSSL config leaves the variable empty. Remove it;
fixup_bundle already ships the OpenSSL runtime DLLs.
- The NSIS uninstaller only deleted *.exe/*.dll and a few known files,
so build-tree leftovers survived an uninstall/reinstall cycle. Wipe
the whole directory tree instead.
- Add a Windows CI gate that lists the packaged installer with 7-Zip
and fails the build if any build-tree artifact path is found.
* Update .ci/compile.sh
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* [Build] Rework Windows installer artifact exclusions per review
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
This commit is contained in:
parent
b3c426cd43
commit
a5e94d8a4f
5 changed files with 74 additions and 20 deletions
|
|
@ -327,4 +327,32 @@ if [[ $MAKE_PACKAGE ]]; then
|
|||
BUILD_DIR="$BUILD_DIR" .ci/name_build.sh "$PACKAGE_SUFFIX"
|
||||
echo "::endgroup::"
|
||||
fi
|
||||
|
||||
if [[ $RUNNER_OS == Windows ]]; then
|
||||
echo "::group::Check installer for build-tree artifacts"
|
||||
cd "$BUILD_DIR"
|
||||
package="$(find . -maxdepth 1 -type f -name 'Cockatrice-*.exe' -print -quit)"
|
||||
if [[ ! $package ]]; then
|
||||
echo "::error file=$0::Could not find installer to inspect"
|
||||
exit 1
|
||||
fi
|
||||
seven_zip="$(command -v 7z || true)"
|
||||
if [[ ! $seven_zip ]]; then
|
||||
seven_zip="/c/Program Files/7-Zip/7z.exe"
|
||||
fi
|
||||
if [[ ! -f $seven_zip ]]; then
|
||||
echo "::warning file=$0::7-Zip not found, skipping installer content check"
|
||||
else
|
||||
echo "Inspecting $package"
|
||||
# Fail the build if the installer contains any path left behind by the MSBuild or
|
||||
# Qt AUTOMOC tooling (build-tree artifacts must live in the build dir, not the install)
|
||||
if "$seven_zip" l "$package" |
|
||||
grep -E "_autogen|\.dir[\\/]|\.tlog|(^|[\\/])x64[\\/]|(^|[\\/])\.qt[\\/]|(^|[\\/])\.qsb[\\/]|(^|[\\/])\.lupdate[\\/]|CMakeFiles"; then
|
||||
echo "::error file=$0::Installer contains build-tree artifacts"
|
||||
exit 1
|
||||
fi
|
||||
echo "Installer content is clean"
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue