mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.65k stars 1.64k forks source link

error on debian: "TypeError: Can't instantiate abstract class GnuDynamicLinker with abstract method id" #8301

Open kamomil opened 3 years ago

kamomil commented 3 years ago

I use debian:

istributor ID:  Debian
Description:    Debian GNU/Linux bullseye/sid
Release:    testing
Codename:   bullseye

with python 3.9 I installed meson with pip3 install meson and when running meson build --reconfig I get:

root@guri:~/libcamera# meson build --reconfig
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/mesonbuild/mesonmain.py", line 140, in run
    return options.run_func(options)
  File "/usr/local/lib/python3.9/dist-packages/mesonbuild/msetup.py", line 253, in run
    app.generate()
  File "/usr/local/lib/python3.9/dist-packages/mesonbuild/msetup.py", line 154, in generate
    env = environment.Environment(self.source_dir, self.build_dir, self.options)
  File "/usr/local/lib/python3.9/dist-packages/mesonbuild/environment.py", line 545, in __init__
    self.coredata = coredata.load(self.get_build_dir())  # type: coredata.CoreData
  File "/usr/local/lib/python3.9/dist-packages/mesonbuild/coredata.py", line 1008, in load
    obj = pickle.load(f)
TypeError: Can't instantiate abstract class GnuDynamicLinker with abstract method id
dcbaker commented 3 years ago

I'm assuming this is with meson 0.56.2?

db-src commented 3 years ago

I am also seeing this, and it stops me from building gtk-doc and hence anything else that would depend on that. I am on meson 0.56.2. Advice on how to proceed would be appreciated. Thanks!

*** Checking out gtk-doc *** [8/24]
git remote set-url origin https://gitlab.gnome.org/GNOME/gtk-doc
git remote update origin
Fetching origin
warning: redirecting to https://gitlab.gnome.org/GNOME/gtk-doc.git/
git rebase origin/master
Current branch master is up to date.
*** Building gtk-doc *** [8/24]
ninja  
[0/1] Regenerating build files.
Traceback (most recent call last):
  File "/opt/jhbuilt/gnome/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 132, in run
    return options.run_func(options)
  File "/opt/jhbuilt/gnome/lib/python3.9/site-packages/mesonbuild/msetup.py", line 275, in run
    app.generate()
  File "/opt/jhbuilt/gnome/lib/python3.9/site-packages/mesonbuild/msetup.py", line 176, in generate
    env = environment.Environment(self.source_dir, self.build_dir, self.options)
  File "/opt/jhbuilt/gnome/lib/python3.9/site-packages/mesonbuild/environment.py", line 579, in __init__
    self.coredata = coredata.load(self.get_build_dir())  # type: coredata.CoreData
  File "/opt/jhbuilt/gnome/lib/python3.9/site-packages/mesonbuild/coredata.py", line 943, in load
    obj = pickle.load(f)
TypeError: Can't instantiate abstract class GnuDynamicLinker with abstract method id
FAILED: build.ninja 
/opt/jhbuilt/gnome/bin/meson --internal regenerate /home/daniel/jhbuild/checkout/gnome/gtk-doc /home/daniel/.cache/jhbuild/build/gtk-doc --backend ninja
ninja: error: rebuilding 'build.ninja': subcommand failed
*** Error during phase build of gtk-doc: ########## Error running ninja   *** [8/24]
dcbaker commented 3 years ago

Can you provide exact steps to reproduce? I'd like to fix this, but I cannot reproduce it.

keithbowes commented 3 years ago

Yeah, I just upgraded the distro I use (Mageia) and am getting the same problem in trying to recompile slurp, swayidle, wlroots, among others.

$ meson --reconfigure build
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mesonbuild/mesonmain.py", line 140, in run
    return options.run_func(options)
  File "/usr/lib/python3.8/site-packages/mesonbuild/msetup.py", line 253, in run
    app.generate()
  File "/usr/lib/python3.8/site-packages/mesonbuild/msetup.py", line 154, in generate
    env = environment.Environment(self.source_dir, self.build_dir, self.options)
  File "/usr/lib/python3.8/site-packages/mesonbuild/environment.py", line 542, in __init__
    self.coredata = coredata.load(self.get_build_dir())  # type: coredata.CoreData
  File "/usr/lib/python3.8/site-packages/mesonbuild/coredata.py", line 1008, in load
    obj = pickle.load(f)
TypeError: Can't instantiate abstract class GnuDynamicLinker with abstract methods id

Doing a meson --wipe build allows them to be built.

db-src commented 3 years ago

Thanks, wiping seems to work indeed. So it seems like some incompatibility between old/new Meson versions, as I hadn't been building the affected modules for months (via JHBuild).

I don't have more exact steps to reproduce than 'try jhbuild build SomeModule' though, I'm afraid. But perhaps the backtrace and the fact it seems to trigger when trying to regenerate build files from months ago, and fails on pickle.load, might hint at the cause.