New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed unnecessary inclusion of iostream in several files #4707
Conversation
CXXLD ceph_test_rados_striper_api_striping /usr/bin/ld: ./.libs/libcommon.a(Crypto.o): undefined reference to symbol 'PK11_GetBestSlot@@NSS_3.2' /usr/bin/ld: note: 'PK11_GetBestSlot@@NSS_3.2' is defined in DSO /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libnss3.so so try adding it to the linker command line /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libnss3.so: could not read symbols: Invalid operation You should be able to reproduce this error on CentOS 7. If you have docker you can setup an environment with: cd src ; test/docker-test.sh --os-type centos --os-version 7 --shell |
This still seem to build fine on my machine (assuming that I've done it correctly). |
@stiopaa1 would you mind doing git commit --amend (just for the purpose of changing the hash of your last commit) followed by a git push --force (just for the sake of running the bot again). If the bot shows the exact same error, it will be helpful if you can upload the output of your run. Just to avoid any misunderstanding, when you run cd src ; test/docker-test.sh --os-type centos --os-version 7 --shell it just gives you a shell on a centos machine, with your latest commit, in the ceph tree. From there it's up to you to ./run-make-check.sh. Is it what you did ? |
@dachary after running cd src ; test/docker-test.sh --os-type centos --os-version 7 --shell, I did(in ceph-centos-7-stiopa directory): I'll give it another go with ./run-make-check.sh |
@stiopaa1 the ./run-make-check.sh script is run by the bot and does not use the same compilation flag. It's likely you will run into the same problem. |
http://jenkins.ceph.dachary.org/job/ceph/LABELS=centos-7&&x86_64/5292/console CXXLD ceph_test_rados_api_c_read_operations /usr/bin/ld: ./.libs/libcommon.a(Crypto.o): undefined reference to symbol 'PK11_GetBestSlot@@NSS_3.2' /usr/bin/ld: note: 'PK11_GetBestSlot@@NSS_3.2' is defined in DSO /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libnss3.so so try adding it to the linker command line /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/libnss3.so: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status |
@dachary here is the full log: |
Just noticed in the pasted log:
|
the config.log file should have more information about why it failed. |
@dachary, thanks I managed to reproduce it locally - hopefully will work now:) |
@stiopaa1 that's great. It makes me worried there could problems with other compilation flags. What was the problem ? |
The flag that made it fail was --with-debug - without it the file(src/test/cls_rbd/test_cls_rbd.cc) causing the problem wasn't being compiled.
I think(!) that following happened: The following line was causing the error: Before the inline functions were moved to buffer.cc, the above didnt't require libcommon library and even though the library is listed it wasn't being linked against. When we move inline functions to buffer.cc(and remove inline) the libcommon is linked against, but is then missing libnss3 library(in Crypto.o), hence the error: /usr/bin/ld: ./.libs/libcommon.a(Crypto.o): undefined reference to symbol 'PK11_GetBestSlot@@NSS_3.2' |
that makes sense. It also deserves explaining in the commit message. Also the main commit does not just remove unused iostream. It deserves a detailed explanation of why it is a good thing. Why moving functions from buffer.h to buffer.cc is beneficial ? |
And the two commits can be squashed together I think. Apart from the commit message the change looks great. |
I think the most important thing to explain is why performances won't be negatively affected by having the functions not inline anymore. |
@dachary |
@stiopaa1 buffer.cc being used extensively throughout the code base, there needs to be certainty that it won't affect performances. Can you make an extra effort to verify and explain ? I think you're right and it would probably not matter as much if it was not in such a central place. |
@stiopaa1 the rest of the explaining is good enough. I even think you should merge the two commits together because the first won't even link without the second. |
Okay, you can shepherd it if that's an issue. :) |
a213f5e
to
68c3ac2
Compare
@stiopaa1 thank you Michal! i am pushing your changes to ceph.git/wip-4707. once it is confirmed by the builders, will merge it. |
@stiopaa1 , the build failed at http://gitbuilder.sepia.ceph.com/gitbuilder-ceph-rpm-centos6-5-amd64-basic/log.cgi?log=68c3ac2bef13214263bf7b47567978e8ceb52249
Michal, could you also |
In several files the iostream wasn't being used, so it got removed. In other files the iostream inclusion was replaced by including iosfwd (for forward declarations), which is much smaller header than iostream, so in theory should reduce compilation time. To make this work some of the functions must have been moved from .h to .cc file. 3 functions also needed to have inline removed - this shouldn't affect performance in any way: two of them are probably too long to have been inlined anyway and the third one is for error reporting, so probably won't be called too often. test/Makefile-client.am: added linker libs This was required to avoid linker error when linking src/test/cls_rbd/test_cls_rbd.cc file. Makefile was specyfing libcommon.a as a part of a linker command even though this wasn't required and wasn't being linked against. When inline functions from buffer.h were moved to buffer.cc(and inline was removed) the libcommon.a library became necessary. This wouldn't link without also including additional libraries(CRYPTO_LIBS and EXTRA_LIBS) Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
@tchaikov Any idea why the build first failed and then succeeded? |
@tchaikov @stiopaa1 you can ignore #4707 (comment) this is a false negative |
Removed unnecessary inclusion of iostream in several files Reviewed-by: Kefu Chai <kchai@redhat.com>
fix xio to work with the merge of pull request " Removed unnecessary inclusion of iostream in several files ceph#4707" Signed-off-by: Vu Pham <vu@mellanox.com>
fix xio to work with the merge of pull request " Removed unnecessary inclusion of iostream in several files #4707" Signed-off-by: Vu Pham <vu@mellanox.com>
fix xio to work with the merge of pull request " Removed unnecessary inclusion of iostream in several files ceph#4707" Signed-off-by: Vu Pham <vu@mellanox.com>
fix xio to work with the merge of pull request " Removed unnecessary inclusion of iostream in several files ceph#4707" Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Michal Jarzabek stiopa@gmail.com