APPLE: Make codesigning improvements#3710
APPLE: Make codesigning improvements#3710dgovil wants to merge 6 commits intoPixarAnimationStudios:devfrom
Conversation
|
Filed as internal issue #USD-11198 (This is an automated message. See here for more information.) |
|
Thanks, @sunyab ! |
d1be066 to
0983b32
Compare
|
Thanks, @sunyab Appreciate the notes. Hope you have a good thanksgiving break. |
|
Hey @dgovil, I ran into an error when testing this change earlier. I was testing the process we follow internally when doing QA for USD releases:
This was the result: Since we're now code-signing frameworks, it looks like we're now picking up some Qt frameworks that are hidden deep in the PySide6 Python module. I know we were previously recursing over the entire install directory and signing dylibs, but since we're now looking at frameworks too I wonder if we ought to limit the search that the |
|
Oh good catch. Yeah we should probably only sign the OpenUSD.framework. I can add a check , but if you need to unblock your teams, just let me know if you add it first. |
|
Okay, I added what I think should do the trick. |
| for framework in frameworks: | ||
| framework_name = os.path.splitext(framework)[0] | ||
| if framework_name.lower() not in ["openusd", "opensubdiv", "materialx"]: | ||
| continue |
There was a problem hiding this comment.
Instead of hardcoding a list of names, what do you think about just limiting the search to all .dylib, .so, and .framework files/directories in specific paths directory instead of walking the entire directory structure?
So something like:
codesignPaths = [
os.path.join(install_dir, 'lib'),
os.path.join(install_dir, 'plugin'),
os.path.join(install_dir, 'share/usd')
]
for dir in codesignPaths:
shared_libs = glob.glob(f"{os.path.join(dir, '*.dylib')")
shared_libs += glob.glob(f"{os.path.join(dir, '*.so')")
for lib in shared_libs:
# Codesign..
frameworks = glob.glob(f"{os.path.join(dir, '*.framework')")
for framework in frameworks:
# Codesign...
I like that this is more targeted -- the current implementation winds up signing files in unnecessary places like the build directory.
There was a problem hiding this comment.
Oh yeah that makes sense. I guess I hadn't considered that since I always install into a clean directory, but I'm assuming others may install into a communal directory?
There was a problem hiding this comment.
Oh I see. It's because the usdInstPath is not the final install directory but the full container directory.
There was a problem hiding this comment.
@sunyab Okay, I pushed an update that integrates your solution to filter. I still use my walk within the filtered set because there are some dylibs that are within nested folders that need to be signed.
But it should hopefully resolve what you're seeing
195ae0c to
4e57c2d
Compare
4e57c2d to
e84f930
Compare
Description of Change(s)
This PR overhauls the current code signing setup with the following changes:
This makes code signing much more reliable and faster overall.
This work is needed to enable properly building OpenUSD as a framework
Checklist
I have created this PR based on the dev branch
I have followed the coding conventions
I have added unit tests that exercise this functionality (Reference:
testing guidelines)
I have verified that all unit tests pass with the proposed changes
I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)