Solution in case anyone is interested:
- Install the nightly toolchain
- create a
entitlements.xmlwith
<?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>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>
cp /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2021-10-27-a.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/repl_swift .- Create a code sign certificate following Install Gdb Mac: Setup gdb on macOS in 2020 - DEV Community 👩💻👨💻
codesign --entitlements entitlements.xml -fs <cert name> repl_swiftsudo cp repl_swift /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2021-10-27-a.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/repl_swift
Now the REPL should work.