On 12/9/19 8:00 PM, Ken Moffat via blfs-dev wrote:
On Mon, Dec 09, 2019 at 03:40:24PM -0600, Douglas R. Reno via blfs-dev wrote:

On 12/9/19 2:22 PM, Alain Dumont via blfs-dev wrote:
Le 09/12/2019 à 20:20, Ken Moffat via blfs-dev a écrit :
On Mon, Dec 09, 2019 at 04:19:12PM +0100, Alain Dumont via blfs-dev
wrote:
Hi All,

In the instructions for Qtwebengine you propose to use the instruction
NINJAJOBS = x to avoid some problems.
This variable, defined in the Ninja patch of LFS collides with
the present
variable in ../src/core/gn_run.pro of the qtwebengine package,
which causes strange compilation errors.


Examples, please.

alain [ ~/Public/prog/unpack/qtwebengine-everywhere-src-5.13.2
]$ grep -R
NINJAJOBS *
src/core/gn_run.pro:    runninja.commands = $$NINJA $$ninjaflags
\$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore


I've used NINJAJOBS for several (5.12) builds on my laptop where I have
8 cores but less than 8GB RAM, and I haven't seen any errors from
setting this.

Looking at both 5.13.2 nd 5.12.6, the only reference is in 5.13.2,
as you show above.  But there is no indication of what one might
expect to see in that variable.

ĸen

That's why I propose to replace in the LFS patch of ninja, the variable
NINJAJOBS by NINJACORES.
Indeed, if we examine the patched function in the ninja source code,
this function calculates the number of processors by default
(cores) rather
than the number of jobs it can perform.
It therefore seems more judicious to call this variable
NINJACORES rather
than NINJAJOBS.


I found it useful to report this bug because I was a victim on one of my
machines (intel / 4 cores / 8GB ram).
Unable to compile QtWebEngine, I had to recompile Ninja by modifying the
patch to indicate NINJACORES.
This solved my problem. But now with my new Ninja suitably patched, I
can not reproduce this bug anymore.
I remember, however, that the error messages mentioned NINJAJOBS
explicitly, and it was precisely because of this that I was able to
identify the source of the problem.

Alain
I have encountered a different problem before with the variable
substitution. What happens is that, under "run_ninja:" in
src/core/Makefile.gn_run, it puts in "ninja -v 1" (assuming NINJAJOBS is set
to 1, which on my dual core systems is set), instead of "ninja -v -j 1".
However, I think this is a problem in QtWebEngine's build system and not
ninja. I don't know how to troubleshoot it further though, I've always just
modified it to allow it to function whenever it breaks.
--

Is this example the same thing ?

export NINJAJOBS=4

Very quickly after it has linked gn (the google build system)

Done. Made 11160 targets from 1593 files in 3475ms
make[3]: Entering directory 
'/tmp/qtwebengine-everywhere-src-5.13.2/build/src/core'
ninja -v 4 -C /tmp/qtwebengine-everywhere-src-5.13.2/build/src/core/release 
QtWebEngineCore
ninja: Entering directory 
`/tmp/qtwebengine-everywhere-src-5.13.2/build/src/core/release'
ninja: error: unknown target '4', did you mean 'c'?
                               ^

make[3]: *** [Makefile.gn_run:532: run_ninja] Error 1
make[3]: Leaving directory 
'/tmp/qtwebengine-everywhere-src-5.13.2/build/src/core'
make[2]: *** [Makefile:82: sub-gn_run-pro-make_first] Error 2
make[2]: Leaving directory 
'/tmp/qtwebengine-everywhere-src-5.13.2/build/src/core'
make[1]: *** [Makefile:78: sub-core-make_first] Error 2
make[1]: Leaving directory '/tmp/qtwebengine-everywhere-src-5.13.2/build/src'
make: *** [Makefile:49: sub-src-make_first] Error 2

I then tried 'export NINJAJOBS=j4', but similar result:

ninja: error: unknown target 'j4', did you mean 'qt'?

Ggogle is not very useful for NINJAJOBS (it found jobs for coding
Ninjas and the BLFS book), but there was a link to

https://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=432af50e930b7f11455fc1daec17d9c215ea88ee

Merge remote-tracking branch 'origin/5.13' into dev

which contains among many other changes:

diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro
index 9860c454..0219a2be 100644
--- a/src/core/gn_run.pro
+++ b/src/core/gn_run.pro
@@ -49,7 +49,7 @@ build_pass|!debug_and_release {
      ninjaflags = $$(NINJAFLAGS)
      isEmpty(ninjaflags):!silent: ninjaflags = "-v"
- runninja.commands = $$NINJA $$ninjaflags -C $$gn_build_root QtWebEngineCore
+    runninja.commands = $$NINJA $$ninjaflags \$\(NINJAJOBS\) -C 
$$gn_build_root QtWebEngineCore
      QMAKE_EXTRA_TARGETS += runninja
build_pass:build_all: default_target.target = all

Still no idea what their use of NINJAJOBS is intended for, but
perhaps we can just remove it (for 5.13.2 it appears to be
undocumented and nothing in qtwebengine sets it)

sed -i 's/\\\$\\(NINJAJOBS\\)//' src/core/gn_run.pro

With that, it seems to be building.

What I don't like about changing our NINJAJOBS to NINJACORES is that
for a period (certainly at least until a while after our _next_
release, we need to then put something in qtwebengine to point out
that we have changed this.  Assuming that the sed allows my build to
complete, I can put that into the _wiki_, but there is a lot of
scope for builds to fail.  And at some point I imagine the people at
qt will do something to use that variable.

I keep forgetting that qt stuff can be found at github.  Actually, I
think I deliberately forget that because it was such a pain to look
at (a lot seemeed to be in remotes, and I never managed to get the
whole thing to a consistent state where it would build).

That line was added by 3e9cf092689dc -

commit 3e9cf092689dcd85bf5a5709eab6cbd2785b42b8
Author: Michal Klocek <[email protected]>
Date:   Tue Feb 19 15:38:52 2019 +0100

     Add build time override of ninja jobs
Add sth like 'NINJAJOBS=-j20 make'. Helps to quickly investigate
     icecc issue without need to do qmake_all.
Change-Id: I7438e9cd1a2b15bcbc1a4790bbc4d6596c5c7abd
     Reviewed-by: Allan Sandfeld Jensen <[email protected]>


Ah, it needs -jN.  /me cancels the running build (the one with the
sed).

Using export NINJAJOBS=-j4 it is building.

So now the position appears to be:

if you have patched system ninja to use NINJAJOBS=N, for qtwebengine
you should change the value to NINJAJOBS=-jN.  Similarly,
NINJAJOBS=-jN should work even if you have not patched system ninja.

I'll let this build run, to be sure.

I suppose we could just add a note something like:

Unlike other packages which use ninja, qtwebengine now accepts
a specification for how many jobs to use, in environmant variable
NINJAJOBS.  But the value has to be in the -jN format, e.g
NINJAJOBS=-j2, unlike the form normally used with the patch which
LFS uses for ninja.

I might be over-thinking this, but I don't want to mention both
NINJAJOBS=-j2 and NINJAJOBS=2 in the that last sentence.

What if we just change qtwebengine:

sed -i 's/NINJAJOBS/NINJA_JOBS/' src/core/gn_run.pro

  -- Bruce



--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to