rpmbuild traditionally builds in the same directory where it unpacks the 
sources. Probably at least in part because in the nineties anything else was 
considered fancy pants that few projects supported. Apart from hand-rolled 
makefiles, these days the situation is almost the opposite: any sane build 
system wants the build artifacts anywhere else but mixed in the source tree. 
Rpm should (better) support that natively somehow.

Whatever we do has to remain compatible with the existing mass of specs out 
there, so for traditional use it needs to be an opt-in thing, which kinda 
defeats the purpose. But with [declarative 
builds](https://github.com/rpm-software-management/rpm/issues/1087) we have a 
sort of fresh start where it may well be possible to set default the other way 
around, and have buildsystems support it from the start. Combine that with 
https://github.com/rpm-software-management/rpm/issues/1087 will allow builds 
completely outside the source directory, which has nice qualities like allow 
building from a read-only source-tree. There would need to be an opt-in to 
build in the source directory though, because that's the only thing some 
projects still support.

Maybe this would be something like a new %setup switch that after source 
preparation, creates and cd's to the *build* directory and sets that as the 
%{buildsubdir}. There would need to be a separate %{sourcesubdir} then for the 
unpackaged source, which in the traditional setup would be the same as 
%{buildsubdir} as a kind of special case that can be easily detected. Any new 
buildsystem macro sets would be encouraged to default to separate directories. 
This doesn't actually require 
https://github.com/rpm-software-management/rpm/issues/1087 either - until that 
is in place the new setup directive could just use a subdirectory inside 
(rather than outside) buildsubdir. 

Thoughts, comments?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2882
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/2...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to