Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Hannes Siebenhandl's avatar
    9cd1ae5b
    Escape multiple arguments in the settings file · 9cd1ae5b
    Hannes Siebenhandl authored and Andreas Klebinger's avatar Andreas Klebinger 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.
    
    (cherry picked from commit 31bf85ee)
    9cd1ae5b
    History
    Escape multiple arguments in the settings file
    Hannes Siebenhandl authored and Andreas Klebinger's avatar Andreas Klebinger 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.
    
    (cherry picked from commit 31bf85ee)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.