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

Fix duplicate sources for hdfspp_test_shim_static

    XMLWordPrintableJSON

Details

    Description

      The library target hdfspp_test_shim_static is built using the following sources, which causes duplicate symbols to be defined -
      1. hdfs_shim.c
      2. ${LIBHDFSPP_BINDING_C}/hdfs.cc
      https://github.com/apache/hadoop/blob/8774f178686487007dcf8c418c989b785a529000/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/CMakeLists.txt#L153

      And fails the compilation -

      H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsAllowSnapshot already defined in hdfspp_test_shim_static.lib(hdfs.obj) 
      H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsAvailable already defined in hdfspp_test_shim_static.lib(hdfs.obj) 
      H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsBuilderConfSetStr already defined in hdfspp_test_shim_static.lib(hdfs.obj) 
      H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj) : error LNK2005: hdfsBuilderConnect already defined in hdfspp_test_shim_static.lib(hdfs.obj)
      

      Duplicate symbols defined by hdfs_shim.c - https://github.com/apache/hadoop/blob/440f4c2b28515d2007b81ac00b549bbf14fa9f64/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c#L583-L585.

      Adding the source ${LIBHDFSPP_BINDING_C}/hdfs.cc is redundant here since this file is transitively included in hdfs_shim.c through libhdfspp_wrapper.h - https://github.com/apache/hadoop/blob/440f4c2b28515d2007b81ac00b549bbf14fa9f64/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c#L20. Thus, we need to exclude ${LIBHDFSPP_BINDING_C}/hdfs.cc to fix this issue.

      Attachments

        1. hdfs_shim duplicate symbols.log
          316 kB
          Gautham Banasandra

        Issue Links

          Activity

            People

              gaurava Gautham Banasandra
              gaurava Gautham Banasandra
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 1h
                  1h