[ https://issues.apache.org/jira/browse/HDFS-16665?focusedWorklogId=791774&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-791774 ]
ASF GitHub Bot logged work on HDFS-16665: ----------------------------------------- Author: ASF GitHub Bot Created on: 17/Jul/22 16:50 Start Date: 17/Jul/22 16:50 Worklog Time Spent: 10m Work Description: 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? Issue Time Tracking ------------------- Worklog Id: (was: 791774) Remaining Estimate: 0h Time Spent: 10m > Fix duplicate sources for hdfspp_test_shim_static > ------------------------------------------------- > > Key: HDFS-16665 > URL: https://issues.apache.org/jira/browse/HDFS-16665 > Project: Hadoop HDFS > Issue Type: Bug > Components: libhdfs++ > Affects Versions: 3.4.0 > Environment: Windows 10 > Reporter: Gautham Banasandra > Assignee: Gautham Banasandra > Priority: Critical > Labels: libhdfscpp > Attachments: hdfs_shim duplicate symbols.log > > Time Spent: 10m > Remaining Estimate: 0h > > 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 - > {code} > 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) > {code} > 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. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org