Re: [swift-users] Incorrect Fisher-Yates shuffle in example code

2017-12-16 Thread Daniel Dunbar via swift-users
Would you like to post a PR to fix these issues? - Daniel > On Dec 16, 2017, at 4:34 PM, Nevin Brackett-Rozinsky via swift-users > wrote: > > The example implementation of the Fisher-Yates shuffle found here >

Re: [swift-users] module.modulemap documentation

2017-12-04 Thread Daniel Dunbar via swift-users
That is correct. If you have a suggestion for places you looked in the docs and a reference or explanation would have been good, feel free to open a PR for it! - Daniel > On Dec 3, 2017, at 7:56 PM, Frank Swarbrick wrote: > > Well no wonder I couldn’t find it. So this is a feature of clang/l

Re: [swift-users] module.modulemap documentation

2017-12-03 Thread Daniel Dunbar via swift-users
> On Dec 3, 2017, at 7:42 PM, Frank Swarbrick via swift-users > wrote: > > Where are all of the options/parameters/behaviors/whatever documented? I > can’t for the life of me find it anywhere. GINMF. https://clang.llvm.org/docs/Modules.html - Daniel > > Frank >

Re: [swift-users] Cancelling an SPM build cleanly

2017-11-07 Thread Daniel Dunbar via swift-users
> On Nov 7, 2017, at 10:25 AM, Geordie J wrote: > > I was just reminded of this issue by another thread (thanks Daniel Dunbar for > https://github.com/apple/swift-llbuild/pull/196 > !) > > Is it possible to cancel an SPM build cleanly? If I ru

Re: [swift-users] xcode 9 new build system too aggressive?

2017-11-07 Thread Daniel Dunbar via swift-users
> On Nov 7, 2017, at 10:18 AM, David Baraff wrote: > > Ah. i hadn’t thought about the fact that often-time my first attempt to > build fails. that might well be the deciding thing. > any idea how long before this will show up in a release xcode? weeks? > months? a year? We can’t comment

Re: [swift-users] xcode 9 new build system too aggressive?

2017-11-07 Thread Daniel Dunbar via swift-users
This does sound like a serious bug (and may be one I just fixed https://github.com/apple/swift-llbuild/pull/196), but if its specific to an Apple product please report bugs in Xcode on http://bugreporter.apple.com - Daniel > On Nov 6, 2017, at 10:11 PM, David Baraff via swift-users > wrote:

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 > wrote: > > T

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

2017-10-04 Thread Daniel Dunbar via swift-users
The way that I have done this in the past is pass a protocol as an unsafe pointer to an exposed entry point: ```swift let entryPoint = dlsym(handle, “initializePlugin”) guard entryPoint != nil else { fatalError("missing plugin entry point: \(pluginPath)")

Re: [swift-users] Package Manager test target name conflict

2017-07-29 Thread Daniel Dunbar via swift-users
Since we don’t have any name spacing facility yet, I think the right answer here is for packages to always give their tests a name like Tests. Even though we might conceptually be able to allow a few limited areas of collision, it gets cumbersome when we might offer features like “run all tests

Re: [swift-users] Is there any harm that an @escaping handler never called?

2017-07-11 Thread Daniel Dunbar via swift-users
> On Jul 11, 2017, at 3:55 PM, Zhao Xin via swift-users > wrote: > > For example, I have an async query, I pass it an `@escaping resultHandler`. > If there is any results, the handler will run. However, if the result is > empty, the `@escaping resultHandler` will

Re: [swift-users] Passing Data to a f(void *) function

2017-06-30 Thread Daniel Dunbar via swift-users
> On Jun 30, 2017, at 7:40 AM, Martin R via swift-users > wrote: > > I have a C function > >void myfunc(const void *ptr); > > which is imported to Swift as > >func myfunc(_ ptr: UnsafeRawPointer!) > > This compiles and runs without problems: > >let data = Data(bytes: [1, 2, 3,

Re: [swift-users] swift 4 compiler error tuple parameter does not support destructing

2017-06-29 Thread Daniel Dunbar via swift-users
This is due to SE-0110: https://github.com/apple/swift-evolution/blob/master/proposals/0110-distingish-single-tuple-arg.md but see the additional commentary: https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html For now you can rewrite it as: ``` let filenamelength

Re: [swift-users] arc4random_uniform on Linux is missing from Foundation??

2017-05-22 Thread Daniel Dunbar via swift-users
This function isn't something which comes with Foundation, it is supplied by the BSD libraries on Darwin, but those aren't present on Linux. I recommend looking for a Swift implementation of a high-quality RNG which will meet your needs, rather than trying to rely on a non-portable implementatio

Re: [swift-users] passing command line arguments to `swift test`

2017-05-21 Thread Daniel Dunbar via swift-users
To run one test you can use: swift test -s BasicTests.PathTests/testContains See: swift test --help - Daniel > On May 19, 2017, at 4:34 PM, Kelvin Ma via swift-users > wrote: > > i want to be able to run a single test case at a time instead of my whole > test suite and i’m currently inv

Re: [swift-users] Annotating C APIs without changing the original header files

2017-05-12 Thread Daniel Dunbar via swift-users
We don't have explicit support for api notes in SwiftPM. We discussed it, and it something which probably makes sense, but no one has worked on a design or implementation yet. - Daniel > On May 12, 2017, at 11:32 AM, Michael Gottesman via swift-users > wrote: > > +Ankit > > Michael > >> O

Re: [swift-users] Passing value types or members of value types?

2017-05-06 Thread Daniel Dunbar via swift-users
> On May 6, 2017, at 10:39 PM, Brent Royal-Gordon > wrote: > >> On May 6, 2017, at 10:34 PM, Daniel Dunbar via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> To answer Kelvin's question, yes, the optimizer will be able to see thr

Re: [swift-users] Passing value types or members of value types?

2017-05-06 Thread Daniel Dunbar via swift-users
> On May 6, 2017, at 10:27 PM, Nate Birkholz via swift-users > wrote: > > Classes and structs are different things. Classes are passed by reference, > structs are passed by value with copy on write. This is not correct. Array, and other types, implement copy-on-write themselves, but this is

Re: [swift-users] error: the package has an unsupported layout, unexpected source file(s) found: /Users/maximveksler/Project/Org/Collection/Sources/main.swift

2017-01-24 Thread Daniel Dunbar via swift-users
> On Jan 24, 2017, at 11:57 AM, Maxim Veksler via swift-users > wrote: > > The most recent change I've done is add the Sources/extensions/Jay.swift, now > I'm unable to build the project. > > No idea what could have gone wrong, feedback? > > > ➜ Collection git:(master) ✗ find Sources > Sou

Re: [swift-users] SPM & Library with bridging header

2017-01-21 Thread Daniel Dunbar via swift-users
What is the glue code you need? You can define a C/Obj-C target in the same Swift package, and then use it from your Swift targets. See: https://github.com/apple/swift-package-manager/blob/master/Documentation/Reference.md#source-layouts

Re: [swift-users] Announcement: Official Docker Image for Swift now available

2017-01-21 Thread Daniel Dunbar via swift-users
Awesome, thanks for pushing this forward! - Daniel > On Jan 21, 2017, at 2:10 PM, Swizzlr via swift-users > wrote: > > Hello all, > > I'm pleased to announce that with the assistance of many, many people (see > below), we have released an “official" Docker image for Swift >

Re: [swift-users] SPM & Library with bridging header

2017-01-20 Thread Daniel Dunbar via swift-users
> On Jan 20, 2017, at 9:39 AM, Jordan Rose via swift-users > wrote: > > Hi, Rien. Libraries don’t support bridging headers because the client of the > library has to be able to import the header, and arbitrary bridging headers > may conflict. (This is actually the primary purpose of modules f

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Daniel Dunbar via swift-users
It is an "implicitly unwrapped optional", or IOU. See: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html - Daniel > On Jan 9, 2017, at 4:23 PM, Ethin Probst via swift-users > wrote: > > Hello all, > I was wondering what an

Re: [swift-users] [swift-build-dev] SwiftPM Test Fixtures

2016-11-18 Thread Daniel Dunbar via swift-users
The way that we have been doing this is by using `#file` to derive the location of the test data. It is gross, but it works until we have a real resource story. - Daniel > On Nov 17, 2016, at 7:07 PM, Ryan Lovelett via swift-build-dev > wrote: > > If I have a number of `*.json` files that ar

Re: [swift-users] Using Swift Package Manager with C++

2016-11-12 Thread Daniel Dunbar via swift-users
This was just fixed on trunk: https://bugs.swift.org/browse/SR-3152?jql=text%20~%20%22C%2B%2B%22%20ORDER%20BY%20created%20DESC In the meantime, you can either use a recent snapshot from swift.org, or you can pass `-Xlinker -lc++` on the command line to work around the problem. - Daniel > On

Re: [swift-users] swift3 - Trying to get swift package example to work - Stack Overflow

2016-11-11 Thread Daniel Dunbar via swift-users
Hey Dave, Thanks for pointing this out, we will take a look. - Daniel > On Nov 11, 2016, at 3:35 PM, Dave Yost via swift-users > wrote: > > >> http://stackoverflow.com/questions/40557767/trying-to-get-swift-package-example-to-work >> >>

Re: [swift-users] How to include swift test resource files?

2016-11-10 Thread Daniel Dunbar via swift-users
We do not yet have any kind of story for resources. If you just need data during tests, what you can do is just rely on the tests being run in an environment which has access to the source, so you can use Swift's `#file` to derive the location of your test artifacts from the current source file

Re: [swift-users] Monorepo workflow using SPM

2016-11-09 Thread Daniel Dunbar via swift-users
> On Nov 3, 2016, at 2:06 PM, Erica Sadun via swift-users > wrote: > > I want less of a monorepo than an ability to build a group of orthogonal > elements into a single repo so I don't have to create a separate repo for > every single Swift library I build, especially when there are logical

Re: [swift-users] Monorepo workflow using SPM

2016-11-09 Thread Daniel Dunbar via swift-users
(+ swift-build-dev) Hi Georgios, This is a very timely question, because I have been working on a proposal for solving exactly this problem. Can you take a look at: https://github.com/ddunbar/swift-evolution/blob/multi-package-repos/proposals/-swiftpm-multi-package-repos.md and see if yo

Re: [swift-users] Swift Package Manager and Git submodules

2016-10-30 Thread Daniel Dunbar via swift-users
> On Oct 29, 2016, at 7:22 AM, Anton Bronnikov wrote: > > Thanks, Daniel. > > Yes, on Oct-27 snapshot `Swift version 3.0-dev (LLVM b52fce3ab4, Clang > 4edf31e82f, Swift bf2de4a41c)` if I build with `swift build > --enable-new-resolver` then I do get the expected behaviour. Building with > u

Re: [swift-users] Swift Package Manager and Git submodules

2016-10-28 Thread Daniel Dunbar via swift-users
This sounds like a bug to me, I suspect that the current code isn't causing the submodule to update appropriately. If you have a working example, can you try using the latest OSS snapshot from swift.org, and running: swift package reset swift build --enable-new-resolver and seeing if you get

Re: [swift-users] how to ``swift build`` C library cleanly without using -Xcc -Xlinker and -Xswiftc

2016-10-20 Thread Daniel Dunbar via swift-users
> On Oct 20, 2016, at 7:25 AM, Martin Man via swift-users > wrote: > > Hi guys, > > I’m wrapping three little native C libraries using SPM to a nice swifty > modules. Say cmod1, cmod2, and cmod3. They all in the and are dependencies of > a bigger project. > > Since these legacy C libraries

Re: [swift-users] Swift Package Manager questions

2016-10-17 Thread Daniel Dunbar via swift-users
Hi Ed, No, the package manager in the Xcode 8.1 beta only has minimal bug fixes. You can, however, get this by grabbing a snapshot toolchain from http://swift.org/download. - Daniel > On Oct 17, 2016, at 12:10 PM, Edward Connell via swift-users > wrote: > > Thanks Ankit, > Should I be able

Re: [swift-users] Counting in Threads

2016-10-12 Thread Daniel Dunbar via swift-users
a threaded context. > > Sent from my iPhone > > On Oct 12, 2016, at 8:18 AM, Daniel Dunbar via swift-users > mailto:swift-users@swift.org>> wrote: > >> I suspect one of the actual compiler people might tell me I shouldn't trust >> this, but in pract

Re: [swift-users] Counting in Threads

2016-10-12 Thread Daniel Dunbar via swift-users
I suspect one of the actual compiler people might tell me I shouldn't trust this, but in practice it works: -- import Darwin.C public class AtomicInt32 { public fileprivate (set) var value : Int32 = 0 /// Create a new atomic integer with the specified initial value. public init(_

Re: [swift-users] Performance critical code in Swift

2016-10-01 Thread Daniel Dunbar via swift-users
Yes, it is possible. Exactly how much use of Unsafe style idioms and other performance-focused "workarounds" it requires depends a lot on the code in question. Can you say more about your problem area? - Daniel > On Oct 1, 2016, at 1:30 PM, Игорь Никитин via swift-users > wrote: > > Hello!

Re: [swift-users] Swift Package Manager (SPM) Deployment Target

2016-09-26 Thread Daniel Dunbar via swift-users
There isn't yet a builtin way to manage this. When generating an Xcode project, you can use the undocumented `--xcconfig-overrides` option to pass a path to an extra .xcconfig file you wish to include in the project and have build settings read from. You could then override the deployment target

Re: [swift-users] Stored Property on Protocol Extension

2016-09-12 Thread Daniel Dunbar via swift-users
> On Sep 11, 2016, at 6:12 PM, Tanner Nelson via swift-users > wrote: > > Hey Swift Users, > > I was wondering how you all work around not being able to add stored > properties in extensions (especially protocol extensions). > > I ran into an issue recently where I needed an internal stored

Re: [swift-users] Statically linked binaries on linux

2016-09-01 Thread Daniel Dunbar via swift-users
We don't currently build static versions of the other libraries (Foundation, XCTest), or a support process for picking them up. This is covered by: https://bugs.swift.org/browse/SR-648 As you note, it largely works for Swift-only, so this is feasible but we need someone to drive it. Are you i

Re: [swift-users] Updating the swift.org examples

2016-08-18 Thread Daniel Dunbar via swift-users
Hi Joel, Thank you for pointing this out! > On Aug 18, 2016, at 3:14 AM, Joel Hughes via swift-users > wrote: > > Morning all, > > I've just upgraded to Swift 3 Preview 6 for Ubuntu and have noticed a few > changes. > > First using XCTest: "the name of a test module has no ‘Tests’ suffix" -

Re: [swift-users] repo questions when using example-package-dealer

2016-06-29 Thread Daniel Dunbar via swift-users
I wouldn't say they are "unclean", but they have not been retagged after the latest commits to them, and you are right they probably should be. Feel free to file a bug on this at http://bugs.swift.org . - Daniel > On Jun 29, 2016, at 11:25 PM, Dave Yost wrote: > > Dum

Re: [swift-users] repo questions when using example-package-dealer

2016-06-29 Thread Daniel Dunbar via swift-users
FYI, some of our planned workflow improvements here are covered by: https://github.com/apple/swift-evolution/blob/master/proposals/0082-swiftpm-package-edit.md - Daniel > On Jun 29, 2016, at 7:11 P

Re: [swift-users] Clarification on the role of `CustomStringConvertible`

2016-06-29 Thread Daniel Dunbar via swift-users
gt;> On Jun 29, 2016, at 3:51 PM, Erica Sadun wrote: >> >> On Jun 29, 2016, at 2:33 PM, Daniel Dunbar via swift-users >> wrote: >>> >>> I would like some clarification regarding the expected role of >>> `CustomStringConvertible` for types which h

[swift-users] Clarification on the role of `CustomStringConvertible`

2016-06-29 Thread Daniel Dunbar via swift-users
I would like some clarification regarding the expected role of `CustomStringConvertible` for types which have a natural, lossless, string representation. I don't have good terminology to use here, but is the expectation that the "textual string representation" is a readable description of the o

Re: [swift-users] Swift 3 equivalent of dispatch_barrier_async

2016-06-28 Thread Daniel Dunbar via swift-users
The new spelling is: queue.async(flags: .barrier) { ... } - Daniel > On Jun 28, 2016, at 12:24 PM, Eric Miller via swift-users > wrote: > > I tried searching github's swift-evolution for "dispatch_barrier_async", but > don't see a mention of it. > > Can I migrate this directly to swift 3,

Re: [swift-users] Can Swift 2.3 frameworks be used with a Swift 3.0 app?

2016-06-27 Thread Daniel Dunbar via swift-users
No, this is not possible. All of the code in a single process needs to be compiled with the same version of Swift. - Daniel > On Jun 27, 2016, at 7:04 AM, Ted Bradley via swift-users > wrote: > > So does that mean then that Swift 2.3 and Swift 3.0 can interoperate? > > E.g. > > iOS Targe

Re: [swift-users] New Swift Snapshots Available!

2016-06-21 Thread Daniel Dunbar via swift-users
Can you reduce the problem to a small test case? Please file a bug report on bugs.swift.org for this, and include information on the last toolchain which worked. - Daniel > On Jun 21, 2016, at 5:16 AM, Charles Lane via swift-users > wrote: > > I’m running macOS Sier

Re: [swift-users] SPM - point dependcies to branches

2016-06-20 Thread Daniel Dunbar via swift-users
As you have noticed, we don't have support for this yet. Most requests of this nature are currently in our bug tracker, for example: https://bugs.swift.org/browse/SR-666 - Daniel > On Jun 20, 2016, at 6:14 AM, Anindha Parthy via swift-users > wrote: > > Hi, > > I want to be able to point

Re: [swift-users] Ambiguous parsing of `return`

2016-06-06 Thread Daniel Dunbar via swift-users
Did you try an example? Swift warns about this for this very reason: ``` $ cat x.swift func f0() {} func f1() { return f0() } $ swiftc -c x.swift x.swift:5:3: warning: expression following 'return' is treated as an argument of the 'return' f0() ^ ``` - Daniel > On Jun 6, 2016, at 10

Re: [swift-users] Discrepancy between sharing internal Swift symbols with Obj-C when in an app vs a framework target

2016-06-04 Thread Daniel Dunbar via swift-users
Unfortunately, this is a limitation of the current model for mixed Obj-C and Swift targets. The Swift code is compiled and optimized as a single module, and the only supported external entry points that result from that are the public API, which is then exposed as the "-Swift.h" header file. Ho

Re: [swift-users] Proper syntax for 2D table with initial values

2016-05-23 Thread Daniel Dunbar via swift-users
The type inference used in Swift can perform poorly when used in this fashion. You may be able to get acceptable performance by inserting explicit casts, like: [...] as [UInt8] around each of your individual arrays. If not, my suggestion would be to embed your data in a C function, and expose

Re: [swift-users] String initializers and developer ergonomics

2016-05-09 Thread Daniel Dunbar via swift-users
> On May 9, 2016, at 10:28 AM, Jacob Bandes-Storch via swift-users > wrote: > > On Mon, May 9, 2016 at 10:25 AM, Joe Groff via swift-users > mailto:swift-users@swift.org>> wrote: > > > On May 7, 2016, at 10:39 AM, Austin Zheng via swift-users > > mailto:swift-users@swift.org>> wrote: > > > >

Re: [swift-users] How to package resource files (like *.jpg etc.) with Swift Package Manager?

2016-05-06 Thread Daniel Dunbar via swift-users
We don't currently have any explicit solution for this problem, and also I don't think we are actively tracking this. Note that currently the package manager doesn't really have any features around how you "deploy" your app. Nothing is preventing you from defining your own conventions around ho

Re: [swift-users] make swift compiler to use the precompiled module files

2016-04-29 Thread Daniel Dunbar via swift-users
If the hash value of the module is different then most likely something else is going on -- are you passing any special flags or defines as part of the compiler command? If you run the same command from swiftc on the command line do you see the same behavior? - Daniel > On Apr 29, 2016, at 2:

Re: [swift-users] make swift compiler to use the precompiled module files

2016-04-29 Thread Daniel Dunbar via swift-users
Clang will cache these automatically, can you give more details on exactly what you are seeing? - Daniel > On Apr 28, 2016, at 10:50 PM, Ramakrishna Mallireddy via swift-users > wrote: > > I have these precompiled module files generated every-time I run the swift > compiler. > > _Builtin_s

Re: [swift-users] Help need with SR-1187

2016-04-20 Thread Daniel Dunbar via swift-users
The package manager will add an implicit dependency between the test suite and the target it assumes it is trying to test. In your case, however, your package module is named PlayingCard, and your test module is name CardTests (not PlayingCardTests) so it doesn't find that dependency. This leave

Re: [swift-users] build swift-package-manager-0.1 Linux Swift 2.2

2016-04-06 Thread Daniel Dunbar via swift-users
+Lang `swift build` currently uses the Swift interpreter to get the Package metadata from the Package.swift. That in turn uses the LLVM JIT. It may be that some of what Swift is using is not implemented in the JIT for this platform. This is worth filing a bug on http://bugs.swift.org, if you ha

Re: [swift-users] swift build

2016-04-03 Thread Daniel Dunbar via swift-users
If you build swift yourself you need to point directly at swift-build. Most people grab the pre-built toolchains from swift.org to start trying things out. Have you seen the instructions here: https://swift.org/download/#using-downloads - Daniel > On Apr 3, 2016, at 7:27 PM, Shawn Erickson v

Re: [swift-users] Sporadically undefined symbols during linking

2016-04-02 Thread Daniel Dunbar via swift-users
Are you saying that it fails about 75% of the time even when building from clean, or it fails overall 75% of the time and you have to build from clean to fix? In my experiments it always fails when building just ostrichframework. My guess is that if you build in the IDE you are seeing it sometim

Re: [swift-users] swift-2.2.1-SNAPSHOT-2016-03-28-a.xctoolchain cannot find swift-build

2016-03-30 Thread Daniel Dunbar via swift-users
You should install the development snapshots if you want to try `swift build`. - Daniel > On Mar 30, 2016, at 5:14 PM, Eddy Hahn via swift-users > wrote: > > Hi, > > I have installed the new toolchain and Swift Package Manager. I am missing > the swift-build app. > > > error: unable to i

Re: [swift-users] Serious Issue with Project Preprocessor Build Setting, Xcode 7.3 and Swift.

2016-03-24 Thread Daniel Dunbar via swift-users
(+Jordan) Jordan, did something change here? Were we previously getting these via the Clang importer in a way we aren't anymore? - Daniel > On Mar 24, 2016, at 9:02 AM, James Campbell wrote: > > I've just attached one now. The preprocessor macro is specified in the build > settings. > > In

Re: [swift-users] Serious Issue with Project Preprocessor Build Setting, Xcode 7.3 and Swift.

2016-03-24 Thread Daniel Dunbar via swift-users
Swift has never supported referring directly to macros, it only supports "build configurations". I'm still not sure exactly what you have that could have worked previously. Can you please attach a complete project showing something which worked in 7.2 and does not work now to the bug you filed?

Re: [swift-users] Serious Issue with Project Preprocessor Build Setting, Xcode 7.3 and Swift.

2016-03-24 Thread Daniel Dunbar via swift-users
> On Mar 24, 2016, at 5:21 AM, James Campbell wrote: > > This is the "GCC_PREPROCESSOR_DEFINITIONS" build setting. This previously > imported into swift. But in Xcode 7.3 it no longer does this. Ok, and exactly how are you trying to use them? Via an #if in C or via an #if in Swift? - Daniel

Re: [swift-users] Serious Issue with Project Preprocessor Build Setting, Xcode 7.3 and Swift.

2016-03-23 Thread Daniel Dunbar via swift-users
To follow on to what Joe said, can you provide more info about the exact problem. Is this a C preprocessor definition that you expect to be available in code imported by the Clang importer (i.e., bridging header files, etc.), or is a a macro you are expecting to use within Swift itself? And plea

Re: [swift-users] Swift Package Manager: Linker Flags

2016-01-04 Thread Daniel Dunbar via swift-users
You can't do this via the package manager, but you can include "link" declarations in the module map itself which specify additional linker arguments to plumb through when that module is used. See: http://clang.llvm.org/docs/Modules.html#link-declaration Here is a concrete example, which is ho

Re: [swift-users] How to define interdependent modules in a package?

2016-01-04 Thread Daniel Dunbar via swift-users
> On Dec 27, 2015, at 10:15 PM, Tarun Joshi wrote: > >> We don't yet have anyone actively working on this feature, though... > > If its not pretty complex and you think a beginner like me can > implement it, I'd be happy to help. Some pointers would be helpful :) It's pretty complex. :) We ne

Re: [swift-users] Need to provide compiler switch

2016-01-04 Thread Daniel Dunbar via swift-users
This isn't something we support yet. Can you elaborate on the exact situation? Are you trying to use a system module and need to set some compiler define? - Daniel > On Dec 30, 2015, at 4:13 AM, Ralph Ganszky via swift-users > wrote: > > Hi, > > I try to get some Swift code running, whic

Re: [swift-users] How to define interdependent modules in a package?

2015-12-24 Thread Daniel Dunbar via swift-users
What we hope to do here eventually is have swiftpm "notice" when a build has failed because of a missing dependency, and then automatically help you update the manifest to include it. This allows the dependency specifications to continue to be explicit, which some people believe is important fo

Re: [swift-users] Linux: module for needs -fblocks to compile

2015-12-20 Thread Daniel Dunbar via swift-users
> On Dec 17, 2015, at 1:40 PM, Tom Sheffler via swift-users > wrote: > > I’m learning about Swift on Linux and using modules to wrap C libraries. One > of the things I wanted to do was use libdispatch with blocks from Swift. I > thought it would be easy to use a module to wrap . > > I made

Re: [swift-users] REPL failed

2015-12-20 Thread Daniel Dunbar via swift-users
> On Dec 10, 2015, at 11:07 AM, Dmitri Gribenko wrote: > > On Thu, Dec 10, 2015 at 9:59 AM, Daniel Dunbar > wrote: >> Actually, I am retracting this suggestion in favor of what I think is a >> better one: >> >> What if we change the build process to build up a

Re: [swift-users] Using Swift for interpreted shell scripts?

2015-12-16 Thread Daniel Dunbar via swift-users
> On Dec 16, 2015, at 7:21 AM, @lbutlr via swift-users > wrote: > > On 15 Dec 2015, at 14:12, John Regner wrote: >> Check out this talk from Ayaka on just this topic! >> https://realm.io/news/swift-scripting/ > > Thank you, that looks very promising. > > I didn’t realize the list was set to

Re: [swift-users] memory requirements for building swift on linux?

2015-12-14 Thread Daniel Dunbar via swift-users
For those hitting this issue, you might try building without debug info to see if that helps (build-script -R). - Daniel > On Dec 14, 2015, at 6:55 AM, Kevin Lundberg via swift-users > wrote: > > I was able to build it on my 8GB macbook successfully, but there may be > platform differences

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Daniel Dunbar via swift-users
> On Dec 10, 2015, at 1:01 PM, Matthew Davies via swift-users > wrote: > > Yes I have the protoco​l​, but the problem is that I would want to be able to > call a method on the class that isn't necessarily defined in the protocol. You should only call methods that are defined in the protocol,

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Daniel Dunbar via swift-users
Note that you can define a protocol which will allow your framework to instantiate the type, and to call methods on instances of that type. If you can structure your code in this fashion, it can be very elegant in that it doesn't require factory functions and it is type safe. For example: -- s

Re: [swift-users] Text editor

2015-12-10 Thread Daniel Dunbar via swift-users
There are a wide variety of workflows in the world, some people really enjoy working in the terminal, others don't. Please be mindful of our Code of Conduct: https://swift.org/community/#code-of-conduct and that we want to be open and tolerant of everyones working preferences. - Daniel > On

Re: [swift-users] REPL failed

2015-12-10 Thread Daniel Dunbar via swift-users
Dmitri, this seems to be a common problem. What would you think about creating symlinks in the build tree (when building the appropriate projects), just to smooth over the development process? - Daniel > On Dec 6, 2015, at 12:14 AM, Dmitri Gribenko via swift-users > wrote: > > On Sun, Dec 6

Re: [swift-users] Segfault importing sqlite3.h from a system module

2015-12-05 Thread Daniel Dunbar via swift-users
> On Dec 5, 2015, at 4:29 AM, Michael Buhot wrote: > > Hello, > > I’m getting a segfault when importing sqlite using a swift system module and > the package manager. > I have the following directory structure with a trivial system module and > application: > > CSqlite3/ > Package.swift > m

Re: [swift-users] Dynamic linker DT_RPATH

2015-12-05 Thread Daniel Dunbar via swift-users
> On Dec 5, 2015, at 7:13 AM, Joe Groff wrote: > > >> On Dec 4, 2015, at 8:49 PM, Daniel Dunbar wrote: >> >> >>> On Dec 4, 2015, at 6:37 PM, Ugo Arangino wrote: >>> >>> Why is the Dynamic linker DT_RPATH set, instead of configure it like this >>> `/etc/ld.so.conf.d/swift.conf` or copying

Re: [swift-users] Swift Package website

2015-12-05 Thread Daniel Dunbar via swift-users
Some of our current thoughts on this are here: https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#a-package-index but as the document notes, most of these are just thoughts and not a concrete plan. In lieu of an actual index and tho

Re: [swift-users] "swift build" throws :0: error: no such file or directory: 'build'

2015-12-05 Thread Daniel Dunbar via swift-users
Sounds like you don't have the Swift package's usr/bin in your path, and are using an old `swift` without this support. See full instructions at: https://swift.org/download/#apple-platforms - Daniel > On Dec 5, 2015, at 2:06 PM, Joy Mailer via swift-users > wrote: > > Followed the instruct

Re: [swift-users] Module System

2015-12-05 Thread Daniel Dunbar via swift-users
> On Dec 4, 2015, at 8:54 PM, Severen Redwood wrote: > > How does the module system actually work in Swift? From what I've seen so far > it seems to be pretty tied in with XCode and tools like the package manager. Can you clarify your question a little bit? What specific information are you lo