Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-16604

Install gtest via FetchContent_Declare in CMake

    XMLWordPrintableJSON

Details

    Description

      CMake is unable to checkout release-1.10.0 version of GoogleTest -

      [WARNING] -- Build files have been written to: /home/jenkins/jenkins-home/workspace/hadoop-multibranch_PR-4370/centos-7/src/hadoop-hdfs-project/hadoop-hdfs-native-client/target/main/native/libhdfspp/googletest-download
      [WARNING] Scanning dependencies of target googletest
      [WARNING] [ 11%] Creating directories for 'googletest'
      [WARNING] [ 22%] Performing download step (git clone) for 'googletest'
      [WARNING] Cloning into 'googletest-src'...
      [WARNING] fatal: invalid reference: release-1.10.0
      [WARNING] CMake Error at googletest-download/googletest-prefix/tmp/googletest-gitclone.cmake:40 (message):
      [WARNING]   Failed to checkout tag: 'release-1.10.0'
      [WARNING] 
      [WARNING] 
      [WARNING] gmake[2]: *** [CMakeFiles/googletest.dir/build.make:111: googletest-prefix/src/googletest-stamp/googletest-download] Error 1
      [WARNING] gmake[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/googletest.dir/all] Error 2
      [WARNING] gmake: *** [Makefile:103: all] Error 2
      [WARNING] CMake Error at main/native/libhdfspp/CMakeLists.txt:68 (message):
      [WARNING]   Build step for googletest failed: 2
      

      Jenkins run - https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4370/6/artifact/out/branch-compile-hadoop-hdfs-project_hadoop-hdfs-native-client.txt

      We need to use FetchContent_Declare since we're getting the source code exactly at the given commit SHA. This avoids the checkout step altogether and solves the above issue.

      Attachments

        Issue Links

          Activity

            People

              gaurava Gautham Banasandra
              gaurava Gautham Banasandra
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m