-
Notifications
You must be signed in to change notification settings - Fork 460
Fix #11089 - Relax codesigning entitlements for Python on mac #11090
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
…_codesign_target takes a COMPONENT argument
…eValueKeyword now, sign E+ with it Without the com.apple.security.cs.disable-library-validation I can't later on pip install C-extensions into the python_lib/ folder. This is done on OpenStudio SDK in particular...
… still returns 1 due to newline
|
I have tested this PR at https://github.com/jmarrec/EnergyPlus/releases/tag/v25.1.0-WithDSOASpaceListFixes-python-entitlements and confirm that I can now run the defect file I provided. |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <!-- This is needed because otherwise you can't pip install stuff into the python_lib folder --> | ||
| <key>com.apple.security.cs.disable-library-validation</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> |
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.
entitlements
| register_install_codesign_target(energyplus "." Unspecified ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/python_entitlements.xml") | ||
| register_install_codesign_target(energyplusapi "." Unspecified) |
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.
And use it.
The rest of this PR is just improvements around the cmake scripts, but produces no difference.
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.
Here is the before/after output of running ninja package &> ori_log.txt (or new_log.txt)
https://gist.github.com/jmarrec/ddfab0530b97b6acc0af3832bdb434da
| readarray -t changed_files < <(git diff --name-only HEAD^ HEAD src/ tst/ | /bin/grep -E '\.(cpp|cc|c|hpp|hh|h)$') | ||
| file_count=${#changed_files[@]} |
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.
Avoid the clang-format tripping on the case where you do have changed files but none that are C/C++. I've seen @Myoldmopar mention it on another PR recently, just won't bother looking for the link right now.
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.
Yeah, this is good. I don't think I've used readarray for a decade. The -t to trim off each newline is a great fix for this.
Myoldmopar
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.
Looks good to me.
| readarray -t changed_files < <(git diff --name-only HEAD^ HEAD src/ tst/ | /bin/grep -E '\.(cpp|cc|c|hpp|hh|h)$') | ||
| file_count=${#changed_files[@]} |
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.
Yeah, this is good. I don't think I've used readarray for a decade. The -t to trim off each newline is a great fix for this.
|
Alright this can go in to clean up those issues. Thanks @jmarrec |
Pull request overview
Description of the purpose of this PR
Sign energyplus CLI with
com.apple.security.cs.disable-library-validationso that we can load python native extensions that aren't signed with E+ certificate.Pull Request Author
Reviewer