Bug 15856 - Using BR2_CONFIG= on a different file-system than O= (build outputs) fails with kconfig syncconfig error
Summary: Using BR2_CONFIG= on a different file-system than O= (build outputs) fails wi...
Status: RESOLVED WONTFIX
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2023.08.3
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-18 08:59 UTC by Ciprian Dorin Craciun
Modified: 2023-11-18 16:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ciprian Dorin Craciun 2023-11-18 08:59:15 UTC
If one has BuildRoot sources checked out on a file-system, but uses a build outputs folder on a different file-system (via `make O=...`) and one also specifies `BR2_CONFIG` on the first file-system (the one holding the sources), the `make syncconfig` target fails with an `*** Error during update of the configuration.` error.

`strace`-ing the `conf syncconfig` invocation leads me to the following conclusion:

* something in the build system (perhaps `kconfig`) creates temporary files in the parent folder of the configuration file (the one specified via `BR2_CONFIG`);

* but then it tries to move it inside the outputs folder with a simple `rename` syscall`;

* this fails because the rename is cross mount points;

The output of `strace` (here `/mnt/.../sources` where the sources and the config are is a different mount point than `/mnt/.../volatile` where the outputs are):
~~~~
rename("/mnt/.../sources/buildroot/!custom/.tmpconfig.h", "/mnt/.../volatile/buildroot/build/build/buildroot-config/autoconf.h") = -1 EXDEV (Invalid cross-device link)
~~~~
Comment 1 Arnout Vandecappelle 2023-11-18 16:17:17 UTC
> and one also specifies `BR2_CONFIG`

BR2_CONFIG is not something that is supposed to be overridden. It is supposed to reside in the same location as the output directory.

We will not accept patches that fix this specific problem you have.

What is your use case for putting the configuration file outside of the output directory? Perhaps we can find a better solution for this specific use case. However, please discuss this on the mailing list [1] rather than in the bug tracker.

[1] https://lists.buildroot.org/mailman/listinfo/buildroot