Re: [swift-corelibs-dev] Debugging failures seen only in CI

2017-05-23 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, In this context, would it be acceptable if we add (temporarily) some diagnostic prints to TestNSURLSession to log information only on failures?  Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -Pushkar N Kulkarni/India/IBM wrote: -To:

[swift-corelibs-dev] Debugging failures seen only in CI

2017-05-18 Thread Pushkar N Kulkarni via swift-corelibs-dev
Over the past few months, we've seen random and intermittent failures in the URLSession tests in TestFoundation in the CI builds running on Ubuntu 16.04. Surprisingly, these failures never occur on PR builds. We've tried to reproduce them locally (on matching Ubuntu levels) and fixed locally observ

Re: [swift-corelibs-dev] Want to contribute

2017-05-02 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Nathaniel, A good place to start is the open Foundation bugs. This query lists all the open Foundation issues. The other way to start is to go through the swift-corelibs-foundation project and search for unimplemented methods and properties (you can simply grep for "NSUnimplemented") and chose a

Re: [swift-corelibs-dev] URLSession test fest!

2017-03-14 Thread Pushkar N Kulkarni via swift-corelibs-dev
Thanks Tony. I revisited your first email in this regard and a standalone tool sounds like the better idea here, given we'd want to try all possible configurations of URLSession and also possibly subject it to some stress.Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability -

[swift-corelibs-dev] More on the memory leak in NSString/String.cString(with:)

2017-03-09 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hello there,  We have been talking about a known memory leak in String.cString(using: encoding) and String.utf8String over a JIRA report and a closed PR where we considered the option of  freeing up the memory allocated by NSString.cString() in String.cString() - this approach isn’t acceptable beca

Re: [swift-corelibs-dev] URLSession test fest!

2017-03-09 Thread Pushkar N Kulkarni via swift-corelibs-dev
Peter: I agree. A stable testing infrastructure is absolutely necessary.  Tony: I am curious about where the sources for these tests (that use the external httpbin.org) will be placed? Will it makes sense to have them in TestFoundation and have a guard to exclude them during normal test execution?P

Re: [swift-corelibs-dev] URLSession test fest!

2017-03-09 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, PRs 911 and 913 reminded me of this conversation you started. The current unit testing infrastructure for URLSession may prove insufficient for future contributions. I've been looking at these tests written by Mike Ferenduros and they appear quite exhaustive! The only issue is that they co

Re: [swift-corelibs-dev] libcurl.so.4: no version information available(HTTP/2)

2017-02-09 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Simon, I think that's a warning message from the dynamic linker related to symbol versioning. I'm no expert, but I think the fact that you have a higher libcurl version installed is causing this. In other words, the libcurl version against which libFoundation.so is built (the default on 16.04 is

Re: [swift-corelibs-dev] URLSession test fest!

2017-02-02 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Peter, I'll try to answer your questions to some extent!I’m wondering if anyone has any info on what happened with the (rather more elaborate) “loopback” server and set of tests from @danieleggert’s PR #299:https://github.com/apple/swift-corelibs-foundation/pull/299Is there some reason we ended

Re: [swift-corelibs-dev] Implementing HTTPCookieStorage

2017-02-01 Thread Pushkar N Kulkarni via swift-corelibs-dev
In my opinion, cookies should go into $XDG_DATA_HOMEBut, there was an opinion sometime back, that cookies could go into a `.config` directory. So, I am wondering if $XDG_CONFIG_HOME is also a candidate here :-)Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Di

Re: [swift-corelibs-dev] URLSession test fest!

