Repository navigation
parallel build: First set of fixes - #4854
Conversation
When invoking make -j2 arch-armada38x it tries to build both arch-arch-armada38x-6.1 and arch-arch-armada38x-7.0. This fails when hitting native/* dependencies as they must be built in sequence first, and only then switch to parallel for all arch-* requested. This issue was faced originally with make all-supported and fixed by calling first pre-build-native as needed. The change here addresses this to allow the same building process when multiple arch-* are passed by the user.
|
I think I've shaken out all the remaining bugs. Most of them occurred on a "virgin" tree wheras on an existing tree with pre-compile native and pre-downloaded distrib & toolchain it would not show. @publicarray if you have a few spare cycles can you give it a shot with variations such as from And perhaps also simply directly |
I was also able to build your branch by copying over all the mk/* files from this PR. Things seems to be looking good, thnx. I'll wait for a review to confirm all is still ok before merging. |
Many cross dependencies had uncessary COMPILE_TARGET that can be remove by using COMPILE_MAKE_OPTIONS. This has the benefit of call default compile target and thus using PARALLEL_MAKE flag to benefit from all CPU when compiling.
Aloow passing MAKEFLAGS to native compile which enable parallel building of all native dependencies, thus reducing compile time significantly.
|
@hgy59 and @publicarray I was able to make all possible I've applied to same to the BTW, python is now much faster to compile, that's including the native build ... :) |
| @@ -12,16 +12,16 @@ COMMENT = UnZip is an extraction utility for archives compressed in .zip format | |||
| LICENSE = http://infozip.sourceforge.net/license.html | |||
|
|
|||
| GNU_CONFIGURE = 1 | |||
There was a problem hiding this comment.
GNU_CONFIGURE = 1 is obsolete with CONFIGURE_TARGET = nop
There was a problem hiding this comment.
Good catch, I can indeed remove the GNU_CONFIGURE. Want me to fix the other ones while at it?
spksrc@spksrc-debian10:~/makeflags/spksrc$ grep GNU_CONFIGURE */*/Makefile | grep 1 | while read LINE; do FILE=$(echo $LINE | cut -f1 -d:); grep -q "CONFIGURE_TARGET = nop" $FILE && echo $FILE; done
cross/libcap/Makefile
cross/p7zip/Makefile
cross/ps3netsrv/Makefile
cross/redis/Makefile
cross/unzip/Makefile
There was a problem hiding this comment.
A ripgrep version, I could not help myself:
$ rg --pcre2 -U -l -g 'cross/*/Makefile' '^(?=[\s\S]*\bCONFIGURE_TARGET\s*=\s*nop\b)(?=[\s\S]*GNU_CONFIGURE\s*=\s*1)[\s\S]*$'
cross/p7zip/Makefile
cross/unzip/Makefile
cross/ps3netsrv/Makefile
cross/redis/Makefile
cross/libcap/MakefileThe regex is thanks to https://stackoverflow.com/questions/469913/regular-expressions-is-there-an-and-operator#469951
There was a problem hiding this comment.
Personally I would like to see more smaller PRs if possible. IMHO you can leave them
There was a problem hiding this comment.
agreed, l'll do a different PR to manage that instead.
There was a problem hiding this comment.
A ripgrep version, I could not help myself:
I so much need to learn to play with it :)
There was a problem hiding this comment.
@th0ma7 If you are interested in diving into alternatives like ripgrep, I recently found my 2nd favourite: fd an alternative to find and xh alternative httpie. For even more checkout: https://github.com/TaKO8Ki/awesome-alternatives-in-rust
|
Thanks for this 👍 And I apologise for merging something that coursed these issues. I knew there was a risk but not to this degree.(I did my tests and those did pass, must have been lucky packages) Sorry. I think If only one or two packages needed a not parallel flag I still would have accepted the earlier PR... This all started when I noticed compiling fish took too long 2.5 minutes as to less than a minute. |
|
@th0ma7 kind reminder to revert the |
| ENV += -u LDSHARED | ||
| ENV += -u MAKEFLAGS | ||
| ENV += -u PKG_CONFIG -u PKG_CONFIG_LIBDIR -u PKG_CONFIG_PATH | ||
| ENV := -u LDSHARED -u PKG_CONFIG -u PKG_CONFIG_LIBDIR -u PKG_CONFIG_PATH $(ENV) |
There was a problem hiding this comment.
I think += is easier to understand than :=. Any reason for this change?
There was a problem hiding this comment.
Reason is, all the -u must be always at first as otherwise it pseudo-silently fails. As such := becomes the only way to ensure that.
I'll add a comment in the code for this...
There was a problem hiding this comment.
Thanks
IMHO unset variables or along those lines sounds better, but it doesn't matter that much
There was a problem hiding this comment.
I'm not convinced, at least this wrong for Erlang. Both ENV += and ENV := work the same for this package. Only -u MAKEFLAGS was missing
There was a problem hiding this comment.
What needs to be happening for the later call is this:
env -u LDSHARED -u PKG_CONFIG -u PKG_CONFIG_LIBDIR -u PKG_CONFIG_PATH ...
But, as PARALLEL_MAKE was previously added to the environment prior to that, it becomes the first item in the list such as:
env PARALLEL_MAKE=max -u LDSHARED -u PKG_CONFIG -u PKG_CONFIG_LIBDIR -u PKG_CONFIG_PATH ...
And this ends-up throwing an error about the -u as unsetting variable needs to be first to the env call...
Question could then be, does PARALLEL_MAKE really needs to be part of $(ENV) or not? If not then we could switch back to += instead of :=. Although I don't recall the exact reason why it needed to be into $(ENV)... perhaps something worth investigating?
There was a problem hiding this comment.
Ah ok thanks for the explanation 👍 we can leave it with := then.
|
Is it just me or does busybox just appear to hang there. I think it's unrelated to this PR |
Honestly this was on my todo list since day 1. I'm glad it finally works... but it did took way too many cycles to get there (as usual I guess). Now lets hope there isn't too many bugs lefts, but considering the amount of packages that succesfully built I think we are good to go! |
It is unrelated, busybox fails to build on its own as it requires specific parameters. You must use a package that depends on it to successfully build it. |
|
Just updated my branch. LGTM now. |
|
Looking at the build logs we are not quite done yet unfortunately: https://github.com/SynoCommunity/spksrc/runs/3586108881
|
|
Well, minio didn't for DSM7 on master, @fgma is working on solving that. @publicarray on that, would it be possible to mark some package as broken so they stop being built and fails? |
|
I'm about to create a PR too, at least for java-11-openjdk |
I think fixing them, moving them to diyspk or removing them if they are no longer supported by us would do. But no I don't think disabling them is a good way to deal with this. |
|
Reviewing those PRs that address some of those packages was on my next thing to in my list. At the moment there is sickchill & salt I'm still working on reviewing. Honestly I think I'm going to spend time reviewing PRs for the foreseeable feature, we are getting close to 100 open PRs! |
|
Indeed there are way too many of them... Let me know where I can help (and I might as well just pick and choose). |
* Fix logging to PSTAT at all MAKELEVEL * PSTAT logging more specific with added [BEGIN] and [END] messages * Re-uses @publicarray fix for cmake * Move back to using cmake by default * Move libaom only to using ninja by default * When building multiple specific archs, force building native in sequence first (e.g. pre-build-native) * Make all possible cross/* to use default COMPILE_TARGET to allow parallel build * spk.mk: Add BEGIN-END flags along with SPK package name to pstat * compile.mk: Fix warning: -j2 forced in makefile * cmake.mk: Re-use solution from @publicarray * cross-cc.mk: Improve messaging for pstat output * spk.mk: Fix pre-build-native for multi-arch specific builds When invoking make -j2 arch-armada38x it tries to build both arch-arch-armada38x-6.1 and arch-arch-armada38x-7.0. This fails when hitting native/* dependencies as they must be built in sequence first, and only then switch to parallel for all arch-* requested. This issue was faced originally with make all-supported and fixed by calling first pre-build-native as needed. The change here addresses this to allow the same building process when multiple arch-* are passed by the user. * libaom: Force ninja, leave everything else default to cmake * busybox: Use ENV variable to allow using default COMPILE_TARGET * native.mk: Ensure undefined variables are always first with -u flag * cross/*: Remove all unnecessary COMPILE_TARGET Many cross dependencies had unnecessary COMPILE_TARGET that can be remove by using COMPILE_MAKE_OPTIONS. This has the benefit of call default compile target and thus using PARALLEL_MAKE flag to benefit from all CPU when compiling. * native/*: Remove all unnecessary COMPILE_TARGET Allow passing MAKEFLAGS to native compile which enable parallel building of all native dependencies, thus reducing compile time significantly. * native-env.mk: Add comment for undefined variables to be first
Motivation: Follow-up on parallel-build issues...
libaomonly to using ninja by defaultpre-build-native)cross/*to use defaultCOMPILE_TARGETto allow parallel build (bzip2,dropbear,lua,mpfr,mtproxy,node-exporter,p7zip,python3,python38,rtorrent,tcp_wrappers,udns, unzip)Linked issues: This should fix issue found in #4683
Checklist
all-supportedcompleted successfully