Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/core-all.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}}/core-all.cmake"
DEP_TASK: "core-all-parallel"
- task: "utils:combine-cpp-checksum-files"

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Optional: verify no remaining references to the old shared file.

Run:

Also applies to: 125-127


🏁 Script executed:

#!/bin/bash
# Confirm all generation/consumption uses component-specific files.
rg -nP -C2 '\bcore-all\.cmake|\bspider-all\.cmake'
rg -nP -C2 '/cmake-settings/all\.cmake'

Length of output: 1624


Replace remaining references to old shared CMake settings files

  • taskfiles/deps/main.yaml (lines 49, 109, 125–127) still reference core-all.cmake and spider-all.cmake.
  • components/core/CMakeLists.txt (line 126) still includes cmake-settings/core-all.cmake.
    Update each to use the new component-specific CMake settings file.
🤖 Prompt for AI Agents
In taskfiles/deps/main.yaml around lines 49, 109, 125–127 and
components/core/CMakeLists.txt at line 126, update any references to the old
shared CMake settings files (core-all.cmake and spider-all.cmake) to point to
the new component-specific settings files (e.g., core.cmake or spider.cmake).
Concretely, change CMAKE_SETTINGS_FILE entries and any DEP_TASK or task names
that reference the shared files to use the corresponding component-specific
filename and update the include path in components/core/CMakeLists.txt from
cmake-settings/core-all.cmake to the new cmake-settings/core.cmake. Ensure all
remaining occurrences across the listed lines are replaced consistently.


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}}/spider-all.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}}/spider-all.cmake"
DEP_TASK: "spider-all-parallel"
- task: "utils:combine-cpp-checksum-files"

Expand Down