[Home]

Summary:ASTERISK-20362: res_asterisk_rtp: Fix build error when using parallel make
Reporter:Shaun Ruffell (sruffell)Labels:
Date Opened:2012-09-04 17:01:51Date Closed:2012-09-07 15:41:07
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:11.0.0-beta1 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-20815 Fix pjproject's build system to be tolerant of build errors and parallel building
Environment:Attachments:( 0) 0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch
( 1) 0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch
( 2) ASTERISK-20362.patch
Description:{noformat}

  Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN                                    
   in res_rtp_asterisk and chan_sip." [1].                                                        
                                                                                                             
   [1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517
                                                                                                               
   When compiling asterisk in parallel like:                                
       $ make -j 10                                                                                                  
                                                                                   
   It's possible to get errors like the following:                                  
                                                                                         
       .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator.  Stop.                
       make[4]: *** [depend] Error 2                                                                        
       make[3]: *** [dep] Error 1                                                                      
       make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2
       make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.                          
                                                                                   
{noformat}
Comments:By: Shaun Ruffell (sruffell) 2012-09-04 17:02:51.574-0500

Attaching 0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch which contains potential fix.

By: Timo Teräs (fabled) 2012-09-05 03:50:33.581-0500

I have the same bug. The patch does not work fully, as "make install" would now try to recompile res_asterisk_rtp and fail at it. Attached is the patch I use to workaround this.

By: Shaun Ruffell (sruffell) 2012-09-05 12:57:06.515-0500

Timo, erm...you're right. I did not run "make install" before attaching that patch. Hopefully you don't mind, but instead of using your patch I updated the original patch to fix the install target without creating the .stamp file.

How does this look to you?

By: Timo Teräs (fabled) 2012-09-06 00:11:52.316-0500

I have no strong opinion on the solution as long as the bug gets fixed :)

That said, thinking more, dependency on $(PJ_LIB_FILES) is good to have so we recompile things properly if something changes in the pjproject. I kinda liked the stamp to avoid calling the submake, but to validate that pjproject is up-to-date it's probably better to do it as your patch does.

So I think I'd be happier with your version than mine. Thanks.

By: Shaun Ruffell (sruffell) 2012-09-06 09:17:54.119-0500

Timo: Last night I dug into why pjproject couldn't be built in parallel and I [sent a patch to them|http://thread.gmane.org/gmane.comp.voip.pjsip/16206]. If the upstream pjproject doesn't have a problem with the patch I sent, then when this patch goes into Asterisk it can drop the '-j1' arguments to submake and eliminate a warning on the build in addition to speeding up the build further.

So these patches shouldn't quite be committed just yet.

By: David M. Lee (dlee) 2012-09-07 15:18:32.404-0500

Shaun: I think we'll go ahead and put in this patch to get parallel builds working. If/when your patch gets accepted upstream, we can simply drop the {{-j1}} in our {{Makefile}}.

By: Shaun Ruffell (sruffell) 2012-09-07 16:11:35.281-0500

Sounds good.