• Bug
    • Resolution: Fixed
    • Major
    • 3.1.2
    • None
    • None
    • None
    • 1


      ===== UPDATE 05.04.2021 =====

      It seems very difficult to create a build system for VS2015.  Finding ways to download the build tools seems sketchy at best. My thoughts at to maybe recommend VS2019 build tools and try to avoid having anyone go down the path of VS2015 build tools.

      VS2015 Build System

      In either path (navigate or direct link) once the installer was downloaded, I had trouble getting the installer to work.  Apparently this is not something unique or new (reference here).

      In the end, it was easier to download the VS2019 community edition and then skip the default install, install individual components and get the necessary VS2015 things.

      1. Install VS2019 community edition
      2. Run installer
      3. Go to individual components tab
      4. Type "build" in the search components to filter
      5. Scroll down to MSVC v140 - VS 2015 C++ build tools (v 14.00)
      6. Type "cmake" in the search components to filter
      7. Select C++ CMake tools for Windows

      NOTE:  If VS2019 build tools are installed, to get the Python SDK build to work, set an ENV variable (example build error below).

      • CMAKE_GENERATOR=Visual Studio 14 2015

      error MSB8020: The build tools for v142 (Platform Toolset = 'v142') cannot be found. To build using the v142 build tools, please install v142 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Administrator\AppData\Local\Temp\2\pip-install-dqum57p9\couchbase_e0ee5f45898a455e8deb6710dbaac176\build\\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]

      Once installed, trying to install couchbase (either python3 -m pip install couchbase, or from source python3 build_ext --inplace) would fail due to an incorrecty location of Microsoft.Cpp.Default.props.  This seemed to be related to the MSBuild using VCTargetsPath, which isn't set so the location defaults to C:\Microsoft.Cpp.Default.props (see error below).  Fix was to set an ENV variable for VCTargetsPath to match where MSBuild has Microsoft.Cpp.Defaults.props

      • VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140

      error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

      There might also be an issue with missing the Windows SDK 8.1.  The build will specifically mention the 8.1 SDK is missing.  So, download and install the SDK.  Also, if after install the build still fails, it might be necessary to set and ENV variable (see below)

      After everything was installed, I was able to build the client (python3 build_ext --inplace, also python3 -m pip install -e <path to client code> works), but installing via pip (python3 -m pip install couchbase) failed due to filenames being too long (error below).  This leads me to believe that without a wheel, you cannot install the client via pip.  Clear answer is get wheels for all the supported python versions and the client.  But that will take a bit more time.

      NOTE:  conda environments look to have the same problem.

      I tried updating the registry to set LongPathsEnabled, also tried to edit the group policy to enable long paths option.  Neither helped.  This looks to be a problem with MSBuild that is apparently fix in v16.0.  Adds credence to recommending a VS2019 build system.


      3>CUSTOMBUILD : error : unable to create file contrib/gtest-1.8.1/include/gtest/internal/gtest-param-util-generated.h.pump: Filename too long [C:\Users\Administrator\AppData\Local\Temp\2\pip-install-0d0b04p4\couchbase_50be3ee7dfb44e59aa3396bdfc94a08f\build\\Release\libcouchbase_src.vcxproj]      
      3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.CppBuild.targets(312,5): error MSB3491: Could not write lines to file "hdr_histogram_static.dir\Release\hdr_hist.6CA6F231.tlog\hdr_histogram_static.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\Administrator\AppData\Local\Temp\2\pip-install-0d0b04p4\couchbase_50be3ee7dfb44e59aa3396bdfc94a08f\build\\Release\Release\lcb_build\contrib\HdrHistogram_c\src\hdr_histogram_static.vcxproj] [C:\Users\Administrator\AppData\Local\Temp\2\pip-install-0d0b04p4\couchbase_50be3ee7dfb44e59aa3396bdfc94a08f\build\\Release\libcouchbase_src.vcxproj]
      3>Done Building Project "C:\Users\Administrator\AppData\Local\Temp\2\pip-install-0d0b04p4\couchbase_50be3ee7dfb44e59aa3396bdfc94a08f\build\\Release\libcouchbase_src.vcxproj" (default targets) -- FAILED.
      1>Done Building Project "C:\Users\Administrator\AppData\Local\Temp\2\pip-install-0d0b04p4\couchbase_50be3ee7dfb44e59aa3396bdfc94a08f\build\\Release\ALL_BUILD.vcxproj" (default targets) -- FAILED.


      VS2019 Build System

      Install VS2019 community edition, as long as Desktop development with C++ tools are included (one of the main page selections) the default install should work. 

      It is possible that the C:\Microsoft.Cpp.Default.props not found error will exist.  This can be fixed by setting and ENV variable.  Also, I think running w/in the Developer Command Prompt for VS 2019

      • VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160

      error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            jared.casey Jared Casey
            Ellis.Breen Ellis Breen
            0 Vote for this issue
            1 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes