Fix #11089 - Relax codesigning entitlements for Python on mac#11090
Fix #11089 - Relax codesigning entitlements for Python on mac#11090Myoldmopar merged 4 commits intodevelopfrom
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> |
| 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.
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.
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.
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.
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.
| 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.
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