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

Fixed static linking on C++ lib on MacOS #5581

Merged
merged 3 commits into from
Feb 7, 2020

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Nov 7, 2019

Motivation

Static linking of C++ client lib on MacOS (which is used in building the Python wheel file) got broken in #4071. Making sure we link statically with all the libs minus libz and libcurl.

@merlimat merlimat added type/bug The PR fixed a bug or issue reported a bug area/build labels Nov 7, 2019
@merlimat merlimat added this to the 2.4.2 milestone Nov 7, 2019
@merlimat merlimat self-assigned this Nov 7, 2019
@aahmed-se
Copy link
Contributor

it's broken in jenkins

 CMakeFiles/Makefile2:351: recipe for target 'examples/CMakeFiles/SampleConsumerListener.dir/all' failed
make[1]: *** [examples/CMakeFiles/SampleConsumerListener.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 81%] Linking CXX shared library _pulsar.so
[ 81%] Linking CXX executable perfConsumer
[ 81%] Linking CXX executable perfProducer
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::internal::WireFormatLite::WriteInt64(int, long, google::protobuf::io::CodedOutputStream*)'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `vtable for google::protobuf::MessageLite'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::MessageLite::ParseFromArray(void const*, int)'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::io::CodedOutputStream::~CodedOutputStream()'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::internal::WireFormatLite::WriteDouble(int, double, google::protobuf::io::CodedOutputStream*)'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::internal::VerifyVersion(int, int, char const*)'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBool(int, bool, google::protobuf::io::CodedOutputStream*)'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to `google::protobuf::internal::WireFormatLite::WriteUInt32(int, unsigned int, google::protobuf::io::CodedOutputStream*)'
../lib/libpulsar.so.2.5.0-SNAPSHOT: undefined reference to 

@wolfstudy
Copy link
Member

@merlimat l will change the Milestone to 2.4.3. So we can cut 2.4.2 and if needed
2.4.3 in a few weeks.

@wolfstudy wolfstudy modified the milestones: 2.4.2, 2.4.3 Nov 13, 2019
@aahmed-se
Copy link
Contributor

we need to exclude the python lib from the static build /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python

	@rpath/_pulsar.so (compatibility version 0.0.0, current version 0.0.0)
	/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python (compatibility version 3.7.0, current version 3.7.0)
	/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)

@tuteng
Copy link
Member

tuteng commented Dec 9, 2019

run java8 tests
run cpp tests

1 similar comment
@aahmed-se
Copy link
Contributor

run java8 tests
run cpp tests

@jiazhai
Copy link
Member

jiazhai commented Jan 6, 2020

run java8 tests
run integration tests

@tuteng
Copy link
Member

tuteng commented Jan 13, 2020

retest this please

@tuteng
Copy link
Member

tuteng commented Jan 13, 2020

run cpp tests
run java8 tests

@tuteng
Copy link
Member

tuteng commented Jan 17, 2020

run cpp tests

1 similar comment
@tuteng
Copy link
Member

tuteng commented Jan 19, 2020

run cpp tests

@sijie sijie modified the milestones: 2.4.3, 2.6.0 Jan 22, 2020
@merlimat merlimat merged commit 125a588 into apache:master Feb 7, 2020
@merlimat merlimat deleted the fix-macos-link branch February 7, 2020 05:24
aahmed-se pushed a commit to aahmed-se/pulsar that referenced this pull request Feb 11, 2020
* Fixed static linking on C++ lib on MacOS

* Use `-undefined dynamic_lookup` when linking on Mac to not include python's own runtime

* Fixed searching for protobuf
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Feb 23, 2020
* Fixed static linking on C++ lib on MacOS

* Use `-undefined dynamic_lookup` when linking on Mac to not include python's own runtime

* Fixed searching for protobuf
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Mar 21, 2020
* Fixed static linking on C++ lib on MacOS

* Use `-undefined dynamic_lookup` when linking on Mac to not include python's own runtime

* Fixed searching for protobuf

(cherry picked from commit 125a588)
tuteng pushed a commit that referenced this pull request Apr 13, 2020
* Fixed static linking on C++ lib on MacOS

* Use `-undefined dynamic_lookup` when linking on Mac to not include python's own runtime

* Fixed searching for protobuf

(cherry picked from commit 125a588)
jiazhai pushed a commit to jiazhai/pulsar that referenced this pull request May 18, 2020
* Fixed static linking on C++ lib on MacOS

* Use `-undefined dynamic_lookup` when linking on Mac to not include python's own runtime

* Fixed searching for protobuf

(cherry picked from commit 125a588)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
* Fixed static linking on C++ lib on MacOS

* Use `-undefined dynamic_lookup` when linking on Mac to not include python's own runtime

* Fixed searching for protobuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build release/2.4.3 release/2.5.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants