[PATCH] D29185: Allow llvm's build and test systems to support paths with spaces

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 09:28:28 PST 2017


bd1976llvm created this revision.
Herald added subscribers: mgorny, mehdi_amini.

Most major platforms support paths which can contain spaces. Paths with spaces are rare on some systems but they are common on Windows. 
LLVM should embrace paths with spaces!

My motivation for this change is that we had a CI system, which we were obliged to use but over which we didn't have control, that checked out source code into sub-directories below a path that contained spaces.

details
=======

On Windows the build worked out of the box.

On Linux I had to make a few small changes to CMake and bash build scripts to get the build working.

In order to get the lit tests to run I modified lit to escape spaces in substitutions, this change allowed the vast majority of tests to run. I provided a new set of default substitutions containing the windows '^' escape character e.g: %^s, %^t to allow a test writer to use a substitution which does not escape spaces in the (extremely rare) cases where this is required. The main use case for this is where a test writer needs to use a substitution inside of quotation marks - as this would preserve the escape character. I also had to modify tests that used echo to emit lines to a file that is later piped into a process. These tests have been modified to echo quotation marks to surround any paths as these might contain spaces.

One test is still failing: BugPoint/compile-custom.ll. Bugpoint simply does not work with spaces in paths due to naive tokenization of the custom compiler string. See the function lexCommand in bugpoint/ExecutionDriver.cpp.

Testing
=======

I tested this on windows via cmd and and msys and on Linux (bash - ubuntu 14.04).

I also ran the lit testsuite on Linux (It doesn't work on windows.)


https://reviews.llvm.org/D29185

Files:
  cmake/modules/AddLLVM.cmake
  docs/GettingStartedVS.rst
  test/BugPoint/compile-custom.ll
  test/DebugInfo/llvm-symbolizer-split-dwarf-empty.test
  test/DebugInfo/llvm-symbolizer.test
  test/LibDriver/libpath.test
  test/Object/mri-addmod.test
  test/Object/nm-archive.test
  test/Other/ResponseFile.ll
  test/ThinLTO/X86/prefix_replace.ll
  test/Transforms/GCOVProfiling/function-numbering.ll
  test/Transforms/GCOVProfiling/global-ctor.ll
  test/Transforms/GCOVProfiling/linezero.ll
  test/Transforms/GCOVProfiling/linkagename.ll
  test/Transforms/GCOVProfiling/return-block.ll
  test/Transforms/GCOVProfiling/three-element-mdnode.ll
  test/Transforms/GCOVProfiling/version.ll
  test/lit.cfg
  test/tools/llvm-profdata/input-dir.test
  test/tools/llvm-profdata/input-filenames.test
  test/tools/llvm-symbolizer/coff-dwarf.test
  test/tools/llvm-symbolizer/coff-exports.test
  test/tools/llvm-symbolizer/dsym.test
  test/tools/sanstats/elf.test
  utils/GetRepositoryPath
  utils/GetSourceVersion
  utils/lit/lit/ShUtil.py
  utils/lit/lit/TestRunner.py
  utils/lit/lit/util.py
  utils/lit/tests/lit.cfg
  utils/lit/tests/unit/ShUtil.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29185.85918.patch
Type: text/x-patch
Size: 28700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170126/7426e374/attachment.bin>


More information about the llvm-commits mailing list