debian: add parallel processing for building#2579
debian: add parallel processing for building#2579The-going wants to merge 1 commit intoLinuxCNC:masterfrom
Conversation
|
Can you explain why this is needed, given this from dpkg-buildpackage(1): Should not the default handle this? |
|
The assembly takes place using a script in which there is such a string: # the standard error stream to the log file.
dpkg-buildpackage -b -us -j${NCPU_CHROOT:-2} 2>>\$LOG_OUTPUT_FILE
exit_status=\$?Before these changes, the assembly goes in one thread, although 6 is specified. |
|
It seems that the code is not universal. |
rule for linuxcnc: %:
dh $@
override_dh_auto_configure:
cd src && ./autogen.sh
cd src && PYTHON=/usr/bin/python3 ./configure \
--prefix=/usr --sysconfdir=/etc \
--mandir=/usr/share/man \
$(configure_realtime_arg) \
$(enable_build_documentation) \
--disable-check-runtime-deps
override_dh_auto_build-arch:
$(MAKE) PYTHON=/usr/bin/python3 -C src build-softwareThe default behavior is overridden and the output on the screen contains: But for htop: %:
dh $@
override_dh_auto_configure:
echo "MAKE=$(MAKE)"
dh_auto_configure -- \
--enable-openvz \
--enable-vserver \
--enable-unicode \
$(ARCH_DEPENDENT_CONFIGURE_PARAMS)The debugging code shows the value of the MAKE variable: make[1]: Entering directory '/root/build/htop-3.2.2'
echo "MAKE=/usr/bin/make"
MAKE=/usr/bin/make
dh_auto_configure -- \
--enable-openvz \
--enable-vserver \
......
make[1]: Leaving directory '/root/build/htop-3.2.2'
dh_auto_build
make -j6
make[1]: Entering directory '/root/build/htop-3.2.2'
make all-amThe default behavior is executed. |
Pass the parallel operation parameter to the make command if it is present in the calling dpkg-buildpackage
|
In the latter case, the behavior will be as follows: https://github.com/LinuxCNC/linuxcnc/actions/runs/5521735159/jobs/10070283186?pr=2579#step:7:4065 |
What do you mean by 'the code' here? |
|
|
[The-going]
`/usr/share/dpkg/buildopts.mk` file is not exist in debian:buster
I extracted the code from this file and wrote it in the debian rules
Right, got it.
The change look good to me, and might speed up build while increasing
the load of our build hosts. It will howevery require the manual pages
to be free of race conditions. I hope we are there already, but never
checked. Hopefully the end result is a win-win situation. :)
Did you check how this affected build times on github?
…--
Happy hacking
Petter Reinholdtsen
|
This pull request was going into two threads, as it is specified. And the build time corresponds to the time of my desktop machine. |
@petterreinholdtsen Did you mean this page? or P.S: ........
debian/rules override_dh_auto_build-indep
make[1]: Entering directory '/root/build/linuxcnc-2.9.0'
/usr/bin/make -j6 PYTHON=/usr/bin/python3 -C src manpages
make[2]: Entering directory '/root/build/linuxcnc-2.9.0/src'
make[2]: Nothing to be done for 'manpages'.
....... |
|
After watching the build process and reading the source code, I realized that not everything is as clear as it seemed at the very beginning. To properly parallelize the build process, changes are needed at earlier stages. I think I can do it in a rather elegant way. I will wait a few days in case someone wants to leave hints or recommendations and then close this pull request. |
|
[The-going]
> It will howevery require the manual pages to be free of race conditions.
@petterreinholdtsen Did you mean this page?
Nope, I just mistyped. I mean it might need manual _changes_ to get rid
of race conditions in the build system.
To properly parallelize the build process, changes are needed at
earlier stages.
What early stage do you have in mind here?
Note, I believe your change should go in, but suspect more changes might
be needed to take full advantage of it.
…--
Happy hacking
Petter Reinholdtsen
|
From my observations of the build process in this pull request: override_dh_auto_build-arch:
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src build-softwareThis section is working correctly. In my case This section works strangely: override_dh_auto_build-indep:
ifneq "$(enable_build_documentation)" ""
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src manpages
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src translateddocs
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src docs
endifThis line doesn't work because it's already done: So that this can be parallelized and at the same time ensure the assembly But it will take extra time. Info: |
|
[The-going]
This section works strangely:
```make
override_dh_auto_build-indep:
ifneq "$(enable_build_documentation)" ""
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src manpages
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src translateddocs
$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src docs
endif
```
This line doesn't work because it's already done:
`$(MAKE) $(PARALLEL) PYTHON=/usr/bin/python3 -C src manpages`
Next comes the work for a separate language and document in one stream
and the assembly of the final pdf document in several parallel
streams.
Right. I can imagine the dependencies are not quite right for the docs
and translations. The man pages need to be generated before PO and POT
files are processed (translateddocs), to ensure the generated man pages
can be translated.
So that this can be parallelized and at the same time ensure the
assembly of a single document for the target language in one stream,
the assembly algorithm can be changed. To do this, I need to work with
Makefile, submakefile. It is this earlier stage that I had in mind.
Make sense to me. :)
But it will take extra time.
Thank you for looking at this. :)
--
Happy hacking
Petter Reinholdtsen
|
Do you mean this when you wrote that the In my work I am guided by the documentation: Debian New Maintainers' Guide The dh_make command generated the following: DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mkWe have this part looks like this: Line 16 in 38943cf This is the first mistake. Not all necessary variables will be exported and they have to be explicitly specified. Lines 59 to 66 in 38943cf Only 62 and 64 lines will be executed here. But all these actions already exist in the Makefile, and it seems strange. .... @petterreinholdtsen |
Pass the parallel operation parameter to the make command if it is present in the calling dpkg-buildpackage