bloomberg / bde

Basic Development Environment - a set of foundational C++ libraries used at Bloomberg.
Apache License 2.0
1.68k stars 318 forks source link

Improve support for Apple Silicon and macOS #275

Open thorpe-dev opened 2 years ago

thorpe-dev commented 2 years ago

Will file internal issue - this was done on my personal M1 laptop

Testing performed

Failing unit tests ``` The following tests FAILED: 106 - balm_publicationscheduler.t (Failed) 117 - balst_stacktraceprintutil.t (Failed) 160 - balxml_minireader.t (Failed) 324 - bdldfp_decimalimputil.t (Failed) 327 - bdldfp_decimalutil.t (Failed) 359 - bdlma_concurrentmultipool.t (Failed) 373 - bdlma_multipool.t (Failed) 395 - bdls_memoryutil.t (Failed) 399 - bdls_processutil.t (Failed) 532 - bslim_formatguard.t (Failed) 635 - bslmf_istransparentpredicate.t (Failed) 706 - bslmt_threadutil.t (Failed) 711 - bslmt_timedsemaphore.t (Failed) 787 - bsls_stopwatch.t (Failed) 793 - bsls_unspecifiedbool.t (Failed) 811 - bslstl_chrono.t (Failed) 822 - bslstl_function.t (Failed) 824 - bslstl_function_invokerutil.t (Failed) 881 - bslstl_stringview.t (Failed) ```
bsls_unspecifiedbool.t.cpp build ``` /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:418:34: error: type 'BoolType' (aka 'int BloombergLP::bsls::UnspecifiedBool::*') cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] const bool bar[] = { bt }; ^~ /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:418:34: note: insert an explicit cast to silence this issue const bool bar[] = { bt }; ^~ static_cast( ) /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:424:23: error: type 'BoolType' (aka 'int BloombergLP::bsls::UnspecifiedBool::*') cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] } bag = { bt }; ^~ /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:424:23: note: insert an explicit cast to silence this issue } bag = { bt }; ^~ static_cast( ) /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:621:34: error: type '(anonymous namespace)::Booleable::BoolType' (aka 'int BloombergLP::bsls::UnspecifiedBool<(anonymous namespace)::Booleable>::*') cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] const bool bar[] = { babel }; ^~~~~ /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:621:34: note: insert an explicit cast to silence this issue const bool bar[] = { babel }; ^~~~~ static_cast( ) /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:627:23: error: type '(anonymous namespace)::Booleable::BoolType' (aka 'int BloombergLP::bsls::UnspecifiedBool<(anonymous namespace)::Booleable>::*') cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] } bag = { babel }; ^~~~~ /Users/michaelthorpe/programming/bde/groups/bsl/bsls/bsls_unspecifiedbool.t.cpp:627:23: note: insert an explicit cast to silence this issue } bag = { babel }; ^~~~~ static_cast( ) 4 errors generated. ```
mversche commented 2 years ago

This overlaps with https://github.com/bloomberg/bde/pull/273

emeryberger commented 2 years ago

Built from this branch on my Mac Mini M1. All I needed to do to get bsls_unspecifiedbool.t.cpp was adding static_cast<bool> around bt and babel; good error messages for a change!

I had an almost completely different set of failed unit tests. - denotes the tests that failed given in @thorpe-dev's top comment; + denotes the tests that failed in my run.

Click to see the diff ``` The following tests FAILED: 106 - balm_publicationscheduler.t (Failed) - 117 - balst_stacktraceprintutil.t (Failed) - 160 - balxml_minireader.t (Failed) - 324 - bdldfp_decimalimputil.t (Failed) - 327 - bdldfp_decimalutil.t (Failed) - 359 - bdlma_concurrentmultipool.t (Failed) - 373 - bdlma_multipool.t (Failed) - 395 - bdls_memoryutil.t (Failed) - 399 - bdls_processutil.t (Failed) - 532 - bslim_formatguard.t (Failed) - 635 - bslmf_istransparentpredicate.t (Failed) - 706 - bslmt_threadutil.t (Failed) - 711 - bslmt_timedsemaphore.t (Failed) - 787 - bsls_stopwatch.t (Failed) - 793 - bsls_unspecifiedbool.t (Failed) - 811 - bslstl_chrono.t (Failed) - 822 - bslstl_function.t (Failed) - 824 - bslstl_function_invokerutil.t (Failed) - 881 - bslstl_stringview.t (Failed) + 118 - balst_stacktraceprintutil.t (Failed) + 161 - balxml_minireader.t (Failed) + 274 - bdlcc_boundedqueue.t (Failed) + 325 - bdldfp_decimalimputil.t (Failed) + 328 - bdldfp_decimalutil.t (Failed) + 360 - bdlma_concurrentmultipool.t (Failed) + 374 - bdlma_multipool.t (Failed) + 396 - bdls_memoryutil.t (Failed) + 400 - bdls_processutil.t (Failed) + 534 - bslim_formatguard.t (Failed) + 637 - bslmf_istransparentpredicate.t (Failed) + 713 - bslmt_timedsemaphore.t (Timeout) + 789 - bsls_stopwatch.t (Failed) + 813 - bslstl_chrono.t (Failed) + 824 - bslstl_function.t (Failed) + 826 - bslstl_function_invokerutil.t (Failed) + 883 - bslstl_stringview.t (Failed) ```

Platform: macOS Monterey Version 12.1, Mac mini (M1, 2020)

Darwin minim 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64

Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin