Re: [Rpm-maint] [rpm-software-management/rpm] Native support for separate build and source tree (aka vpath builds) (Discussion #2882)

2024-02-05 Thread Panu Matilainen
Good point wrt multiple build directories :+1: While we have native support for 
these kind of multiple variants builds via `RemovePathPostfixes` (which isn't 
used by vim or python in fedora, curl does though), having separate build and 
buildroot directories could make that easier to use.

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

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Native support for separate build and source tree (aka vpath builds) (Discussion #2882)

2024-02-02 Thread Panu Matilainen
Yeah I was aware Fedora is doing cmake builds in a vpath, but that's quite a 
different thing from having rpm natively support it.

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

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Native support for separate build and source tree (aka vpath builds) (Discussion #2882)

2024-02-02 Thread Vít Ondruch
Fedora already has [`%{_vpath_builddir}` 
macro](https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/macros.vpath)
 for such purpose. And 
[this](https://src.fedoraproject.org/rpms/ruby/c/cbe746e311d5dbfd9c6d42fdfc4147220c0ad791)
 is how I migrated Ruby to out-of-source build using this macro.

However, there is also need for more then one build dir. AFAIK 
[Python](https://src.fedoraproject.org/rpms/python3.12/blob/rawhide/f/python3.12.spec)
 does two builds, one optimized and second with debug information. 
[Vim](https://src.fedoraproject.org/rpms/vim/blob/rawhide/f/vim.spec) does 3 
different builds (and it would be probably better to use separate build dirs 
for them).

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

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Native support for separate build and source tree (aka vpath builds) (Discussion #2882)

2024-02-02 Thread Panu Matilainen
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-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint