Page MenuHome

make fails if a "+" character is in the path (compiling issue)
Closed, ResolvedPublic

Description

System Information
Operating system: Windows 7 Professional; 64 bit
OS Locale: German (Swiss)
Graphics card: Nvidia GeForce GTX 760
IDE: Visual Studio Enterprise 2017
CMake: 3.14.2

Blender Version
Broken: 2.80, Commit 985f33719ce9108d35d5f37b4c7c79d81f708a0d, (master branch)
Worked: 2.80, Commit bfd18c471d29b811bc2a16854ab1a389179b8368

Short description of error
If a plus sign (+) is present in the path, where the blender project VS project is proposed to be compiled, make fails due to a regex error.
Example path:

E:/C++/blender

The command:

make full nobuild

... fails with the following message:

e:\C++\blender>make full nobuild
No explicit msvc version requested, autodetecting version.
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.11
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Compiler Detection successful, detected VS2017
Building blender with VS2017 for x64 in e:\C++\blender\..\build_windows_Full_x64_vc15_Release
loading initial cache file e:\C++\blender\\build_files\cmake\config\blender_full.cmake
-- The C compiler identification is MSVC 19.16.27030.1
-- The CXX compiler identification is MSVC 19.16.27030.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SUPPORT_SSE_BUILD
-- Performing Test SUPPORT_SSE_BUILD - Success
-- SSE Support: detected.
-- Performing Test SUPPORT_SSE2_BUILD
-- Performing Test SUPPORT_SSE2_BUILD - Success
-- SSE2 Support: detected.
-- Found Git: E:/Apps/Git/cmd/git.exe (found version "2.16.2.windows.1")
-- 64 bit compiler detected.
-- Visual Studio 2017 detected.
-- Found OpenGL: opengl32
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
CMake Error at build_files/cmake/macros.cmake:182 (if):
  if given arguments:

    "E:/C++/blender/intern/clog" "MATCHES" "E:/C++/blender/intern/clog/"

  Regular expression "E:/C++/blender/intern/clog/" cannot compile
Call Stack (most recent call first):
  build_files/cmake/macros.cmake:258 (blender_source_group)
  build_files/cmake/macros.cmake:298 (blender_add_lib__impl)
  intern/clog/CMakeLists.txt:41 (blender_add_lib)


-- Configuring incomplete, errors occurred!
See also "E:/C++/build_windows_Full_x64_vc15_Release/CMakeFiles/CMakeOutput.log".
"Configuration Failed"

It may be that other characters are also affected:

  • White spaces are already covered by the check and not allowed (gracefully termination of make)
  • Underscore or dashes works well
  • Non-ASCII Characters like "é" or "ü" seems also not to be a problem

Exact steps for others to reproduce the error
As described in the error

Event Timeline

Bastien Montagne (mont29) triaged this task as Confirmed, Low priority.

Looks like we are not the only ones to 'suffer' from this…

@Campbell Barton (campbellbarton) according to https://gitlab.kitware.com/cmake/cmake/issues/18580, only solution currently is an ugly regex to replace all special chars by their escaped version in the string we want to use as regex for MATCHES

Wondering though, whether we really need MATCHES here?

Don't think so, STREQUAL can be used instead.