Re: [swift-users] Communicating with dynamically loaded swift library

2017-10-07 Thread Ján Kosa via swift-users
I was afraid it will come to that :) I will try to make something tonight, either it will help you fix it, or I will find out what I did wrong On 8 October 2017 at 09:49, Daniel Dunbar wrote: > Is it possible for you to make a small test package that shows the >

Re: [swift-users] Communicating with dynamically loaded swift library

2017-10-07 Thread Daniel Dunbar via swift-users
Is it possible for you to make a small test package that shows the problem, and file a bug in bugs.swift.org? There may be something we need to fix in SwiftPM before this can work (because of our linking model). - Daniel > On Oct 7, 2017, at 10:42 PM, Ján Kosa via swift-users

Re: [swift-users] Communicating with dynamically loaded swift library

2017-10-07 Thread Ján Kosa via swift-users
That is exactly what I did. The only package that depends on the protobuf is the PluginInterface. Both MyPlugin and and PluginConsumer depend on the PluginInterface and not on the protobuf itself. I had to shuffle around my dependencies a bit, which resulted in smaller number of dependencies but

[swift-users] Hacking the swift compiler to use the llvm wasm target

2017-10-07 Thread Fabio Kaminski via swift-users
Hello, I was playing a liitle bit with the Swift compiler to it could use the WebAssembly LLVM backend, the same way Clang already do it right now. Well, i've implemented the toolchain ok, but now its asking me for a Sdk for the new toolchain. My question is: How can i create a new runtime for

Re: [swift-users] Swift 4.0 LLDBFrontend Crash

2017-10-07 Thread Edward Connell via swift-users
Hi Michael, No I am not evaluating an expression or anything. This all worked fine in past builds. I simply set a breakpoint in a function and after stopping while gathering values for the debugger view, it crashes. It doesn't crash in all functions, but it does crash when trying to stop in many

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Lane Schwartz via swift-users
Bizarre. And 10/5 is no longer available for download. $ wget > https://swift.org/builds/development/ubuntu1604/swift-DEVELOPMENT-SNAPSHOT-2017-10-05-a/swift-DEVELOPMENT-SNAPSHOT-2017-10-05-a-ubuntu16.04.tar.gz > --2017-10-07 11:49:56-- >

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Edward Connell via swift-users
$ find ~/swift -name "*dispatch*" /home/ed/swift/usr/lib/swift/linux/libdispatch.la /home/ed/swift/usr/lib/swift/linux/libdispatch.so /home/ed/swift/usr/lib/swift/dispatch /home/ed/swift/usr/lib/swift/dispatch/dispatch.h On Sat, Oct 7, 2017 at 9:51 AM, Lane Schwartz wrote:

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Lane Schwartz via swift-users
Edward, Could you please try running this command wherever your swift-DEVELOPMENT* directory is located? find swift-DEVELOPMENT-SNAPSHOT-* -name "*dispatch*" Thanks, Lane On Sat, Oct 7, 2017 at 11:47 AM, Edward Connell wrote: > No I installed it yesterday so 10/5 was

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Lane Schwartz via swift-users
Strange. 10/5 is not available to download. And the 10/6 release doesn't have libdispatch. On Sat, Oct 7, 2017 at 11:47 AM, Edward Connell wrote: > No I installed it yesterday so 10/5 was the current one > > On Sat, Oct 7, 2017 at 9:36 AM, Lane Schwartz

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Edward Connell via swift-users
No I installed it yesterday so 10/5 was the current one On Sat, Oct 7, 2017 at 9:36 AM, Lane Schwartz wrote: > Do you mean 10/6? I don't see a 10/5 build. > > On Sat, Oct 7, 2017 at 11:26 AM, Edward Connell > wrote: > >> I had the same problem with the

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Edward Connell via swift-users
I had the same problem with the 9/30 build, but the 10/5 build worked for me. On Sat, Oct 7, 2017 at 9:21 AM, Alex Blewitt via swift-users < swift-users@swift.org> wrote: > This sounds like a bug. There were some changes recently to migrate the > build towards CMake and it may be that they have

Re: [swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Alex Blewitt via swift-users
This sounds like a bug. There were some changes recently to migrate the build towards CMake and it may be that they have broken the build accordingly. Since I can't find one, can you create a bug at https://bugs.swift.org with the snapshot build that you saw the issue is? Alex > On 7 Oct

[swift-users] Using libdispatch with Trunk Development snapshot

2017-10-07 Thread Lane Schwartz via swift-users
Hi, I'm on Ubuntu 16, and I'd like to try out the current Trunk Development snapshot. I successfully downloaded and installed it. But when I tried compiling my sample program with it, I got an error that libdispatch wasn't available. I looked in the directory, and sure enough, the development

Re: [swift-users] Communicating with dynamically loaded swift library

2017-10-07 Thread Ján Kosa via swift-users
I tried to use @_exported and it helped somewhat. While I still have same warnings, size of the PluginInterface library went down by 6mb (to 120kb) so it looks like Protobuf is no longer statically linked to it. However, size of PluginConsumer executable went up by same 6mb, it looks like it is

Re: [swift-users] Communicating with dynamically loaded swift library

2017-10-07 Thread Geordie Jay via swift-users
Ján Kosa schrieb am Sa. 7. Okt. 2017 um 13:34: > I tried swift package clean, but it didn't help > > "Try to ensure the plugin provider module (libA) is (only) being compiled > into its standalone shared library file." > How do I go about this? It is 3rd party module, it

Re: [swift-users] Communicating with dynamically loaded swift library

2017-10-07 Thread Ján Kosa via swift-users
I tried swift package clean, but it didn't help "Try to ensure the plugin provider module (libA) is (only) being compiled into its standalone shared library file." How do I go about this? It is 3rd party module, it doesn't define any products (https://github.com/apple/swift-protobuf.git). Is

Re: [swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Glen Huang via swift-users
Works like a charm, thanks. > On 7 Oct 2017, at 2:56 PM, Slava Pestov wrote: > > You can try upcasting the value to NSObject first, and then performing a > conditional downcast to Controller1 and Controller2. At this point the type > checker will not have enough information

Re: [swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Slava Pestov via swift-users
You can try upcasting the value to NSObject first, and then performing a conditional downcast to Controller1 and Controller2. At this point the type checker will not have enough information to decide that the cast always fails, and should no longer emit a warning. Slava > On Oct 6, 2017, at

Re: [swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Glen Huang via swift-users
Done, https://bugs.swift.org/browse/SR-6083 In the mean time, is there any workaround? Or it’s not possible to check the concrete type without this issue being fixed? > On 7 Oct 2017, at 2:44 PM, Slava Pestov wrote: > > Oh I see. I

Re: [swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Slava Pestov via swift-users
Oh I see. I think the problem is that with Objective-C generics, you can always cast from Foo to Foo, because the type parameters do not really exist. Swift’s type checking logic for casts assumes Swift generic semantics, where in general Foo and Foo are unrelated types. Do you mind filing a

Re: [swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Glen Huang via swift-users
NSFetchedResultsController is the class from Core Data: https://developer.apple.com/documentation/coredata/nsfetchedresultscontroller > On 7 Oct 2017, at 2:38 PM, Slava Pestov wrote: > > Can you post a self-contained example, including the declaration of >

Re: [swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Slava Pestov via swift-users
Can you post a self-contained example, including the declaration of NSFetchedResultsController? Slava > On Oct 6, 2017, at 11:28 PM, Glen Huang via swift-users > wrote: > > Hi, > > I defined some concrete classes inheriting from a generic class like this: > > class

[swift-users] How to check the type of a concrete class that inherits from a generic class?

2017-10-07 Thread Glen Huang via swift-users
Hi, I defined some concrete classes inheriting from a generic class like this: class Controller1: NSFetchedResultsController {} class Controller2: NSFetchedResultsController {} And I assign them a shared delegate, and in the delegate method: func controllerWillChangeContent(_ controller: