-
Notifications
You must be signed in to change notification settings - Fork 203
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
MAYA-109891: Remove dependency on boost filesystem/system. #1182
Conversation
So all the PFs passed but "2020_python2_osx" when building AL_USDMaya. Very interesting. Looking at the logs to see what is happening. Hmmm, this is the PERFECT example of the pains dealing with Boost. |
Looks good! |
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.
Looks good!
Following up on yesterday's PF failure on "2020_python2_osx", I noticed this linker error in the log which I was not expecting:
What this means that there is still a dependency on "boost::system" coming from "boost::thread". To work around it, one can add "BOOST_SYSTEM_NO_DEPRECATED" compiler definition.
And this indeed works when I encounter the same problem on "2022 OSX python_3". But some how it didn't work for '2020_python2_osx'? The answer lies in the insane combination of boost versions and additional components that comes with the different version of USD:
On MacOS/Linux with Boost v1.61.0, linking against the boost::thread (a.k.a "--with-thread"), will automatically bring in boost::system (a.k.a --with-system) and boost::filesystem (a.k.a --with-filesystem). And somehow on Boost v1.70.0, BOOST_SYSTEM_NO_DEPRECATED works with the present of system/filesystem shared libraries and not with 1.61.0. At this point there are two solutions: 1- Change our internal infrastructure to make "2020 OSX python2" link against boost "v1.70.0". Again, USD v20.11 brings in Boost v1.61.0. Not really sure about the reasons why a single boost version could not be used. 2- Stop relying on boost::thread all together for good. Animal Logic plugin is the only place in the entire project that has a dependency on "boost::thread" and they are using only 3 thread API calls in only one file (LayerManager[.h][.cpp]). There is already an equivalent for these calls in C++14 standard library . I chose option number 2 since it is more logical and avoids us from making any additional internal changes to our build pipeline. Also I have created two additional PRs which are orthogonal to this PR. Once all three PRs are merged, we will have one dependency on boost and that would be |
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.
Thanks @HamedSabri-adsk for this 👍
This PR removes the dependency on boost filesystem/system entirely from the project. Until the transition to C++17 std::filesystem, ghc::filesystem must be used as an alternative across the project.
When building USD,
--with-system
and--with-filesystem
will no longer need to be passed.