Bug 228127 - [PATCH] www/nginx: enable multiple jobs build
Summary: [PATCH] www/nginx: enable multiple jobs build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-10 18:45 UTC by Ivan Rozhuk
Modified: 2018-05-15 17:41 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (osa)


Attachments
multiple jobs build (695 bytes, patch)
2018-05-10 18:45 UTC, Ivan Rozhuk
no flags Details | Diff
multiple jobs build (1.34 KB, patch)
2018-05-10 22:13 UTC, Ivan Rozhuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2018-05-10 18:45:03 UTC
Created attachment 193245 [details]
multiple jobs build

Speedup nginx build.
Comment 1 Ivan Rozhuk 2018-05-10 22:13:26 UTC
Created attachment 193254 [details]
multiple jobs build
Comment 2 Sergey A. Osokin freebsd_committer freebsd_triage 2018-05-13 00:34:18 UTC
Hi there,

thanks for the patch.

Could you please provide a bit more details in this case.
If the change speed-up the port build, would you mind to provide some measures with and without your patch.

Thanks.
Comment 3 Ivan Rozhuk 2018-05-13 00:50:49 UTC
AMD Ryzen 2700x (8C16T)

env CCACHE_RECACHE=1 /usr/bin/time -h make -j1
	26.34s real		20.89s user		4.81s sys
env CCACHE_RECACHE=1 /usr/bin/time -h make
	6.81s real		31.52s user		9.08s sys


AMD 5350 (4C4T)

env CCACHE_RECACHE=1 /usr/bin/time -h make -j1
	2m13.05s real		1m53.30s user		19.42s sys
env CCACHE_RECACHE=1 /usr/bin/time -h make
	48.39s real		2m8.76s user		23.03s sys


Nginx port options on 2700x and 5350 not same.
I do not revert patch, just use -j1 for single thread/process build.
Comment 4 Sergey A. Osokin freebsd_committer freebsd_triage 2018-05-13 00:53:53 UTC
Have you tried to do a build with all third-party modules enabled?  Is there everything is OK or is there any issues?
Comment 5 Ivan Rozhuk 2018-05-13 01:01:21 UTC
Yes, I try.
~80% modules builds ok.
Other modules I do not try (too heavy deps) or they fail die to dep build fail or issues with libressl 2.7.

MODSECURITY - single process build, I do not touch pre-configure-MODSECURITY-on.
Comment 6 Sergey A. Osokin freebsd_committer freebsd_triage 2018-05-13 01:09:59 UTC
Cool, thanks for sharing that information.

I've just tried to build www/nginx-devel with your patch and `make' command, so I've got an issue with VOD third-party module:

--- objs/addon/filters/audio_encoder.o ---
/ports/www/nginx-devel/work/nginx-vod-module-1.23/vod/filters/audio_encoder.c:103:20: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER'
        encoder->flags |= CODEC_FLAG_GLOBAL_HEADER;             // make the codec generate the extra data
                          ^
/ports/www/nginx-devel/work/nginx-vod-module-1.23/vod/filters/audio_encoder.c:142:45: error: use of undeclared identifier 'CODEC_CAP_VARIABLE_FRAME_SIZE'
        if ((state->encoder->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) != 0)
                                                   ^
2 errors generated.

I've upgrade the third-part vod module version to 1.23 but the issue still exists.  So, we need to find a workaround to fix this before we apply your patch.
Comment 8 Ivan Rozhuk 2018-05-13 02:25:44 UTC
Try to build with all options without patch or with -j1 and you get same result - some things are broken.
Comment 9 Sergey A. Osokin freebsd_committer freebsd_triage 2018-05-13 03:05:40 UTC
I don't think I fully understand your recent message cause third-party vod module compiles well without your patch.
Comment 10 Sergey A. Osokin freebsd_committer freebsd_triage 2018-05-13 14:14:15 UTC
I've double checked the URLs you provided and I've found a workaround.
Will commit your patch with my updates soon.
Comment 11 commit-hook freebsd_committer freebsd_triage 2018-05-13 14:24:44 UTC
A commit references this bug:

Author: osa
Date: Sun May 13 14:24:21 UTC 2018
New revision: 469797
URL: https://svnweb.freebsd.org/changeset/ports/469797

Log:
  Speed-up the port's build by enable multiple jobs build.

  While I'm here update third-party vod module to recent 1.23 version.

  Bump PORTREVISION.

  PR:	228127

Changes:
  head/www/nginx-devel/Makefile
  head/www/nginx-devel/Makefile.extmod
  head/www/nginx-devel/distinfo
  head/www/nginx-devel/files/extra-patch-nginx-vod-module-config
  head/www/nginx-devel/files/extra-patch-vod-filters-audio_encoder.c
Comment 12 Sergey A. Osokin freebsd_committer freebsd_triage 2018-05-13 14:28:19 UTC
Hi Jochen,

I've just committed the patch for www/nginx-devel to speed its build.
I've reassigned this PR to you, so could you please take a look on it for the www/nginx port.

Thanks.
Comment 13 Ivan Rozhuk 2018-05-13 15:16:57 UTC
(In reply to Sergey A. Osokin from comment #9)

It can compile only if you system contain definition:
CODEC_FLAG_GLOBAL_HEADER
CODEC_CAP_VARIABLE_FRAME_SIZE
or if some ccache magic happen.

That is why I use:
env CCACHE_RECACHE=1 /usr/bin/time -h make
to avoid any cache effects.

This is required to be compatible with ffmpeg 4x:
CODEC_FLAG_GLOBAL_HEADER -> AV_CODEC_FLAG_GLOBAL_HEADER
CODEC_CAP_VARIABLE_FRAME_SIZE -> AV_CODEC_CAP_VARIABLE_FRAME_SIZE

Thanks!
Comment 14 commit-hook freebsd_committer freebsd_triage 2018-05-15 17:39:42 UTC
A commit references this bug:

Author: joneum
Date: Tue May 15 17:39:16 UTC 2018
New revision: 470039
URL: https://svnweb.freebsd.org/changeset/ports/470039

Log:
  Add third-party vts (virtual host traffic status) module. [1]

  Speed-up the port's build by enable multiple jobs build. [2]

  Upgrade third-party-module redis2 to version 0.15

  PR:		225833 [1], 228127 [2]

Changes:
  head/www/nginx/Makefile
  head/www/nginx/Makefile.extmod
  head/www/nginx/Makefile.options.desc
  head/www/nginx/distinfo
Comment 15 Jochen Neumeister freebsd_committer freebsd_triage 2018-05-15 17:41:32 UTC
(In reply to Sergey A. Osokin from comment #12)

Hey Sergey,

thanks for the hint. Committed. :-)