Skip to content

gst-env: Fix creation of gdb-autoload dirs on Windows

bdir[1:] is supposed to convert /path/to/bdir to path/to/bdir which is only correct on UNIX. On Windows it will convert C:\path\to\bdir to :\path\to\bdir which is totally wrong.

Use pathlib instead, which makes it trivial to do the conversion using joinpath(*bdir.parts). Fixes:

Traceback (most recent call last):
  File "C:\\projects\\repos\\gst-build.git\\gst-env.py", line 444, in <module>
    env = get_subprocess_env(options, gst_version)
  File "C:\\projects\\repos\\gst-build.git\\gst-env.py", line 314, in get_subprocess_env
    python_dirs = setup_gdb(options)
  File "C:\\projects\\repos\\gst-build.git\\gst-env.py", line 158, in setup_gdb
    os.makedirs(autoload_path, exist_ok=True)
  File "c:\python38\lib\os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "c:\python38\lib\os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "c:\python38\lib\os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  [Previous line repeated 4 more times]
  File "c:\python38\lib\os.py", line 221, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\projects\\repos\\gst-build.git\\_build\\gdb-auto-load/:'

Merge request reports