-
Notifications
You must be signed in to change notification settings - Fork 358
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
Hide PugiXML symbols via cmake #1944
Hide PugiXML symbols via cmake #1944
Conversation
I'm still getting some pugi symbols in the shared library I think:
|
Thats interesting, when I check the same on both my linux and macOS machines I don't see those symbols visible. I'm also a little suspicious about all the CI failures above too, they appear to fail during cmake generation, claiming that its necessary to export the privately linked static library, which I don't think should be necessary. I don't see that complaint when I build locally - and @DarkDefender if you were able to build with this patch, I'm assuming you didn't see that either. @jstone-lucasfilm - any idea what's going on with the CI here? |
@ld-kerley That's a new error message to me, so I'd need to investigate further to understand what CMake objects to. Usually this category of error is triggered by a validation step that only exists in the very latest version of a package, e.g. CMake, where GitHub Actions tends to be more cutting edge than my local setup. |
I didn't see any cmake failures, no. |
I just tried with latest cmake 3.30 - and still no errors for me - so I'm certainly confused about the CI failures. The main reason I was trying to go the cmake route to resolve this was to be portable - but it doesn't really look like this is portable at all :/. |
@ld-kerley You may have noticed this pattern as well, but in GitHub Actions, it seems as if builds with |
Great clue @jstone-lucasfilm - I was able to reproduce locally with |
This looks good to me, thanks @ld-kerley! @DarkDefender Does this address the issue with PugiXML symbols that you originally reported? |
@jstone-lucasfilm sadly the four symbols from pugi that I posted above still shows up for me. Both in the shared and static libs. Edit: There are of course
|
Note that all pugi symbols are hidden if I just do:
The added Seems like doing what Ray suggested in the issue with simply adding |
I tried a number of different build variations, and I can't get it to build with the PugiXML symbols visible. That said I like the idea of hiding all the symbols in the libraries by default, that can lead to smaller binaries and even faster code in some instances. I don't think we can set @DarkDefender - as I can't replicate your pugiXml symbol visibility, could you pull this update down and try it on your side. @jstone-lucasfilm - I'm pretty sure this is a safe change to make, but I think we should sit on this until after Siggraph, and give people a chance to kick the tires. I'm gonna try building USD against this, but other MateiralX integrators might want to make sure there aren't any symbols that are now hidden that shouldn't be. |
@ld-kerley That seems to do the trick! I just have one nitpick that is not related to the symbols: |
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.
This change looks great to me, @ld-kerley, and I had just one question about the inclusion of a new file.
@@ -0,0 +1,133 @@ | |||
diff -crB v1.9/pugixml.cpp mtlx/pugixml.cpp |
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.
This looks like a new file that has been accidentally included in the PugiXML folder?
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.
Actually, I added that file intentionally. It captures the differences between the local pugiXML code, and the v1.9 release that was used as a base.
I'm not sure if the patch would ever cleanly merge on top of a newer release - but it was intended to make clearer the differences that the MaterialX project has made.
I did leave a note at the bottom of the readme.txt file describing the addition
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.
Ah, I can understand the motivation for including the difference file directly, but I wonder if this actually increases our maintenance burden over time, as the difference file would need to be kept in sync with the actual delta between our code and the off-the-shelf version.
Maybe your text description at the bottom of the README is sufficient here, as a developer can always perform a difference between our code and the off-the-shelf code on their own?
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.
If you don't think it adds clarity - I'm happy to remove it - hopefully we can get back to a non-modified library at some point somewhat soon...
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.
Sounds good, and thanks! Moving away from a modified PugiXML library seems like the right approach, and we'll just need to think through whether it should be accomplished through specification changes (i.e. requiring escape codes for angle brackets) or through refactoring of the codebase (i.e. moving all exceptional behavior from PugiXML to MaterialXFormat).
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
…ontaining the differences against v1.9
0ffa356
to
a60d583
Compare
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
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.
This looks like a good improvement to me, thanks @ld-kerley!
cfa6f7b
into
AcademySoftwareFoundation:main
This changelist assigns a required scope keyword to the linking step for OpenImageIO in MaterialXRender. CMake requires scope keywords to be used in all linking steps after they are used in one, so this change is needed to match the new behavior of mx_add_library introduced in AcademySoftwareFoundation#1944.
This changelist assigns a required scope keyword to the linking step for OpenImageIO in MaterialXRender. CMake requires scope keywords to be used in all linking steps after they are used in one, so this change is needed to match the new behavior of mx_add_library introduced in #1944.
@ld-kerley @jstone-lucasfilm Hey. Is it something you've considered for 1.38 series? Surely, there is some work to be done to make it work (unfortunately, is not as clean as just cherry pick). |
This change uses a symbol map to hide PugiXML symbols from MaterialX libraries when dependencies are built. This avoids conflict with symbols from pugixml.a used by Blender for the Grease Pencil SVG exporter. The root cause of the conflict has been addressed upstream: AcademySoftwareFoundation/MaterialX#1944 However, the patch does not cleanly apply on 1.38, and it not cleat when the next 1.39 is released. Additional complication is that reportedly USD does not yet support MaterialX 1.39. This fix is only for Linux. Similar thing can be applied on macOS, however so far I could not reproduce the issue on macOS. Ref #124173 Pull Request: https://projects.blender.org/blender/blender/pulls/126518
This change uses a symbol map to hide PugiXML symbols from MaterialX libraries when dependencies are built. This avoids conflict with symbols from pugixml.a used by Blender for the Grease Pencil SVG exporter. The root cause of the conflict has been addressed upstream: AcademySoftwareFoundation/MaterialX#1944 However, the patch does not cleanly apply on 1.38, and it not cleat when the next 1.39 is released. Additional complication is that reportedly USD does not yet support MaterialX 1.39. This fix is only for Linux. Similar thing can be applied on macOS, however so far I could not reproduce the issue on macOS. Ref #124173 Pull Request: https://projects.blender.org/blender/blender/pulls/126518 (cherry picked from commit 680a80d)
In response to #1941. Updating cmake to hide the PugiXML symbols.
Creates separate static library for PugiXML and hide the symbols using cmake, so it should be portable.