Merged
Conversation
These were predicated on the knowledge that internally the OpenImageIOReader used an OIIO::ImageCache, but that is no longer the case.
Tests are always run via Python, so it's better just to hide the C++ entirely, rather than add symbol exports for stuff nobody needs.
Even though we're deliberately hiding all the implementation of the class in .cpp files, this is not enough to stop the compiler automating generating typeinfo symbols in every translation unit that includes the TypedObjectPlug header. This meant that libGaffer had one copy of the symbol (the one we wanted), but python/Gaffer/_Gaffer.so had its own copy. On Mac this broke the python bindings with this error :
```
ArgumentError: Python argument types in
InternedStringVectorDataPlug.defaultValue(InternedStringVectorDataPlug)
did not match C++ signature:
defaultValue(boost::intrusive_ptr<Gaffer::TypedObjectPlug<IECore::TypedData<std::__1::vector<IECore::InternedString, std::__1::allocator<IECore::InternedString> > > > >, bool _copy=True)
```
Because we had two typeinfo symbols for the same class, type comparisons were failing and boost::python believed it was not receiving an object of the right type. This didn't occur on Linux, because there boost python compares typeinfo names rather than typeinfo addresses.
The solution is to declare the TypedObjectPlug classes as `extern template`, preventing the compiler from emitting typeinfo symbols except when compiling libGaffer.
In addition to the -Werror compiler flag that was always on before, this also controls the -fatal_warnings linker flag, which was always off before.
Contributor
|
Feel free to merge once the dependencies are updated and Travis is content. |
This provides the symbol visibility handling from Cortex 10.0.0-a13
The GafferImageTest library no longer exists - it was effectively removed in 3df6cd8.
Contributor
|
I'm not sure what's going on, but the travis tests have failed twice now in a way that looks like it couldn't even install gaffer. |
Member
Author
|
I'm busy wrangling updates to the dependencies project, pushing new builds as I find new problems. I've been updating things for VFXPlatform 2018 and there have been a few teething problems. Hang tight... |
Member
Author
|
Still got some issues to fix - there's one which is a VDB symbol visibility issue on Mac (I have a fix in the works for that), but mostly it's just unrelated build issues with the dependencies. I'm calling it a day now though... |
Based on the canonical example at http://www.openvdb.org/documentation/doxygen/codeExamples.html#sGettingMetadata : - Use `staticTypeName()` rather than hardcoded strings - Use `static_cast()` rather than `DynamicPtrCast()` (because we've already checked the type) Other than simplifying things, the motivator here is that the current code was silently failing on OSX. This was because the dynamic_cast was failing, because openvdb doesn't mark the TypedMetadata classes as exported. I presume this led to libGafferVDB.so and libopenvdb.so having different copies of the typeinfo. Typeinfo comparisons on OSX compare the symbol address, so we would need both libraries to share the same symbol for the comparison to succeed. We get away with it on Linux because there typeinfo comparisons compare the typename strings instead. Note that this was also fixable by enclosing the openvdb headers in IECORE_PUSH/POP_DEFAULT_VISIBILITY, but it seemed worth following the canonical example instead since it also simplifies the code.
Precise doesn't meet the glibc requirements for VFXPlatform 2018 (it has 2.15, but 2.17 is required as a minimum). Support for it was also discontinued as of April 2017. Trusty provides glibc 2.19 and is supported until April 2019. It is also the default distro for Travis at the time of writing.
Since the AlembicInput node was removed, GafferScene no longer needs any symbols from IECoreAlembic. We now use a startup file to load IECoreAlembic in the same was as we do for IECoreUSD. For some reason this change was necessary to allow `SceneReaderTest.testAlembic` to pass on Travis, although it was passing OK for me locally. Perhaps some issue whereby the linker on Travis was optimising away unused libraries?
I've spent hours looking at this, both now and the first time we tried to update to the Trusty image. I'm still not sure what's going on, but I've grabbed the image being displayed in the window at the point of failure and copyied it out of the docker container, and it is as it should be. I'm chalking this up to some oddball xvfb problem and moving on...
Member
Author
|
Finally coaxed the Travis tests over the line and merged... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the Gaffer equivalent of ImageEngine/cortex#695. It'll need that merged into GafferHQ/dependencies before the tests will pass.