On Saturday, February 17, 2018 7:18:47 AM CET Jeff Johnson wrote:
> Contrarian examples are trivial to devise. Consider an autoconf based
> generated file that builds if (and only if) certain files are detected.
> None of those BuildRequires can be automated and generated during a spec
> file parse with a pipe/file redirection.

Understood, but (at least I hope) we aren't trying to find ultimate answer
for all packages/languages out there.  Some languages try to solve this
problem by having list of build requires set upstream, e.g. python:
https://packaging.python.org/specifications/declaring-build-dependencies/

We could also think of some heuristic which goes through extracted
upstream release tarball, and calculating "what is needed".  Packagers
would still have %prep for doing `rm` for particular parts of sources
which they don't want to build (which is good safety measure anyway, see
java packaging practices).

> The only solution (I can see) is an attempted build on a system with
> "everything" installed that then repeats with the BuildRequires:
> detected from the "everything" build.

Theoretically yes, but I don't think we have to go that far.  Btw. the set
of build-requires wouldn't be "constant" for each build of particular
package and that would be big -1 from me (at least if you consider
bootstrapping scenario where everything isn't completed yet).  Whatever
the calculated build-requires set would be, I wish it was constant for
each build, regardless of what's in buildroot at that time.

Maybe I'm missing the point of the issue (OP to decide), but I think this
has real and pretty trivial engineering solution for some languages:
- distribution provides heuristic for language Foo in foo-build package
- package Baz puts 'foo-build' into build requires
- package Baz adds "%build_requires --script %foo_analyzer" to declare
  that the buildsystem should attempt to generate build requires after
  %prep with %foo_analyzer script
- this brings new file/value in generated SRPM to let build-system know
- mock finds %build_requires section in SRPM, so it
  - does installroot + and installs BuildRequires as usually
  - runs %prep
  - runs %foo_analyzer from %build_requires
  - runs the rest of the build

In the stack it means:
- build system needs an easy way to split build process to two parts
  (there's --short-circuit, but packages created with this basically
  aren't installable)
- incompatible chnage, so build-systems need to be adjusted





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/104#issuecomment-366422836
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to