GauthamBanasandra opened a new pull request, #4573:
URL: https://github.com/apache/hadoop/pull/4573

   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   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.
   
   ### How was this patch tested?
   1. Tested this locally by building on my Windows system.
   2. Hadoop Jenkins CI validation.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to