|
From: Vladimir S. <sa...@gm...> - 2020-03-11 05:01:48
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello Jonathan!</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I'm using latest scons installed by:</div>
<blockquote type="cite">
<div class="moz-cite-prefix">zypper rm scons3<br>
</div>
<div class="moz-cite-prefix">pip3 install --upgrade scons</div>
</blockquote>
<br>
<div class="moz-cite-prefix">Let me explain again why this line is
illegal.</div>
<div class="moz-cite-prefix">Let's look into SConstruct script. Here
we're detecting C++ flags to use for specific libraries:</div>
<div class="moz-cite-prefix">
<blockquote type="cite"> pkgs = {<br>
'libraw1394' : '2.0.5',<br>
'libiec61883' : '1.1.0',<br>
'libconfig++' : '0'<br>
}<br>
<br>
if env['REQUIRE_LIBAVC']:<br>
pkgs['libavc1394'] = '0.5.3'<br>
<br>
if not env['SERIALIZE_USE_EXPAT']:<br>
if conf.CheckPKG('libxml++-3.0'):<br>
pkgs['libxml++-3.0'] = '3.0.0'<br>
if not('libxml++-3.0' in pkgs):<br>
pkgs['libxml++-2.6'] = '2.13.0'<br>
</blockquote>
Then, we're saving these flags into environment variables:</div>
<div class="moz-cite-prefix">
<blockquote type="cite"> for pkg in pkgs:<br>
name2 =
pkg.replace("+","").replace(".","").replace("-","").upper()<br>
env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg,
pkgs[pkg] )<br>
print('%s_FLAGS = %s' % (name2, env['%s_FLAGS' %
name2].decode())) # This line added by me for debug<br>
if env['%s_FLAGS'%name2] == 0:<br>
allpresent &= 0<br>
</blockquote>
The code below outputs the line:</div>
<div class="moz-cite-prefix">
<blockquote type="cite">LIBRAW1394_FLAGS = -lraw1394</blockquote>
And then we're omitting these flags just by rewriting environment:</div>
<div class="moz-cite-prefix">
<blockquote type="cite">config_guess = conf.ConfigGuess()<br>
<br>
env = conf.Finish()<br>
</blockquote>
Then we call the nested src/SConstruct script:</div>
<div class="moz-cite-prefix">
<blockquote type="cite">subdirs=['src','libffado','support','doc']<br>
if env['BUILD_TESTS']:<br>
subdirs.append('tests')<br>
<br>
print("!!!!!!!! %s\n" % (env.Dump())) # Added by me for debug<br>
<br>
env.SConscript( dirs=subdirs, exports="env" )</blockquote>
The code shows that there is no LIBRAW1394_FLAGS variable in
environment more.</div>
<div class="moz-cite-prefix">And in src/SConstruct we try to reuse
it:
<blockquote type="cite">
<div class="moz-cite-prefix">libenv = env.Clone()</div>
<div class="moz-cite-prefix">#...</div>
<div class="moz-cite-prefix">if not env.GetOption( "clean" ):<br>
libenv.MergeFlags( "-lrt -lpthread" )<br>
libenv.MergeFlags( env['LIBRAW1394_FLAGS'].decode() ) #
BOOM!<br>
libenv.MergeFlags( env['LIBIEC61883_FLAGS'].decode() )<br>
libenv.MergeFlags( env['LIBCONFIG_FLAGS'].decode() )</div>
</blockquote>
Finally, the build crashes with error:</div>
<div class="moz-cite-prefix">
<blockquote type="cite">
<pre><code>KeyError: 'LIBRAW1394_FLAGS':
File "/home/sadko/tmp/lv2/ffado/libffado/SConstruct", line 925:
env.SConscript( dirs=subdirs, exports="env" )
File "/usr/lib/python3.6/site-packages/scons/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/lib/python3.6/site-packages/scons/SCons/Script/SConscript.py", line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/sadko/tmp/lv2/ffado/libffado/src/SConscript", line 287:
libenv.MergeFlags( env['LIBRAW1394_FLAGS'].decode() )
File "/usr/lib/python3.6/site-packages/scons/SCons/Environment.py", line 405:
return self._dict[key]</code></pre>
</blockquote>
</div>
<div class="moz-cite-prefix">Here's the related topic in SCons
github repository which was immediately closed by maintainers:</div>
<div class="moz-cite-prefix"><a class="moz-txt-link-freetext" href="https://github.com/SCons/scons/issues/3579">https://github.com/SCons/scons/issues/3579</a></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">So we have improperly working build
script with ridiculous behaviour.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">All the best</div>
<div class="moz-cite-prefix">Vladimir<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">11.03.2020 01:42, Jonathan Woithe
пишет:<br>
</div>
<blockquote type="cite"
cite="mid:202...@ma...">
<pre class="moz-quote-pre" wrap="">Hi Vladimir
On Wed, Mar 11, 2020 at 01:31:49AM +0300, Vladimir Sadovnikov wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Maybe we can get workaround here: detect version of python on a build stage
and form the right shebang string?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
David and I discussed this in the past. In the end we agreed that it was
probably more trouble than it was worth given that most distributions are
apparently fine with what we have. However, we could always revisit this if
the situation has changed.
I don't recall the details off-hand, but I recollect that some difficulties
were identified with this approach when discussed in the past.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Also please look at my another SCons-related email.
I believe there's a bug in SConstruct script which causes build to fail.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I've already followed up on list. I am curious to know whether David has
encountered a problem with that line. The applicable line hasn't been
reported to cause others any difficulties until now, and according to the
scons documentation it is valid (and even necessary).
What version of scons are you using? David has identified a number of bugs
in scons versions earlier than 3.1 when running under python3.
Regards
jonathan
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>
|