Meson build error

  • ZXbatata123
    12th Aug 2021 Member 0 Permalink

    This Happen after executing meson build-debug

     

    Traceback (most recent call last):
    File "C:\Users\MSI\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "C:\Users\MSI\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
    File "C:\Users\MSI\AppData\Local\Programs\Python\Python39\Scripts\meson.exe\__main__.py", line 7, in <module>
    File "C:\Users\MSI\AppData\Local\Programs\Python\Python39\lib\site-packages\mesonbuild\mesonmain.py", line 318, in main
    setup_vsenv()
    File "C:\Users\MSI\AppData\Local\Programs\Python\Python39\lib\site-packages\mesonbuild\mesonmain.py", line 89, in setup_vsenv
    bat_info = json.loads(bat_json)
    File "C:\Users\MSI\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 341, in loads
    s = s.decode(detect_encoding(s), 'surrogatepass')
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0x87 in position 674: invalid start byte

  • LBPHacker
    12th Aug 2021 Developer 0 Permalink
    This happens when your Visual Studio install is wonky in some way and/or vswhere.exe returns something meson doesn't understand. Can you run the following command in the same prompt you tried to run meson build-debug in?
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -requiresAny -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -products * -format json | curl -F c=@- https://pybin.pwThis will output something like thisdate: 2021-08-12T04:38:51.333511+00:00
    digest: ...
    long: ...
    short: ...
    size: ...
    status: created
    url: ... # this is what I need!
    uuid: ...

    Post the url line in a comment here.
    Edited once by LBPHacker. Last: 12th Aug 2021
  • LBPHacker
    12th Aug 2021 Developer 0 Permalink
    Can you do the same after running chcp 65001? (It's possible that you'll get the same url, in which case it didn't work; you should post whatever url you get regardless.)
    Edited once by LBPHacker. Last: 12th Aug 2021
  • LBPHacker
    12th Aug 2021 Developer 0 Permalink
    If you open a new vs dev prompt and run chcp without the 65001, what do you get? And once you run it *with* the 65001, and then again without, what do you get then?
  • ZXbatata123
    12th Aug 2021 Member 0 Permalink

    what I understanded about the prompt type was that a dev prompt was the one on TPT dir and the new prompt isn't so here is the results

    new prompt :

    chcp : 850
    chcp 65001 : 65001

    dev prompt :

    chcp : 850

    chcp 65001 : 65001

  • LBPHacker
    12th Aug 2021 Developer 0 Permalink
    That's not what I asked for though. I wanted you to open a new dev prompt (as defined in the build guide, e.g. "x64 Native Tools Command Prompt for VS" or something), and run the following commands:

    chcp
    chcp 65001
    chcp

    But in order to save a comment roundtrip, I'll have you run these instead:

    chcp
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -requiresAny -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -products * -format json | curl -F c=@- https://pybin.pw
    chcp 65001
    chcp
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -requiresAny -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -products * -format json | curl -F c=@- https://pybin.pw

    This will of course output two of those pybin.pw urls, please post both of them. Note: chcp is a setting whose lifetime is limited to the lifetime of the prompt.
  • ZXbatata123
    12th Aug 2021 Member 0 Permalink

    1-what build guide?
    2-that new dev prompt you're talking about is a command prompt of windows or what? also how I open that one if isn't the one that comes with windows?


    if was the command prompt that comes with windows and I needed to execute it on TPT dir there's the result

     

    65001

    https://pybin.pw/sPgR

    65001

    65001

    https://pybin.pw/sPgR

     

    this is the complete list when I execute the long command

     

    date: 2021-08-12T17:38:26.976000+00:00
    digest: 36920faf3959cc7b404c4e2634446b63bab0f811
    long: ADaSD685Wcx7QExOJjREa2O6sPgR
    short: sPgR
    size: 2134
    status: already exists
    url: https://pybin.pw/sPgR

    Edited once by ZXbatata123. Last: 12th Aug 2021
  • LBPHacker
    12th Aug 2021 Developer 0 Permalink
    1 - the guide you're following
    2 - it is the command prompt that comes with windows, yes, but it comes with environment variables set up such that meson can find visual studio - don't worry, you seem to be using the correct one already

    So I'm a bit lost here, because your VS install is clearly not outputting information about itself in the format I expect after chcp'ing to 65001, but I'm not sure if this is something meson should be prepared for or not. In other words, it's possible that this is a meson bug, but also that it's a VS bug, I'm not yet sure. I'll have to ask around.