Since swift run --repl
no longer works for me when I have certain packages in my dependencies and neither that post nor the SwiftPM bug have gotten any traction, I'm looking for alternate ways to do what I need. So, how can I start a swift repl
session that'd allow me to import MyModuleName
(a static library target)?
I tried the simplistic swift repl -L .build/debug -I .build/debug
but that only lead to the same module redefinition errors I saw with swift run --repl
and it also failed to find my module:
1> import CellularAutomataGP
error: error while processing module import: /Users/myusername/Documents/Programming/swift/CellularAutomata/.build/debug/Atomics-tool.build/module.modulemap:2:8: redefinition of module 'Atomics'
module Atomics {
^
error: /Users/myusername/Documents/Programming/swift/CellularAutomata/.build/debug/Histogram.build/module.modulemap:2:8: redefinition of module 'Histogram'
module Histogram {
^
error: /Users/myusername/Documents/Programming/swift/CellularAutomata/.build/debug/SwiftBasicFormat-tool.build/module.modulemap:2:8: redefinition of module 'SwiftBasicFormat'
module SwiftBasicFormat {
^
// ... few hundred lines omitted
error: repl.swift:2:8: no such module 'CellularAutomataGP'
import CellularAutomataGP
Frankly it's incredibly annoying that the REPL is now somehow broken compared to 5.10 and that there's seemingly no solution.