Error when compiling with MinGW

  • alinafea
    15th Feb 2022 Member 0 Permalink

    Hello everyone. I have an issue when compiling with MinGW. I've followed the wiki on how to compile to windows with MinGW. I've tried it and when I run "meson build-debug" in git bash I get this error:

     

    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\tqdm\std.py", line 339, in status_printer
    sys.stderr.flush()
    AttributeError: 'NoneType' object has no attribute 'flush'

    meson.build:86:1: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

     

    I've tried to fix it by upgrading meson and ninja but i still get that error.

     

    The full traceback if you need it :

     

    $ meson build-debug
    The Meson build system
    Version: 0.61.2
    Source dir: E:\Scripts And Shit\The-Powder-Toy-master
    Build dir: E:\Scripts And Shit\The-Powder-Toy-master\build-debug
    Build type: native build
    Project name: the-powder-toy
    Project version: the.cake.is.a.lie
    C compiler for the host machine: gcc (gcc 8.1.0 "gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0")
    C linker for the host machine: gcc ld.bfd 2.30
    C++ compiler for the host machine: c++ (gcc 8.1.0 "c++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0")
    C++ linker for the host machine: c++ ld.bfd 2.30
    Host machine cpu family: x86_64
    Host machine cpu: x86_64
    Downloading tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921 source from https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20211224205921/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20211224205921.zip
    Traceback (most recent call last):
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\mesonmain.py", line 146, in run
    return options.run_func(options)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\msetup.py", line 294, in run
    app.generate()
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\msetup.py", line 185, in generate
    self._generate(env)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\msetup.py", line 229, in _generate
    intr.run()
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 2549, in run
    super().run()
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 148, in run
    self.evaluate_codeblock(self.ast, start=1)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 173, in evaluate_codeblock
    raise e
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 189, in evaluate_statement
    return self.evaluate_if(cur)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 272, in evaluate_if
    self.evaluate_codeblock(i.block)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 173, in evaluate_codeblock
    raise e
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 166, in evaluate_codeblock
    self.evaluate_statement(cur)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 181, in evaluate_statement
    self.assignment(cur)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 566, in assignment
    value = self.evaluate_statement(node.value)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 179, in evaluate_statement
    return self.function_call(cur)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 454, in function_call
    res = func(node, func_args, kwargs)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 768, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 115, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 276, in wrapper
    return f(*nargs, **wrapped_kwargs)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 795, in func_subproject
    return self.do_subproject(args[0], 'meson', kwargs)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 836, in do_subproject
    subdir = r.resolve(subp_name, method)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\wrap\wrap.py", line 334, in resolve
    self.get_file()
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\wrap\wrap.py", line 398, in get_file
    path = self.get_file_internal('source')
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\wrap\wrap.py", line 560, in get_file_internal
    self.download(what, cache_path)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\wrap\wrap.py", line 535, in download
    dhash, tmpfile = self.get_data(srcurl)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\wrap\wrap.py", line 506, in get_data
    progress_bar = ProgressBar(bar_type='download', total=dlsize,
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\mesonlib\universal.py", line 1862, in __init__
    super().__init__(*args, **kwargs)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\tqdm\std.py", line 1107, in __init__
    self.sp = self.status_printer(self.fp)
    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\tqdm\std.py", line 339, in status_printer
    sys.stderr.flush()
    AttributeError: 'NoneType' object has no attribute 'flush'

    meson.build:86:1: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

  • LBPHacker
    15th Feb 2022 Developer 0 Permalink
    This is a Meson bug and should be reported!

    Jokes aside, what you probably want is downgrade meson, e.g. pip install -Iv meson==0.60.3
    Edited once by LBPHacker. Last: 15th Feb 2022
  • alinafea
    15th Feb 2022 Member 0 Permalink

    @LBPHacker (View Post)

     thanks for nothing ig

     

    EDIT : oops i didnt read the full thing

    Edited once by alinafea. Last: 15th Feb 2022
  • LBPHacker
    15th Feb 2022 Developer 0 Permalink
    Now, no guarantee that that will work. This is the first time I'm seeing that version of meson crash like that, and I can't reproduce it on linux, must be a windows thing. I'll have to investigate some more.
  • alinafea
    15th Feb 2022 Member 0 Permalink

    @LBPHacker (View Post)

    now i get a different error 

    File "C:\Users\ALFA\AppData\Local\Programs\Python\Python39-32\lib\site-packages\mesonbuild\mesonlib\universal.py", line 1419, in Popen_safe_legacy
    if sys.stderr.encoding:
    AttributeError: 'NoneType' object has no attribute 'encoding'

    (not the full traceback)

  • LBPHacker
    15th Feb 2022 Developer 0 Permalink
    Eh okay so we're not much better off. In the meantime, can you hop onto irc?
  • alinafea
    15th Feb 2022 Member 0 Permalink