2017-01-25 Thread Pushkar N Kulkarni via swift-corelibs-dev
That sounds like a great plan, Tony! I am keen on contributing. We all know that current set of unit tests for URLSession are extremely trivial and nowhere close to it's real-world use cases! We've tried using external/public API endpoints in the tests, but intermittent connection failures (network

Re: [swift-corelibs-dev] Implementing HTTPCookieStorage

2017-01-23 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, Thanks! A starting point will really help. I've filed a feature request on JIRA: https://bugs.swift.org/browse/SR-3697Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -anthony.par...@apple.com wrote: -To: Pushkar N Kulkarni

Re: [swift-corelibs-dev] Implementing HTTPCookieStorage

2017-01-20 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, Will, others: Apologies for bringing this up after a long time!I hope we still agree on the use of the "XDG Base Directory Specification". I did a quick read of the spec document. I am happy to file a JIRA report for this.The scope, as I understand it is: CoreFoundation will implement the

Re: [swift-corelibs-dev] Need of inputs for NSExpression

2017-01-16 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, I have a question. >> Some of it is pretty tricky to implement without the dynamic behavior of ObjC though.I guess you were referring to something like "NSExpression(format:"FUNCTION(4.2, 'factorial')")" where `factorial` is a function defined on an extension of NSNumber. Now, this transla

Re: [swift-corelibs-dev] Autoupdating type properties

2016-11-30 Thread Pushkar N Kulkarni via swift-corelibs-dev
anthony.par...@apple.com wrote: -To: Pushkar N Kulkarni/India/IBM@IBMINFrom: Tony Parker Sent by: anthony.par...@apple.comDate: 11/30/2016 01:39PMCc: swift-corelibs-dev <swift-corelibs-dev@swift.org>Subject: Re: [swift-corelibs-dev] Autoupdating type propertiesHi Pushkar,On Nov 29, 2016,

[swift-corelibs-dev] Autoupdating type properties

2016-11-29 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi there, I am curious about how an autoupdating type property like `NSTimeZone.local` could be implemented, given that it is a value (the type is TimeZone). The requirement essentially is that if the default timezone is changed, the change should reflect in all copies of this value.import Foundati

Re: [swift-corelibs-dev] Implementing HTTPCookieStorage

2016-11-14 Thread Pushkar N Kulkarni via swift-corelibs-dev
Thanks Will! "NSHomeDirectory() + "/.foundation/Cookies/shared" seems good to mePushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -Will Stanton wrote: -To: Pushkar N Kulkarni/India/IBM@IBMINFrom: Will Stanton

[swift-corelibs-dev] Implementing HTTPCookieStorage

2016-11-07 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi there, I have spent some time working on a basic implementation of HTTPCookieStorage. In the process, I came across two crucial questions related to cookie persistence:1. How do you persist the cookies?2. Where do you persist them?In my current implementation (https://github.com/apple/swift-core

Re: [swift-corelibs-dev] Calendar identifiers

2016-10-04 Thread Pushkar N Kulkarni via swift-corelibs-dev
libs-dev <swift-corelibs-dev@swift.org>Subject: Re: [swift-corelibs-dev] Calendar identifiersOn 4 Oct 2016, at 10:29, Pushkar N Kulkarni via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:Hi there, I've hit an obstacle while working on a crash seen in initing a Calendar (

[swift-corelibs-dev] Calendar identifiers

2016-10-04 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi there, I've hit an obstacle while working on a crash seen in initing a Calendar (https://bugs.swift.org/browse/SR-2551)For the Calendar initialiser "init(identifier: Calendar.Identifier)", the possible values of Calendar.Identifier are listed here. However, we eventually end up calling "_CFCalen

Re: [swift-corelibs-dev] NSRegularExpression - NS prefix not dropped on Darwin

2016-09-18 Thread Pushkar N Kulkarni via swift-corelibs-dev
support for regex. We wanted to be cautious about taking the name without knowing more about how that feature would shake out.We should get a JIRA filed or a PR up to put the NS back for the class name in swift-corelibs-foundation.Thanks,- TonyOn Sep 16, 2016, at 6:16 AM, Pushkar N Kulkarni via swift-c

Re: [swift-corelibs-dev] URLSession tests

2016-09-17 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Mike, The tests look great and exhaustive to me. I just wish to mention here that we've experienced hangs in CI tests while connecting to some external URLs in the past (you can see a few tests commented out in the current TestNSURLSession for that reason).  It was then recommended, by Tony, tha

[swift-corelibs-dev] NSRegularExpression - NS prefix not dropped on Darwin

2016-09-16 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hello, The NS prefix from NSRegularExpression seems to have been dropped only in open source Foundation. On Darwin the class is still called NSRegularExpression.https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSRegularExpression.swift#L30I went through the Drop NS prefix p

Re: [swift-corelibs-dev] A URLSession crash and potential solutions

2016-09-15 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony,  Thanks! I've submitted a PR. Can you please review it? Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -anthony.par...@apple.com wrote: -To: Pushkar N Kulkarni/India/IBM@IBMINFrom: Tony Parker Sent by: anthony.par...@apple.comDate: 0

[swift-corelibs-dev] A URLSession crash and potential solutions

2016-09-13 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, Philippe, other onlookers, Long note. Kindly bear with me. I've created SR-2631 to report a crash in a very basic usage of URLSession. I'm providing a general synopsis of the problem below and proposing two approaches to solve it.The test case attached to the report creates a URLSession ob

Re: [swift-corelibs-dev] Inconsistent URLSession POST behaviour

2016-09-11 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Michael,I took a quick look at the URLSession code and it looks like the httpBody isn't being picked up anywhere. Could you please create a bug report on https://bugs.swift.org ?Thank you!Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -swift-c

Re: [swift-corelibs-dev] Coercion problems on Linux

2016-09-08 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Philippe, Thanks for your response! I have one more question.>> In general it is because we don't have bridging on Linux.Will we have it in future? Pardon my ignorance. Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -phaus...@apple.com wrote:

[swift-corelibs-dev] Coercion problems on Linux

2016-09-08 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony/Philippe, There've been a few bug reports related to the coercion problems between Swift and Foundation types on Linux. For example this one: https://bugs.swift.org/browse/SR-2477 (Double/Int don't coerce with NSNumber on Linux). Is there any general approach you'd suggest to work around th

Re: [swift-corelibs-dev] Internal Tests

2016-07-08 Thread Pushkar N Kulkarni via swift-corelibs-dev
@testable doesn't work with Foundation. I get this build error:TestFoundation/TestNSURLSession.swift:17:22: error: module 'Foundation' was not compiled for testing    @testable import FoundationIs there an equivalent for Xcode's "Enable Testability" on Linux?Pushkar N Kulkarni, IBM RuntimesSimplici

[swift-corelibs-dev] Implementing(overriding) the "description" property

2016-06-27 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hello,While working with HTTPCookie I realised that the "description" property isn't currently overridden. This is true for many other Foundation classes subclassing NSObject. Is there any guidance around when this property should be overridden (and when not)? Or is it open for implementation/overr

[swift-corelibs-dev] Crash in CFRegularExpressionCreate

2016-05-26 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Philippe, other interested folks:This code that tries to create an NSRegularExpression out of an invalid pattern will crash due to a HALT:do {    let re = try NSRegularExpression(pattern: "\\", options: [])} catch {    print("uh oh")}I dug around CoreFoundation and have the following failure hyp

Re: [swift-corelibs-dev] NSURLSession & libcurl

2016-04-20 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hi Tony, Daniel, Thanks for your responses. Would it be acceptable if, for now, we check for the availability of Dispatch and conditionally compile calls to it into the current implementation of NSURLSession* (something like the  _HAS_DISPATCH__ macro used in CoreFoundation)? This would make NSURLS

Re: [swift-corelibs-dev] NSURLSession & libcurl

2016-04-18 Thread Pushkar N Kulkarni via swift-corelibs-dev
Thanks for your great work on NSURLSession and friends, Daniel!I was wondering if we are only waiting for dispatch to be available on Linux here. In that case, could we have the failing tests (if any) excluded (only on Linux perhaps) and have this merged please? Some of us at IBM would like to work

Re: [swift-corelibs-dev] non-inherited init

2016-03-19 Thread Pushkar N Kulkarni via swift-corelibs-dev
Sorry for intruding!I have the same question about /*@NSCopying*/  Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -swift-corelibs-dev-boun...@swift.org wrote: -To: Daniel Eggert From: Philippe Hausler via swift-corelibs-d

[swift-corelibs-dev] A question about @NSCopying

2016-03-19 Thread Pushkar N Kulkarni via swift-corelibs-dev
I am trying to implement some of the methods and properties in NSOrderedSet. The read-only property "reversedOrderedSet" has the @NSCopying attribute according to the NSOrderedSet class reference. So, I tried to do this: @NSCopying public var reversedOrderedSet: NSOrderedSet {    return NSOrderedSe

Re: [swift-corelibs-dev] Cannot call CFStreamCreatePairWithSocket on Linux

2016-03-15 Thread Pushkar N Kulkarni via swift-corelibs-dev
Just to add to that:I am wondering if this would hamper the implementation of NSStream, NSInputStream and NSOutputStream for Linux.Pushkar N Kulkarni, IBM RuntimesSimplicity is prerequisite for reliability - Edsger W. Dijkstra -Pushkar N Kulkarni/India/IBM wrote: -To: swift-corelibs-dev@swi

[swift-corelibs-dev] Cannot call CFStreamCreatePairWithSocket on Linux

2016-03-15 Thread Pushkar N Kulkarni via swift-corelibs-dev
Hello all,  While attempting a simple Swift client-server program on Linux using CFSocket, I tried to create CFReadStream and CFWriteStream instances using CFStreamCreatePairWithSocket(_:_:_:_). The program compiles and links but it crashes with this:2016-03-15 10:30:17.791 Client[21389:5a501740] C