Skip to content

CMake subproject: "OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect" #7986

@CoffeeFlux

Description

@CoffeeFlux

Describe the bug
Attempting to build wxWidgets via a CMake subproject on my Aegisub Meson port provides the following stack trace:

Traceback (most recent call last):
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\mesonmain.py", line 140, in run
    return options.run_func(options)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\msetup.py", line 253, in run
    app.generate()
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\msetup.py", line 161, in generate
    self._generate(env)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\msetup.py", line 200, in _generate
    intr.run()
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 4703, in run
    super().run()
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 519, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 544, in evaluate_codeblock
    raise e
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 537, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 560, in evaluate_statement
    return self.evaluate_if(cur)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 647, in evaluate_if
    self.evaluate_codeblock(node.elseblock)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 544, in evaluate_codeblock
    raise e
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 537, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 552, in evaluate_statement
    self.assignment(cur)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 1219, in assignment
    value = self.evaluate_statement(node.value)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 554, in evaluate_statement
    return self.method_call(cur)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 951, in method_call
    return obj.method_call(method_name, args, kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 1833, in method_call
    value = fn(self.interpreter, state, args, kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 301, in wrapped    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 393, in wrapped    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 393, in wrapped    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 228, in wrapped    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 197, in wrapped    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\modules\cmake.py", line 389, in subproject
    subp = interpreter.do_subproject(dirname, 'cmake', kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 2942, in do_subproject
    raise e
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 2928, in do_subproject
    return self._do_subproject_cmake(subp_name, subdir, subdir_abs, default_options, kwargs)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 2996, in _do_subproject_cmake
    cm_int.analyse()
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\cmake\interpreter.py", line 961, in analyse
    self.trace.parse(self.raw_trace)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\cmake\traceparser.py", line 172, in parse    fn(l)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\cmake\traceparser.py", line 556, in _cmake_target_include_directories
    self._parse_common_target_options('target_include_directories', 'INCLUDE_DIRECTORIES', 'INTERFACE_INCLUDE_DIRECTORIES', tline, ignore=['SYSTEM', 'BEFORE'], paths=True)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\cmake\traceparser.py", line 599, in _parse_common_target_options
    private = self._guess_files(private)
  File "C:\Users\Ryan\AppData\Roaming\Python\Python38\site-packages\mesonbuild\cmake\traceparser.py", line 713, in _guess_files
    elif Path('{} {}'.format(curr_str, i)).exists():
  File "c:\program files\python\python38\lib\pathlib.py", line 1388, in exists
    self.stat()
  File "c:\program files\python\python38\lib\pathlib.py", line 1194, in stat
    return self._accessor.stat(self)
OSError: [WinError 123] ファイル名、ディレクトリ名、またはボリューム ラベルの構文が間違っています。: 'Q:\\Ryan\\Documents\\GitHub\\Aegisub\\build\\subprojects\\wxWidgets\\__CMake_build\\lib\\vc_x64_dll\\mswu Q:\\Ryan\\Documents\\GitHub\\Aegisub\\subprojects\\wxWidgets\\include'

My system is in Japanese, both locale and OS language. The English equivalent for that error is:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'Q:\\Ryan\\Documents\\GitHub\\Aegisub\\build\\subprojects\\wxWidgets\\__CMake_build\\lib\\vc_x64_dll\\mswu Q:\\Ryan\\Documents\\GitHub\\Aegisub\\subprojects\\wxWidgets\\include'

https://gist.github.com/CoffeeFlux/c1e6c072b64a6e3a75e6a734158b612c

To Reproduce
Checkout the above repo on the appropriate branch, run meson build from the root from a visual studio command prompt (or something else that will run the setup script for MSVC).

The wx portion in particular:

wx_dep = dependency('wxWidgets', version: '>=3.0.0',
                    required: false,
                    modules: ['std', 'stc', 'gl'])

if wx_dep.found()
    deps += wx_dep
else
    build_shared = 'ON'
    if get_option('default_library') == 'static'
        build_shared = 'OFF'
    endif

    wx = cmake.subproject('wxWidgets', cmake_options: ['-DwxBUILD_INSTALL=OFF',
                                                       '-DwxBUILD_PRECOMP=OFF', # otherwise breaks project generation w/ meson
                                                       '-DwxBUILD_SHARED=@0@'.format(build_shared),
                                                       '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson
    deps += [
        wx.dependency('wxmono'),
        wx.dependency('wxzlib'),
        wx.dependency('wxpng'),
        wx.dependency('wxexpat'),
        wx.dependency('wxregex'),
        wx.dependency('wxscintilla')
    ]

    if host_machine.system() == 'windows'
        if cc.has_header('rpc.h')
            deps += cc.find_library('rpcrt4', required: true)
        else
            error('Missing Windows SDK RPC Library (rpc.h / rpcrt4.lib)')
        endif
        if cc.has_header('commctrl.h')
            deps += cc.find_library('comctl32', required: true)
        else
            error('Missing Windows SDK Common Controls Library (commctrl.h / comctl32.lib)')
        endif
    endif
endif

Expected behavior
CMake subproject succeeds at configure.

system parameters
Native build, win10
Python 3.8.3
Meson 0.56.0
ninja 1.8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions