Using an SPM built module in REPL


(Swift Studies) #1

I have often wanted to quickly test a module I have built in the REPL after building... I can get so far, but then bump up against a problem where it can't seem to find the right symbols. I'm sure I'm doing something simple wrong but the flow is:

swift build

This correctly builds the module, and I can see .build/debug/PipMath.swiftmodule afterwards

So I try to run the REPL with the new module available for import

swift -I .build/debug

Which works and I can....

1> import CoreGraphics
2> import PipMath
3> print(random(from:1.0, to:2.0))
error: Couldn't lookup symbols:
__TF7PipMath6randomFT4fromV12CoreGraphics7CGFloat2toS1__S1_

So it very nearly works, but can't seem to find the symbol. Any ideas what I need to do in addition? It would be very useful for iterative development!

-sstudies


(Max Howell) #2

Possibly a mismatch in the import of the CoreGraphics swift runtime overlay?

Please open a bug with package-manager as the component. https://bugs.swift.org

···

On Mar 26, 2016, at 4:37 AM, Swift Studies via swift-users <swift-users@swift.org> wrote:

I have often wanted to quickly test a module I have built in the REPL after building... I can get so far, but then bump up against a problem where it can't seem to find the right symbols. I'm sure I'm doing something simple wrong but the flow is:

swift build

This correctly builds the module, and I can see .build/debug/PipMath.swiftmodule afterwards

So I try to run the REPL with the new module available for import

swift -I .build/debug

Which works and I can....

  1> import CoreGraphics
  2> import PipMath
  3> print(random(from:1.0, to:2.0))
error: Couldn't lookup symbols:
  __TF7PipMath6randomFT4fromV12CoreGraphics7CGFloat2toS1__S1_

So it very nearly works, but can't seem to find the symbol. Any ideas what I need to do in addition? It would be very useful for iterative development!

-sstudies
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users