Bug 110565 - scons-3 breaks libgl-xlib build
Summary: scons-3 breaks libgl-xlib build
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
Depends on:
Reported: 2019-04-30 11:47 UTC by Volker Wegert
Modified: 2019-09-18 20:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Volker Wegert 2019-04-30 11:47:31 UTC
Scons has been upgraded from 2.1.5 to 3.0.4 on my Gentoo system. After that, building libgl-xlib no longer worked; errors were

scons: Reading SConscript files ...
TypeError: a bytes-like object is required, not 'str':
  File "/var/tmp/portage/media-libs/mesa-18.3.6/work/mesa-18.3.6/SConstruct", line 47:
    ENV = os.environ,
  File "/usr/lib64/python3.6/site-packages/SCons/Environment.py", line 982:
    apply_tools(self, tools, toolpath)
  File "/usr/lib64/python3.6/site-packages/SCons/Environment.py", line 107:
  File "/usr/lib64/python3.6/site-packages/SCons/Environment.py", line 1789:
  File "/usr/lib64/python3.6/site-packages/SCons/Tool/__init__.py", line 296:
    self.generate(env, *args, **kw)
  File "/var/tmp/portage/media-libs/mesa-18.3.6/work/mesa-18.3.6/scons/gallium.py", line 219:
    env['gcc_compat'] = check_cc(env, 'GCC', 'defined(__GNUC__)')
  File "/var/tmp/portage/media-libs/mesa-18.3.6/work/mesa-18.3.6/scons/gallium.py", line 135:
    source.write('#if !(%s)\n#error\n#endif\n' % expr)
  File "/usr/lib64/python3.6/tempfile.py", line 483:
    return func(*args, **kwargs)
Checking for GCC ... 

I've been told to report this upstream since apparently this is an issue with the scons files. 
For reference, the Gentoo bug is https://bugs.gentoo.org/684790
Comment 1 Brian Paul 2019-04-30 14:04:51 UTC
From the Gentoo bug it looks like your command line was simply "scons libgl-xlib".

I'm testing with Scons 3.0.1 from Ubuntu 19.04.  I get something different:

$ scons libgl-xlib
scons: Reading SConscript files ...
Checking for GCC ...  yes
Checking for Clang ...  no
Checking for C header file xlocale.h... (cached) no
Checking for C header file endian.h... (cached) yes
Checking for C function strtod_l()... (cached) yes
Checking for C function strtof_l()... (cached) yes
Checking for C function timespec_get()... (cached) yes
Checking for X11 (x11 xext xdamage >= 1.1 xfixes glproto >= 1.4.13 dri2proto >= 2.8)... no
Checking for XCB (x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8)... no
Checking for XF86VIDMODE (xxf86vm)... no
Checking for DRM (libdrm >= 2.4.75)... no
Checking for Python Mako module (>= 0.8.0)... yes
warning: LLVM disabled: not building llvmpipe
scons: done reading SConscript files.
scons: Building targets ...
scons: *** Do not know how to make File target `libgl-xlib' (/home/brian/projects/mesa/libgl-xlib).  Stop.
scons: building terminated because of errors.

But, "scons -D" (build default targets) seems to proceed, but no libGL.so is produced at the end.  I'll try to dig into this as time permits.
Comment 2 Volker Wegert 2019-04-30 16:16:26 UTC
If you need any more info to help diagnose/reproduce the issue, please let me know.
# python --version
Python 3.6.5
Comment 3 Brian Paul 2019-04-30 17:20:54 UTC
OK, the problem on my end was just a few missing package dependencies for X.

I also installed SCons 3.0.4 and that seemed to work too.

I have python3 version 3.7.3.  I wonder if that's the difference.  Can you try upgrading your python?
Comment 4 GitLab Migration User 2019-09-18 20:19:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/936.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.