Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE OptionalBuildRequires #577

Closed
vries opened this issue Oct 19, 2018 · 6 comments
Closed

RFE OptionalBuildRequires #577

vries opened this issue Oct 19, 2018 · 6 comments
Assignees

Comments

@vries
Copy link
Contributor

vries commented Oct 19, 2018

Say I have a package A build with optional feature B, which depends on package B:
BuildRequires: B-devel

Now I find out that A doesn't work with B version >= x.

The simplest way to express this is to use:
BuildRequires: B-devel < x
but that makes the build fail for distros that have B >= x.

What I want is to enable B for distros where it works, and to disable it for distros where it doesn't work.

I have the option of mapping B version x to distro version y, and use:

%if 0%{distro_version} < y
BuildRequires:  B-devel
%endif

but I'd like to have an option to make this work without distro mapping.

So something along the lines of:
OptionalBuildRequires: B-devel < x
which works as BuildRequires but doesn't make the build fail if the package is not present.

@Conan-Kudo
Copy link
Member

You're basically asking for BuildRecommends?

@vries
Copy link
Contributor Author

vries commented Oct 22, 2018

You're basically asking for BuildRecommends?

You're referring to "BuildRecommends proposal". Thanks for pointing that out.

Indeed, that looks very similar.

There is a difference though: the BuildRecommends tag naming suggest that using the dependency is the desirable situation, and therefore the proposal adds options "--pedantic" (as well as "--quiet"), and generates an error with "--pedantic".

The OptionalBuildRequires tag expresses a take it or leave it approach, and would generate a note when not including the dependency, but would not result in an error.

So the difference is in policy of how to handle the absence of the dependency.

@ffesti ffesti added this to Needs triage in Ticket Review (Outdated) Mar 3, 2020
@pmatilai pmatilai moved this from Needs triage to Maybe in Ticket Review (Outdated) Mar 24, 2020
@pmatilai
Copy link
Member

There's a use-case here alright, but I've a feeling the solution is something quite different.

@ffesti
Copy link
Contributor

ffesti commented Mar 24, 2020

The issue here is that we do not actually want a weak dependency. The build should not depend on some package availability in the direct sense. We probably want to bind the dependency to something more robust.

@xsuchy
Copy link
Member

xsuchy commented Apr 9, 2020

We already have two possibilites how to handle this:

  1. DynamicBuildRequies https://fedoraproject.org/wiki/Changes/DynamicBuildRequires
  2. Bootstrap https://docs.fedoraproject.org/en-US/packaging-guidelines/#bootstrapping

@ffesti
Copy link
Contributor

ffesti commented Nov 15, 2023

As stated above we'd rather not have weak/optional BuildDependencies. Having predictable builds is a value on it's own. Closing.

@ffesti ffesti closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

5 participants