From a7a68866a19eb41e85083a23025a95e19bbd1dc6 Mon Sep 17 00:00:00 2001 From: Kare Morstol Date: Mon, 9 Nov 2015 21:45:54 +0100 Subject: [PATCH] Use $SWIFTSHELL_FRAMEWORK_PATH instead of $DYLD_FRAMEWORK_PATH in the swiftshell launcher script. Because of this change in El Capitan: "Spawning children processes of processes restricted by System Integrity Protection, such as by launching a helper process in a bundle with NSTask or calling the exec(2) command, resets the Mach special ports of that child process. Any dynamic linker (dyld) environment variables, such as DYLD_LIBRARY_PATH, are purged when launching protected processes." https://developer.apple.com/library/prerelease/mac/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html --- Misc/swiftshell | 2 +- README.md | 2 +- SwiftShellTests/Scripts/runtests.bash | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Misc/swiftshell b/Misc/swiftshell index 5a9fa10..6b7e4f4 100755 --- a/Misc/swiftshell +++ b/Misc/swiftshell @@ -6,7 +6,7 @@ # The folders where Swift can find the frameworks it imports as modules. # SwiftShell.framework must be in one of these. -FRAMEWORKS_PATH=$DYLD_FRAMEWORK_PATH:~/Library/Frameworks:/Library/Frameworks +FRAMEWORKS_PATH=$SWIFTSHELL_FRAMEWORK_PATH:~/Library/Frameworks:/Library/Frameworks # Add a : to the beginning if not already there if [[ $FRAMEWORKS_PATH != :* ]] diff --git a/README.md b/README.md index b5a486d..91e33e9 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Launch with e.g. `ls | print_linenumbers.swift` - Copy/link `Misc/swiftshell` to your bin folder or anywhere in your PATH. - To install the framework itself, either: - run `xcodebuild install` from the project's root folder. This will install the SwiftShell framework in ~/Library/Frameworks. - - _or_ run `xcodebuild` and copy the resulting framework from the build folder to your library folder of choice. If that is not "~/Library/Frameworks", "/Library/Frameworks" or a folder mentioned in the $DYLD_FRAMEWORK_PATH environment variable then you need to add your folder to $DYLD_FRAMEWORK_PATH. + - _or_ run `xcodebuild` and copy the resulting framework from the build folder to your library folder of choice. If that is not "~/Library/Frameworks", "/Library/Frameworks" or a folder mentioned in the $SWIFTSHELL_FRAMEWORK_PATH environment variable then you need to add your folder to $SWIFTSHELL_FRAMEWORK_PATH. ## License diff --git a/SwiftShellTests/Scripts/runtests.bash b/SwiftShellTests/Scripts/runtests.bash index 3ae3dca..500dbba 100755 --- a/SwiftShellTests/Scripts/runtests.bash +++ b/SwiftShellTests/Scripts/runtests.bash @@ -12,7 +12,7 @@ if [ $? -ne 0 ]; then fi # Make sure the swiftshell script will use the newly built framework. -export DYLD_FRAMEWORK_PATH=$PROJECT_ROOT/build/Release/ +export SWIFTSHELL_FRAMEWORK_PATH=$PROJECT_ROOT/build/Release/ # Import the unit testing script. . assert.sh