Re: rawhide %{_buildrootdir} not expanded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



for the record:
It seems there are only a few packages using it:
https://sourcegraph.com/search?q=context:global+repo:%5Esrc.fedoraproject.org/+%25%7B_buildrootdir%7D&patternType=regexp&sm=0

--

Michal Schorm
Software Engineer
Core Services - Databases Team
Red Hat

--

On Tue, Jun 4, 2024 at 8:12 AM Panu Matilainen <pmatilai@xxxxxxxxxx> wrote:
>
> On 6/3/24 17:18, Eike Rathke wrote:
> > Hi Panu,
> >
> > On Monday, 2024-06-03 15:55:09 +0300, Panu Matilainen wrote:
> >
> >> %{_buildrootdir} is nothing packages should be referring to, in any
> >> circumstance really. It's a potentially shared directory among arbitrary
> >> packages (in the traditional it's ~/rpmbuild/BUILDROOT/ ) and putting
> >> anything there can conflict with other packages being built on the system.
> >> %{buildroot} is what packages should be referring to,
> >
> > So using %{buildroot} instead of %{_buildrootdir} would be an actual
> > replacement?
>
> Depends on the case. If, as I suspect below and you confirm in the other
> email this was never meant to be packaged, then %{buildroot} of course
> is not the right place.
>
> >
> >> or better yet, ${RPM_BUILD_ROOT}.
> >
> > Why better?
>
> In general, the RPM_* environment variables available to build
> scriptlets are what should be used instead of macros. Because, macros
> are processed while parsing the spec, which is different from actually
> *building* it. For one, using the environment improves srpm
> reproducibility because the local gunk like number of CPUs, the concrete
> path of %buildroot etc are only visible the scriptlets where actually used.
>
> It's a subtle thing, took me 10+ years with rpm to grok the
> recommendation I'd seen long, long, long ago.
>
> >
> >> That said, these cases kinda appear to be something not intended to be
> >> packaged at all, just "I need to put this file somewhere". That's one of the
> >> many use-cases we introduced the intermediate %builddir in 4.20, under which
> >> the %{buildroot} itself is.
> >
> > But that's _only_ available as of 4.20, so not in f39,f40, correct?
>
> Yes. The next best thing would be using %{_builddir}/%{buildsubdir}, aka
> $PWD of the build scriptlets, this is available in all rpm versions for
> packages using %setup.
>
>         - Panu -
>
> >    Eike
> >
> >
> > --
> > _______________________________________________
> > devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
> > To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> > Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> > List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
> > Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
> --
> _______________________________________________
> devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux