From 6282323b127341019e1c1d3fa8e924c373fbc70c Mon Sep 17 00:00:00 2001 From: Nomads_Reach <144523850+NomadsReach@users.noreply.github.com> Date: Sun, 16 Aug 2026 02:57:34 -0400 Subject: [PATCH] Reject prohibited artifacts during CMake staging --- cmake/stage_server.cmake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cmake/stage_server.cmake b/cmake/stage_server.cmake index dfbbd5d..2d590a5 100644 --- a/cmake/stage_server.cmake +++ b/cmake/stage_server.cmake @@ -41,6 +41,29 @@ if(NOT "${_preserve_admin_token}" STREQUAL "") file(WRITE "${_stage_admin_token}" "${_preserve_admin_token}") endif() +file(GLOB_RECURSE _prohibited_legacy_files + LIST_DIRECTORIES false + "${CO_SERVER_STAGE_DIR}/*.py" + "${CO_SERVER_STAGE_DIR}/*.pyw" + "${CO_SERVER_STAGE_DIR}/*.pyi" + "${CO_SERVER_STAGE_DIR}/*.pyc" + "${CO_SERVER_STAGE_DIR}/*.pyo" + "${CO_SERVER_STAGE_DIR}/*.whl" + "${CO_SERVER_STAGE_DIR}/*.egg" + "${CO_SERVER_STAGE_DIR}/requirements*.txt" + "${CO_SERVER_STAGE_DIR}/Pipfile" + "${CO_SERVER_STAGE_DIR}/Pipfile.lock" + "${CO_SERVER_STAGE_DIR}/pyproject.toml" + "${CO_SERVER_STAGE_DIR}/poetry.lock" + "${CO_SERVER_STAGE_DIR}/setup.py" + "${CO_SERVER_STAGE_DIR}/setup.cfg" + "${CO_SERVER_STAGE_DIR}/tox.ini" +) +if(_prohibited_legacy_files) + string(JOIN "\n " _prohibited_list ${_prohibited_legacy_files}) + message(FATAL_ERROR "Prohibited legacy runtime artifacts were staged:\n ${_prohibited_list}") +endif() + if(NOT EXISTS "${CO_SERVER_STAGE_DIR}/CommonwealthOnline.Server${CO_SERVER_EXECUTABLE_SUFFIX}") message(FATAL_ERROR "Failed to stage C# server entrypoint") endif()