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: %generate_buildrequires should re-run until all dependencies are satisfied #276

Closed
hroncok opened this issue Jun 19, 2019 · 13 comments
Closed

Comments

@hroncok
Copy link
Contributor

hroncok commented Jun 19, 2019

rpm-software-management/rpm#755

%generate_buildrequires currently only runs once. it should loop until no new depndencies are needed.

To reproduce:

%generate_buildrequires
echo package1
if rpm -q package1 &>/dev/null; then echo package2; fi

Actual result:

Executing(%generate_buildrequires):
+ umask 022
+ cd /builddir/build/BUILD
+ echo package1
+ rpm -q package1
+ RPM_EC=0
BUILDSTDERR: ++ jobs -p
+ exit 0
package1
Wrote: /builddir/build/SRPMS/reproducer_dynbrs-0.0-1.fc31.buildreqs.nosrc.rpm
Child return code was: 11

(installs package1)

Executing(%generate_buildrequires):
+ umask 022
+ cd /builddir/build/BUILD
+ echo package1
+ rpm -q package1
+ echo package2
+ RPM_EC=0
BUILDSTDERR: ++ jobs -p
+ exit 0
package1
package2
Executing(%build):
...

Expected results:

Executing(%generate_buildrequires):
+ umask 022
+ cd /builddir/build/BUILD
+ echo package1
+ rpm -q package1
+ RPM_EC=0
BUILDSTDERR: ++ jobs -p
+ exit 0
package1
Wrote: /builddir/build/SRPMS/reproducer_dynbrs-0.0-1.fc31.buildreqs.nosrc.rpm
Child return code was: 11

(installs package1)

Executing(%generate_buildrequires):
+ umask 022
+ cd /builddir/build/BUILD
+ echo package1
+ rpm -q package1
+ echo package2
+ RPM_EC=0
BUILDSTDERR: ++ jobs -p
+ exit 0
package1
package2
Wrote: /builddir/build/SRPMS/reproducer_dynbrs-0.0-1.fc31.buildreqs.nosrc.rpm
Child return code was: 11

(installs package2)

Executing(%generate_buildrequires):
+ umask 022
+ cd /builddir/build/BUILD
+ echo package1
+ rpm -q package1
+ echo package2
+ RPM_EC=0
BUILDSTDERR: ++ jobs -p
+ exit 0
package1
package2
Executing(%build):
...
@hroncok
Copy link
Contributor Author

hroncok commented Jun 19, 2019

@praiskup
Copy link
Member

Well, we discussed this in original feature request
rpm-software-management/rpm#104 (comment),
but we didn't really found a real use-case to bother with calculating fixed
point. What is your real use-case?

@hroncok
Copy link
Contributor Author

hroncok commented Jun 19, 2019

My real use case is Python's two phased dependency resolution in PEP 517.

  1. First, dependencies and build backend are parsed from the pyproject.toml file.
  2. Second, a hook is called on the build backend to get the depndencies.

It could look like this:

  1. parse toml, get depndneices: flit, build backend: flit
  2. call flit.get_deps(), get: cython

Surely, without flit, we cannot get the information about cython. in order to make this work, we need to run the dependency check twice.

@praiskup
Copy link
Member

TBH I'm not familiar with that PEP; though it sounds like you don't need to iterate -- but (at most) two steps. Can flit be added to static build requires?

@hroncok
Copy link
Contributor Author

hroncok commented Jun 19, 2019

Yes, we need just two.

yes, flit can be added to static BRs to workaround this problem. It is not always flit, there are multiple backends (setuptools, flit, poetry...).

@xsuchy
Copy link
Member

xsuchy commented Jun 19, 2019

My main point is that I do not want to have - even potential - infinite loop. And detecting that installSrpmDeps do nothing is hard.
OK. Let's do more loops. Ten loops should be enough for everybody (I am sure this will be quoted with laughter one day).

@praiskup
Copy link
Member

constant? => config option :-)

@hroncok
Copy link
Contributor Author

hroncok commented Jun 19, 2019

will it do 10 loops by default or only if some packages are missing?

@xsuchy
Copy link
Member

xsuchy commented Jun 19, 2019

will it do 10 loops by default or only if some packages are missing?

only if some packages are missing. The constant is the upper limit.

@hroncok
Copy link
Contributor Author

hroncok commented Jun 19, 2019

Awesome!

@xsuchy xsuchy closed this as completed in af02efc Jun 24, 2019
@hroncok
Copy link
Contributor Author

hroncok commented Jul 2, 2019

only if some packages are missing. The constant is the upper limit.

with af02efc this is not true - not only it loops even when no new buildrequires are added, but it also does not stop after 10 runs.

@hroncok
Copy link
Contributor Author

hroncok commented Jul 2, 2019

#285

@xsuchy
Copy link
Member

xsuchy commented Jul 3, 2019

Nice catch - thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants