plugins v2: add support for out of source tree builds
Metadata
Current evaluation
Merged PR #3392 (commit 21c486876) added an out_of_source_build property to PluginV2, skipping source copying and switching the Meson and CMake v2 plugins to out-of-tree builds.
Resolution: closed resolved
Reason: The pull request was merged into master as commit 21c486876, which added the out_of_source_build property to PluginV2 and updated the Meson and CMake plugins. The concept persists in the current codebase as the get_out_of_source_build() classmethod used by the ROS/colcon, kernel, and initrd plugins.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
This is intended as an alternative to PR #3347. It adds an `out_of_source_build` property to `PluginV2`, which is interpreted the same way it would be on `PluginV1` implementations, in that it disables the automatic copying of a part's source code to the build directory. The default implementation of the property is `plugin.out_of_source_build == False`.
To demonstrate that this works, I've ported the meson and cmake plugins to use this mode. For what it is worth, the cmake plugin was already configuring the build to use the copy of the source in `part_source_dir`, ignoring the copy in `part_build_dir`.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3392 (commit 21c486876) added an out_of_source_build property to PluginV2, skipping source copying and switching the Meson and CMake v2 plugins to out-of-tree builds. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3392 in commit 21c486876, adding PluginV2.out_of_source_build to skip source copying and enabling out-of-tree builds in the Meson and CMake plugins. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3392 added PluginV2.out_of_source_build to skip source copying and enabled out-of-tree builds for the Meson and CMake plugins. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3392, adding PluginV2.out_of_source_build to skip automatic source copying and enabling out-of-source builds for the meson and cmake plugins. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Introduces an out_of_source_build property to PluginV2, disabling automatic source copying. Applied to meson and cmake plugins, adjusted for consistency per review, and merged with 100% diff coverage. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to master. Adds an out_of_source_build property to PluginV2 to disable automatic source copying. The meson and cmake plugins were updated to use this feature, providing explicit control over build directory behavior. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
snapcore/snapcraft#3347
(confidence 60%)
PR body states #3392 was written as an alternative to #3347; the property later evolved into get_out_of_source_build() on parts plugins.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3391 plugins v2: port the qmake plugin | snapcraft | merged | Merged the qmake v2 plugin port in commit 28b59f41c, adding out-of-tree builds and qmake-project-file support after rebasing on #3392. | |
| #3405 [feature] ROS plugins v2 out of source tree builds | snapcraft | merged | Merged #3405 (commit c074de797), enabling ROS plugins v2 out-of-source builds so snapcraft.yaml can be placed in a ROS package root. | |
| #180 plugins: add meson plugin | craft-parts | merged | Merged PR #180 added Meson plugin support and fixed out-of-source-build handling. Changes landed in commit 228706de and were merged as a48ad0b9. |