Skip to content
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

cmake: fix Debug build WITH_SEASTAR=ON #23567

Merged
merged 1 commit into from Aug 21, 2018

Conversation

tchaikov
Copy link
Contributor

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

@tchaikov tchaikov force-pushed the wip-cmake-cleanup branch 3 times, most recently from c4d7e8a to 4298583 Compare August 14, 2018 10:07
@tchaikov tchaikov force-pushed the wip-cmake-cleanup branch 10 times, most recently from a8fa7bc to 6fb1581 Compare August 14, 2018 14:40
@tchaikov tchaikov requested a review from cbodley August 14, 2018 15:11
@tchaikov tchaikov changed the title cmake: link against gtest in a better way cmake: fix link dependencies and link against gtest in a better way Aug 14, 2018
Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great cleanup!

${LEVELDB_LIBRARIES}
dmclock heap_profiler cpu_profiler ${CMAKE_DL_LIBS})
${CMAKE_DL_LIBS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see that we still link os in target_link_libraries(ceph-osd osd os, can we make this one PUBLIC so it isn't needed in ceph-osd?

target_link_libraries(osd
  PUBLIC os
  PRIVATE dmclock heap_profiler cpu_profiler

@tchaikov tchaikov force-pushed the wip-cmake-cleanup branch 2 times, most recently from 5b238b3 to 923370b Compare August 15, 2018 02:07
@tchaikov
Copy link
Contributor Author

@cbodley updated and repushed.

@cbodley
Copy link
Contributor

cbodley commented Aug 15, 2018

jenkins test make check

@wjwithagen
Copy link
Contributor

@tchaikov
I tried this in FreeBSD/Jenkins, and I got about 6-7 tests that failed.
http://cephdev.digiware.nl:8180/jenkins/job/ceph-master/2443/console

Removing the PR got things working again.
But I have no idea yet where the error is.
Rather busy with $work atm.

@tchaikov
Copy link
Contributor Author

tchaikov commented Aug 15, 2018

@wjwithagen i can hardly tell what's going wrong with the failures. most of them are either segfaults or bus errors. will setup a FreeBSD vm to reproduce these failures. in the meanwhile, i'm inclined to merge it after running it thru rados qa suite.

my wild guess is that the way how gtest is built in this change has a bad effect on the tests..

@wjwithagen
Copy link
Contributor

@tchaikov
I can live with that, but the set of changed files is substantial.
So figuring things out can be convoluted.
OTOH it could also be as simple as usign a set of different linking options, like one of the older PRs that did not work for FreeBSD.

@cbodley
Copy link
Contributor

cbodley commented Aug 15, 2018

@tchaikov i'd prefer not to merge something that breaks freebsd

Copy link
Contributor

@wjwithagen wjwithagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
I have the feeling that this PR can be split into 2 pieces:

  1. cleanup and preparation for improved gtest.
  2. changes for gtest and gmock

Perhaps split the PR along those lines, and then I can test that seperately to find out which parts breaks FreeBSD.

CMakeLists.txt Outdated
find_package(RocksDB 5.8 REQUIRED)
else()
include(BuildRocksDB)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
This patch is more cleanup than it has something to do with gtest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refer to the commit message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
I was refering to feb06ad: cmake: fix link dependencies
That is all about cleanup, not linking gtest.
But I don't feel too strong about that, it just bloats the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, as i put in the commit message. it's not a cleanup.

set(rocksdb_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rocksdb")
set(rocksdb_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocksdb")
set(rocksdb_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/rocksdb")
set(rocksdb_BINARY_DIR "${CMAKE_BINARY_DIR}/src/rocksdb")
ExternalProject_Add(rocksdb_ext
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
Same here..

-DBUILD_GMOCK=ON
-DBUILD_GTEST=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
Can I try this without this option? It could be one of the culpits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dropped this file from the latest changeset.

@@ -1,6 +1,6 @@
if(NOT Sanitizers_FIND_COMPONENTS)
set(Sanitizers_FIND_COMPONENTS
address undefined-behavior)
address undefined_behavior)
endif()
if(HAVE_JEMALLOC)
message(WARNING "JeMalloc does not work well with sanitizers")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
Note that the standard allocator on FreeBSD is a Jemalloc version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am aware of this. and could you be more specific?

@@ -520,7 +506,7 @@ set(ceph_osd_srcs
ceph_osd.cc)
add_executable(ceph-osd ${ceph_osd_srcs})
add_dependencies(ceph-osd erasure_code_plugins)
target_link_libraries(ceph-osd osd os global-static common
target_link_libraries(ceph-osd osd global-static common
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
Looks like cleanup as well

@tchaikov
Copy link
Contributor Author

i tested this PR on FreeBSD 11.2-RELEASE, with clang 6. the tests passed.

@tchaikov
Copy link
Contributor Author

instead of building gtest/gmock as an external project, in the latest changset, they are built as sub-project as before. hopefully this would address the test failures on FreeBSD 12.0 CURRENT + clang 6.0.

@wjwithagen
Copy link
Contributor

@tchaikov
I will run that new version thru Jenkins once more.

@wjwithagen
Copy link
Contributor

@tchaikov
Rerunning Jenkins, since it caught the same error you just fixed.

@wjwithagen
Copy link
Contributor

@tchaikov
Nope, still errors with the PR:
http://cephdev.digiware.nl:8180/jenkins/job/ceph-master/2453/console

And if the PR is not applied, tests are oke:
http://cephdev.digiware.nl:8180/jenkins/job/ceph-master/2454/consoleFull

Maybe I have some time tonight to disect the PR and see where tings go wrong.
Could also be I need to upgrade 12.0-CURRENT, since it is 2 months old, and it is nearing its release.
But that is a bit more work.

@wjwithagen
Copy link
Contributor

@tchaikov
But I have the idea that the errors occur between the tests.
And that leads me to believe that the errors actually originate in the gtest code that surrounds the ceph-tests.

@tchaikov
Copy link
Contributor Author

@wjwithagen thanks for testing. the generated debug symbol package of my test batch containing this PR is over 2G. the debug symbol package should be around 1.55G without this change. i will also look into this issue.

@wjwithagen
Copy link
Contributor

@tchaikov
When you tested on 11.2 what linker did you use?
Reason I ask: I'm using the new linker that comes with llvm, because with some unitttests it runs into a linking error.
But if you have not changed anything, then that could be a reason for my errors.
Only question is how you sneaked by the build error I run into.
Will try with the std(gnu) linker.

@tchaikov
Copy link
Contributor Author

tchaikov commented Aug 17, 2018

@wjwithagen i didn't change any settings in specific. i just

  1. install git and bash
  2. updated the ports using portsnap, and installed portmaster.
  3. ran install-deps.sh
  4. ran do_freebsd.sh.

but the vm was destroyed, so i can hardly tell what exactly linker i was using. if you are interested, i will try to create another this week-end.

@wjwithagen
Copy link
Contributor

wjwithagen commented Aug 17, 2018 via email

@tchaikov
Copy link
Contributor Author

tchaikov commented Aug 17, 2018

@wjwithagen i am moving the gtest change into #23628. the size of generated debug-info package looks sane: https://shaman.ceph.com/builds/ceph/wip-cmake-gtest/6f231ee8640a332b3a04808b7a5e9126369ebe57/ . could you give it a try ?

while the build which contains the other commits in this PR fails due to over-sized debug-info: see https://shaman.ceph.com/builds/ceph/wip-cmake-cleanup-sanitize-links-os/00283a21e9c95144a30babc5c0be90e9c7fe0508/ .

@tchaikov tchaikov changed the title cmake: fix link dependencies and link against gtest in a better way cmake: fix link dependencies Aug 19, 2018
@tchaikov
Copy link
Contributor Author

now that the gtest change has been merged in #23628, i am removing it from this PR.

@wjwithagen
Copy link
Contributor

@tchaikov
Dust has setled more or less on the FreeBSD master builds, so I'll run this thru.

and s/undefined-behavior/undefined_behavior/ to be compatible with
seastar

Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

tchaikov commented Aug 21, 2018

@wjwithagen 7d46e18 and 3e5c77a are fishy. with these changes, the generated debug-info sizes > 2G. see https://shaman.ceph.com/builds/ceph/wip-cmake-link-dependencies/73449e3366d53cf365b628d4e3f01fdf0b05228f/ so i am dropping them.

@tchaikov tchaikov changed the title cmake: fix link dependencies cmake: fix Debug build WITH_SEASTAR Aug 21, 2018
@tchaikov tchaikov changed the title cmake: fix Debug build WITH_SEASTAR cmake: fix Debug build WITH_SEASTAR=ON Aug 21, 2018
@wjwithagen
Copy link
Contributor

@tchaikov
Jenkins seems to be happy:
http://cephdev.digiware.nl:8180/jenkins/job/ceph-master/2476/consoleFull
The refusal is the already merged other PR from this bunch, so that can be ignored.

@tchaikov tchaikov merged commit 0d209b6 into ceph:master Aug 21, 2018
@tchaikov tchaikov deleted the wip-cmake-cleanup branch August 21, 2018 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants