-
Notifications
You must be signed in to change notification settings - Fork 25k
Fix portability issues to Linux, FreeBSD, and older libc++ #21764
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
Conversation
|
Oh nice! Thank you!
|
…in if its available.
|
Extracted glog changes to #21915 . Will rebase this one once that is merged. |
…ively on all toolchains/STL implementations.
This comment has been minimized.
This comment has been minimized.
…ptr<T> to a base class, but shared_ptr<> does.
|
Just talked to Marc, who will be taking a look at this soon. I’ll wait for his feedback before proceeding. |
|
My feedback is mainly about the API change to What platform are you using with Dinkumware? The callers here are in iOS and Android specific code, and I'm surprised you can target either without using the Apple or Google libraries. The code in I'm not excited about changing the API to support a flawed standard library. But, it should be possible to fix this without changing the API. Keep the argument typed as a
for example. Finally, you should remove the |
…tructor error, and adding a std::move() for that param at the callsite fixed the error.
…inkumware headers has been found.
|
Thanks for taking the time to review! The explicit cast didn't work for me, and I had tried that in September when I first ran into the issue. Something about what you said gave me a fresh idea, and what I ended up doing was wrapping the unique_ptr<> arg in a std::move() so the destructor wouldn't get triggered in the callsite context. That worked! I changed the shared_ptr<> back to unique_ptr<> in the CxxReact, iOS, and Android code. Not sure how that log.h ended up there -- some weird auto-merge fail? I rm'd it. If there's any more feedback, please let me know. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@matthargett merged commit 36916ee into |
Summary: This removes the accidental double include of the header `unistd.h` from `JSBigString.h`. One was added by me as part of #22330, and one by matthargett as part of #21764 [General] [Fixed] - `JSBigString.h`: Removed accidental double include of header `unistd.h` Pull Request resolved: #23297 Differential Revision: D13961223 Pulled By: hramos fbshipit-source-id: c0dba8a475b3c09356d34cb65b989c286793fa67
Summary: Pull Request resolved: facebook#21764 Differential Revision: D13902907 Pulled By: hramos fbshipit-source-id: 640cde865b1bcc5ca43c17d00574b8e2f78ceaf4
Summary: This removes the accidental double include of the header `unistd.h` from `JSBigString.h`. One was added by me as part of facebook#22330, and one by matthargett as part of facebook#21764 [General] [Fixed] - `JSBigString.h`: Removed accidental double include of header `unistd.h` Pull Request resolved: facebook#23297 Differential Revision: D13961223 Pulled By: hramos fbshipit-source-id: c0dba8a475b3c09356d34cb65b989c286793fa67
Summary: Pull Request resolved: facebook#21764 Differential Revision: D13902907 Pulled By: hramos fbshipit-source-id: 640cde865b1bcc5ca43c17d00574b8e2f78ceaf4
Test Plan:
I have a local Linux build (under Windows 10 WSL running Ubuntu 18.04) where I load an app bundle and ensure it doesn't crash, and run some of the gtest tests. I am currently unable to reproduce the cxxreact build in OSS, but this seems to be a known issue. For the record, my commandline for building and running the tests (after using vcpkg to install double-conversion, glog, gflags, and folly):
clang++-6.0 -fuse-ld=gold -o cxxreact-test_clang6_O3_lto_marchnative_g3 -std=c++14 -O3 -flto -g3 -march=native -L/mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/lib -I/mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/include -I/usr/include/webkitgtk-4.0/ -I. -ljavascriptcoregtk-4.0 -lfolly -lglog -ldouble-conversion fabric/events/*.cpp fabric/events/tests/EventsTest.cpp fabric/debug/*.cpp fabric/debug/tests/DebugStringConvertibleTest.cpp cxxreact/*.cpp cxxreact/tests/*.cpp microprofiler/*.cpp jsinspector/*.cpp privatedata/*.cpp jschelpers/JSC*.cpp jschelpers/[UV]*.cpp fabric/core/primitives/*.cpp fabric/core/tests/PrimitivesTest.cpp -lgtest -lgtest_main /mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/lib/libfolly.a /mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/lib/libgtest*.a /mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/lib/libglog.a /mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/lib/libdouble-conversion.a /mnt/c/Users/matt/workspace/vcpkg/installed/x64-linux/lib/libgflags.a -lpthreadOnly two tests fail, which I will investigate and try to fix in a separate PR:
Changelog:
[INTERNAL] [ENHANCEMENT] [ReactCommon/cxxreact] -Fix portability issues on Linux, FreeBSD, and older libc++ to enable fast unit and integration testing