Skip to content

Spaces in paths from llvm-config should be quoted #28117

@llvmbot

Description

@llvmbot
Bugzilla Link 27743
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @pogo59

Extended Description

When LLVM is installed in a path containing spaces, paths output from llvm-config have no way to indicate breaks between parameters and spaces within paths. For example, --cflags on Windows for MSVC might include "-IC:\Program Files\LLVM\include" which parses as "-IC:\Program" "Files\LLVM\include".

This could be fixed with escaping or quoting by llvm-config, perhaps as simple as quoting each individual element it emits. I believe quoting paths is portable to all major shells, though this would involve trading one error case (space in path) for another (quote in path) unless shell escaping logic were added.

Adding quotes to the output might break some existing tools, but given the usual use case is feeding the output to a shell it may not be worth worrying about.

Source issue: https://bitbucket.org/tari/llvm-sys.rs/issues/9/include-path-for-llvm-headers-on-windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillallvm-toolsAll llvm tools that do not have corresponding tag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions