Bug 1227304

Summary: open build service raises 'Failed build dependencies' when new BuildRequires tag added to the .spec file by the _service during runtime, instead installing build requirements
Product: [openSUSE] openSUSE.org Reporter: huakim tylyktar <fijik19>
Component: BuildServiceAssignee: E-mail List <screening-team-bugs>
Status: RESOLVED WORKSFORME QA Contact: Adrian Schröter <adrian.schroeter>
Severity: Major    
Priority: P5 - None CC: fijik19, mcepl
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: log file indicating what happened during build process

Description huakim tylyktar 2024-07-02 16:03:34 UTC
When i added code to _service, which formats .spec file adding BuildRequires tags at buildtime, futher build failes with 'Failed build dependencies', instead of installing these build dependencies
Comment 1 huakim tylyktar 2024-07-02 16:09:15 UTC
Created attachment 875834 [details]
log file indicating what happened during build process
Comment 2 Adrian Schröter 2024-07-02 16:46:45 UTC
yes, it is too late to do that at build time. The VM has no network and the dependencies can not pre-calculated.

Either do that in default mode, so the change gets commited to the source.

Alternative is to use dynamic build dependency implementation where another build job gets started in case dependencies are changing. That is a generic rpm feature, supported by OBS by respawning a new job. https://fedoraproject.org/wiki/Changes/DynamicBuildRequires


closing as works as designed.
Comment 3 huakim tylyktar 2024-07-02 19:55:43 UTC
(In reply to Adrian Schröter from comment #2)
> yes, it is too late to do that at build time. The VM has no network and the
> dependencies can not pre-calculated.
> 
> Either do that in default mode, so the change gets commited to the source.
> 
> Alternative is to use dynamic build dependency implementation where another
> build job gets started in case dependencies are changing. That is a generic
> rpm feature, supported by OBS by respawning a new job.
> https://fedoraproject.org/wiki/Changes/DynamicBuildRequires
> 
> 
> closing as works as designed.

But, maybe, we just need to add the feauture to order to respawn a new job before rpmbuild?
Comment 4 huakim tylyktar 2024-07-02 19:56:52 UTC
(In reply to huakim tylyktar from comment #3)
> (In reply to Adrian Schröter from comment #2)
> > yes, it is too late to do that at build time. The VM has no network and the
> > dependencies can not pre-calculated.
> > 
> > Either do that in default mode, so the change gets commited to the source.
> > 
> > Alternative is to use dynamic build dependency implementation where another
> > build job gets started in case dependencies are changing. That is a generic
> > rpm feature, supported by OBS by respawning a new job.
> > https://fedoraproject.org/wiki/Changes/DynamicBuildRequires
> > 
> > 
> > closing as works as designed.
> 
> But, maybe, we just need to add the feauture to order to respawn a new job
> before rpmbuild?

And, of course, with keeping generic rpm feauture.
Comment 5 Adrian Schröter 2024-07-03 06:47:41 UTC
this is already supported by OBS. It restarts the build when dependencies are changing.
Comment 6 huakim tylyktar 2024-07-04 12:41:04 UTC
(In reply to Adrian Schröter from comment #5)
> this is already supported by OBS. It restarts the build when dependencies
> are changing.

There are also error that prevent from building: 
unresolvable: nothing provides %{lua_module, nothing provides luarocks}, nothing provides devel}
The lua-module macro is provided in lua-rpm-macros package
I added lua-rpm-macros to project configuration
Comment 7 huakim tylyktar 2024-07-04 12:41:46 UTC
(In reply to huakim tylyktar from comment #6)
> (In reply to Adrian Schröter from comment #5)
> > this is already supported by OBS. It restarts the build when dependencies
> > are changing.
> 
> There are also error that prevent from building: 
> unresolvable: nothing provides %{lua_module, nothing provides luarocks},
> nothing provides devel}
> The lua-module macro is provided in lua-rpm-macros package
> I added lua-rpm-macros to project configuration

The .spec file contains line 
BulidRequires: %{lua_module}