kbuild: stop modifying kconfigfile
Metadata
Current evaluation
Merged. The kbuild plugin copies the kconfigfile instead of using hard links, preventing unintended modifications to the source tree when combined with kconfigs. Resolves LP: #1786083.
Suggested action: —
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] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
If the `kconfigfile` option is supplied, the kbuild plugin uses a hard link to put it into place. This becomes problematic if `kconfigfile` is used alongside `kconfigs`, because doing so modifies the config file, thereby modifying the original `kconfigfile` in the source tree.
This PR fixes [LP: #1786083](https://bugs.launchpad.net/snapcraft/+bug/1786083) by copying the `kconfigfile` instead of using hard links.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. The kbuild plugin copies the kconfigfile instead of using hard links, preventing unintended modifications to the source tree when combined with kconfigs. Resolves LP: #1786083. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Replaced hard links with file copying in the kbuild plugin to prevent modifying the original kconfigfile when used with kconfigs, resolving LP: #1786083. Diff coverage reached 100%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Replaced hard links with file copies in the kbuild plugin to prevent modifying the original kconfigfile when used with kconfigs, resolving LP: #1786083. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1786083 kbuild plugin: kconfigfile is modified if kconfigs is supplied | snapcraft (launchpad) | closed | The kbuild plugin bug modifying the original kconfigfile when kconfigs is supplied was closed without a documented fix, indicating it was abandoned. No patches were merged to resolve the issue. | |
| #2202 plugins: kbuild: read configs from source directory instead | snapcraft | merged | Merged a kbuild plugin update to read configuration files from the source directory instead of the top-level directory. This fixes remote git repository builds by preventing local debian overrides. Approved, passed CI, and merged. |