Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
5308 commits behind the upstream repository.
  • Hannes Siebenhandl's avatar
    31bf85ee
    Escape multiple arguments in the settings file · 31bf85ee
    Hannes Siebenhandl authored and Marge Bot's avatar Marge Bot committed
    Uses responseFile syntax.
    
    The issue arises when GHC is installed on windows into a location that
    has a space, for example the user name is 'Fake User'.
    The $topdir will also contain a space, consequentially.
    When we resolve the top dir in the string `-I$topdir/mingw/include`,
    then `words` will turn this single argument into `-I/C/Users/Fake` and
    `User/.../mingw/include` which trips up the flag argument parser of
    various tools such as gcc or clang.
    We avoid this by escaping the $topdir before replacing it in
    `initSettngs`.
    Additionally, we allow to escape spaces and quotation marks for
    arguments in `settings` file.
    
    Add regression test case to count the number of options after variable
    expansion and argument escaping took place.
    Additionally, we check that escaped spaces and double quotation marks are
    correctly parsed.
    31bf85ee
    History
    Escape multiple arguments in the settings file
    Hannes Siebenhandl authored and Marge Bot's avatar Marge Bot committed
    Uses responseFile syntax.
    
    The issue arises when GHC is installed on windows into a location that
    has a space, for example the user name is 'Fake User'.
    The $topdir will also contain a space, consequentially.
    When we resolve the top dir in the string `-I$topdir/mingw/include`,
    then `words` will turn this single argument into `-I/C/Users/Fake` and
    `User/.../mingw/include` which trips up the flag argument parser of
    various tools such as gcc or clang.
    We avoid this by escaping the $topdir before replacing it in
    `initSettngs`.
    Additionally, we allow to escape spaces and quotation marks for
    arguments in `settings` file.
    
    Add regression test case to count the number of options after variable
    expansion and argument escaping took place.
    Additionally, we check that escaped spaces and double quotation marks are
    correctly parsed.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
test.hs 382 B