Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if(PROJECT_IS_TOP_LEVEL)
# NOTE: We mark the file optional since it's not required if the user happens to have the
# dependencies installed already.
set(CLP_CORE_DEPS_DIR "${CMAKE_SOURCE_DIR}/../../build/deps/cpp")
include("${CLP_CORE_DEPS_DIR}/cmake-settings/all.cmake"
include("${CLP_CORE_DEPS_DIR}/cmake-settings/all-core.cmake"
OPTIONAL
RESULT_VARIABLE CLP_DEPS_SETTINGS_FILE_PATH
)
Comment on lines +126 to 129

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Stop consuming settings from a shared dir; point to a component-specific subdirectory.

Parallel tasks still rm -rf the shared cmake-settings dir (see taskfiles), which can race and delete this file mid-build. Consume a namespaced file to eliminate cross‑component interference.

Apply:

-    include("${CLP_CORE_DEPS_DIR}/cmake-settings/all-core.cmake"
+    include("${CLP_CORE_DEPS_DIR}/cmake-settings/core/core.cmake"
             OPTIONAL
             RESULT_VARIABLE CLP_DEPS_SETTINGS_FILE_PATH
     )

Follow-up: adjust the Taskfile to write core/core.cmake (and spider/spider.cmake) and stop deleting the whole directory. Based on learnings

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
include("${CLP_CORE_DEPS_DIR}/cmake-settings/all-core.cmake"
OPTIONAL
RESULT_VARIABLE CLP_DEPS_SETTINGS_FILE_PATH
)
include("${CLP_CORE_DEPS_DIR}/cmake-settings/core/core.cmake"
OPTIONAL
RESULT_VARIABLE CLP_DEPS_SETTINGS_FILE_PATH
)
🤖 Prompt for AI Agents
In components/core/CMakeLists.txt around lines 126 to 129, the CMake include is
pulling a shared cmake-settings file that can be removed by parallel tasks;
change the include to point at a component-specific namespaced file (e.g.
replace cmake-settings/all-core.cmake with cmake-settings/core/core.cmake) so
each component consumes its own settings file; update the RESULT_VARIABLE usage
unchanged and then update the Taskfile separately to write core/core.cmake (and
spider/spider.cmake) instead of deleting the entire cmake-settings directory.

Expand Down
4 changes: 3 additions & 1 deletion taskfiles/deps/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ tasks:
- task: "yscope-dev-utils:cmake:install-deps-and-generate-settings"
vars:
CMAKE_SETTINGS_DIR: "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}"
CMAKE_SETTINGS_FILE: "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/all-core.cmake"
DEP_TASK: "core-all-parallel"
- task: "utils:combine-cpp-checksum-files"

Expand Down Expand Up @@ -105,7 +106,7 @@ tasks:
WORK_DIR: "{{.G_SPIDER_BUILD_DIR}}"
CMAKE_JOBS: "{{.G_CPP_MAX_PARALLELISM_PER_BUILD_TASK}}"
CMAKE_GEN_ARGS:
- "-C {{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/all.cmake"
- "-C {{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/all-spider.cmake"
- "-DCMAKE_BUILD_TYPE=Release"
- "-DCMAKE_INSTALL_MESSAGE=LAZY"
- "-DSPIDER_BUILD_TESTING=OFF"
Expand All @@ -121,6 +122,7 @@ tasks:
- task: "yscope-dev-utils:cmake:install-deps-and-generate-settings"
vars:
CMAKE_SETTINGS_DIR: "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}"
CMAKE_SETTINGS_FILE: "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/all-spider.cmake"
DEP_TASK: "spider-all-parallel"
- task: "utils:combine-cpp-checksum-files"

Expand Down
Loading