cmake plugin: difficult to patch src using scriptlets
Metadata
Current evaluation
Closed without resolution. The cmake plugin incorrectly passes the source directory to cmake, preventing build-dir patching. The issue was abandoned, likely superseded by newer plugin architecture.
Suggested action: —
No scores available.
Issue body
During the build step, the cmake plugins calls cmake with the path to the src as the argument.
This is wrong. The src is copied to the build dir precisely to get the build step to run from the build dir.
What makes this worse is that if people run something with the prepare keyword that modifies the build dir, then cmake will ignore those modifications.
To reproduce:
$ cd integration_tests/snaps/cmake-hello
# Add this to the cmake part:
sed -i "s/CMake world/CMake build dir world/" test.c
$ snapcraft
$ bin/cmake-hello
# This should print the patched string: It's a CMake build dir world
# Instead, it prints the original
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The cmake plugin incorrectly passes the source directory to cmake, preventing build-dir patching. The issue was abandoned, likely superseded by newer plugin architecture. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or comments, indicating the issue was abandoned or superseded. No fix or merge was implemented. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1414 cmake plugin: call the cmake using build dir as source | snapcraft | closed | Closed without merging. The author abandoned the changes after review feedback noted cmake natively supports out-of-source builds, making the proposed in-source approach unnecessary. The linked bug remains open. | |
| #1770838 cmake plugin doesn't work properly | snapcraft (launchpad) | closed | Reported a cmake plugin bug causing duplicate CMAKE_INSTALL_PREFIX flags. The issue was closed without comments or a documented fix, leaving the configuration duplication unaddressed. |