NSTask and NSFileHandle implementation

Hei Everyone,

Is anyone working on the NSTask and/or NSFileHandle implementation?

I would like to fix the hangs issue in order to revert [3aa8434][0](disable
NSTask tests for now since it can cause hangs., 2016-01-21), but want to
avoid
duplicating work. Fixing this should also resolve [SR-625][1].

Thanks.

[0]:
https://github.com/apple/swift-corelibs-foundation/commit/3aa8434df50d9513a0ac1646fb52516a092fa728
[1]: [SR-625] NSTask on ubuntu dont redirect stdout to NSPipe · Issue #4464 · apple/swift-corelibs-foundation · GitHub

···

--
Mit freundlichen Grüßen

Alexander Alemayhu

Hey Alexander,

I supplied most of the initial implementation of NSTask, but was holding off on IO redirection until someone tackled NSFileHandle. I can’t say if anyone else on this list is working on this right now, but if not and if you’re really interested in finishing NSFileHandle, I would (very happily!) take care of the relevant implementation in NSTask.

Dan

···

On Apr 16, 2016, at 1:50 AM, Alexander Alemayhu via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Hei Everyone,

Is anyone working on the NSTask and/or NSFileHandle implementation?

I would like to fix the hangs issue in order to revert [3aa8434][0](disable
NSTask tests for now since it can cause hangs., 2016-01-21), but want to avoid
duplicating work. Fixing this should also resolve [SR-625][1].

Thanks.

[0]: disable NSTask tests for now since it can cause hangs. · apple/swift-corelibs-foundation@3aa8434 · GitHub
[1]: [SR-625] NSTask on ubuntu dont redirect stdout to NSPipe · Issue #4464 · apple/swift-corelibs-foundation · GitHub

--
Mit freundlichen Grüßen

Alexander Alemayhu
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

While we’re on the subject, I’ve been out of the loop for a little while: how’s the Linux-side implementation of dispatch sources looking these days? In particular, I’m interested in the status of DISPATCH_SOURCE_TYPE_READ and DISPATCH_SOURCE_TYPE_PROC.

Right now, NSTask is using Good Ol’ CFRunLoops for it’s event handling, and I’d really like to move that over to GCD as soon as I can.

Dan

···

On Apr 16, 2016, at 1:55 PM, Dan Stenmark <daniel.j.stenmark@gmail.com> wrote:

Hey Alexander,

I supplied most of the initial implementation of NSTask, but was holding off on IO redirection until someone tackled NSFileHandle. I can’t say if anyone else on this list is working on this right now, but if not and if you’re really interested in finishing NSFileHandle, I would (very happily!) take care of the relevant implementation in NSTask.

Dan

On Apr 16, 2016, at 1:50 AM, Alexander Alemayhu via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

Hei Everyone,

Is anyone working on the NSTask and/or NSFileHandle implementation?

I would like to fix the hangs issue in order to revert [3aa8434][0](disable
NSTask tests for now since it can cause hangs., 2016-01-21), but want to avoid
duplicating work. Fixing this should also resolve [SR-625][1].

Thanks.

[0]: disable NSTask tests for now since it can cause hangs. · apple/swift-corelibs-foundation@3aa8434 · GitHub
[1]: [SR-625] NSTask on ubuntu dont redirect stdout to NSPipe · Issue #4464 · apple/swift-corelibs-foundation · GitHub

--
Mit freundlichen Grüßen

Alexander Alemayhu
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Thanks for the reply and your work in NSTask.

I got some encouragement off list and would like to do the remaining implementation work for NSFileHandle.
Not sure how it will go since I am very new to this and learning along, but I will keep you informed.

Looking forward to seeing NSTask and NSFileHandle marked as fully implemented in the [status page][0].

[0]: https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/Status.md

···

On 16 Apr 2016, at 22:55, Dan Stenmark <daniel.j.stenmark@gmail.com> wrote:

Hey Alexander,

I supplied most of the initial implementation of NSTask, but was holding off on IO redirection until someone tackled NSFileHandle. I can’t say if anyone else on this list is working on this right now, but if not and if you’re really interested in finishing NSFileHandle, I would (very happily!) take care of the relevant implementation in NSTask.

Hi Dan:

The Dispatch sources are mostly complete - unfortunately
DISPATCH_SOURCE_TYPE_PROC isn't there and it unlikely to be there in a
hurry. It would ideally need the underlying kqueue library to have
EVFILT_PROC support, which it doesn't today.

Chris

···

From: Dan Stenmark via swift-corelibs-dev <swift-corelibs-dev@swift.org>
To: Alexander Alemayhu <alexander@alemayhu.com>
Cc: Swift core libraries <swift-corelibs-dev@swift.org>
Date: 16/04/2016 22:00
Subject: Re: [swift-corelibs-dev] NSTask and NSFileHandle
implementation
Sent by: swift-corelibs-dev-bounces@swift.org

While we’re on the subject, I’ve been out of the loop for a little while:
how’s the Linux-side implementation of dispatch sources looking these
days? In particular, I’m interested in the status of
DISPATCH_SOURCE_TYPE_READ and DISPATCH_SOURCE_TYPE_PROC.

Right now, NSTask is using Good Ol’ CFRunLoops for it’s event handling,
and I’d really like to move that over to GCD as soon as I can.

Dan

On Apr 16, 2016, at 1:55 PM, Dan Stenmark <daniel.j.stenmark@gmail.com> wrote:

Hey Alexander,

I supplied most of the initial implementation of NSTask, but was holding
off on IO redirection until someone tackled NSFileHandle. I can’t say if
anyone else on this list is working on this right now, but if not and if
you’re really interested in finishing NSFileHandle, I would (very
happily!) take care of the relevant implementation in NSTask.

Dan

On Apr 16, 2016, at 1:50 AM, Alexander Alemayhu via swift-corelibs-dev < swift-corelibs-dev@swift.org> wrote:

Hei Everyone,

Is anyone working on the NSTask and/or NSFileHandle implementation?

I would like to fix the hangs issue in order to revert
[3aa8434][0](disable
NSTask tests for now since it can cause hangs., 2016-01-21), but want to
avoid
duplicating work. Fixing this should also resolve [SR-625][1].

Thanks.

[0]:
https://github.com/apple/swift-corelibs-foundation/commit/3aa8434df50d9513a0ac1646fb52516a092fa728
[1]: [SR-625] NSTask on ubuntu dont redirect stdout to NSPipe · Issue #4464 · apple/swift-corelibs-foundation · GitHub

--
Mit freundlichen Grüßen

Alexander Alemayhu
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Hei Everyone,

I have been reading the documentation the last couple of days and have been
thinking that it would make more sense to try to tackle this via several
incremental changes vs a large pull request some time in the future. What
do you
think?

If that is preferred, I would purpose as a first step to introduce
[tests][1]
for NSFileHandle. Adding tests in general sounds like a good idea, but I
am not
sure how one should test NSFileHandle. Would it be a good starting point
to add
tests for the methods used by [plutil][2]?

Thanks.

[1]:
https://github.com/apple/swift-corelibs-foundation/blob/master/TestFoundation/main.swift

[2]:
https://github.com/apple/swift-corelibs-foundation/blob/master/Tools/plutil/main.swift

···

--
Mit freundlichen Grüßen

Alexander Alemayhu

Wouldn't it still be a huge win to use dispatch for reading from / writing to a file descriptor?

/Daniel

···

On Apr 18, 2016, at 01:52, Chris Bailey via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Hi Dan:

The Dispatch sources are mostly complete - unfortunately DISPATCH_SOURCE_TYPE_PROC isn't there and it unlikely to be there in a hurry. It would ideally need the underlying kqueue library to have EVFILT_PROC support, which it doesn't today.

Chris

From: Dan Stenmark via swift-corelibs-dev <swift-corelibs-dev@swift.org>
To: Alexander Alemayhu <alexander@alemayhu.com>
Cc: Swift core libraries <swift-corelibs-dev@swift.org>
Date: 16/04/2016 22:00
Subject: Re: [swift-corelibs-dev] NSTask and NSFileHandle implementation
Sent by: swift-corelibs-dev-bounces@swift.org

While we’re on the subject, I’ve been out of the loop for a little while: how’s the Linux-side implementation of dispatch sources looking these days? In particular, I’m interested in the status of DISPATCH_SOURCE_TYPE_READ and DISPATCH_SOURCE_TYPE_PROC.

Right now, NSTask is using Good Ol’ CFRunLoops for it’s event handling, and I’d really like to move that over to GCD as soon as I can.

Dan

On Apr 16, 2016, at 1:55 PM, Dan Stenmark <daniel.j.stenmark@gmail.com> wrote:

Hey Alexander,

I supplied most of the initial implementation of NSTask, but was holding off on IO redirection until someone tackled NSFileHandle. I can’t say if anyone else on this list is working on this right now, but if not and if you’re really interested in finishing NSFileHandle, I would (very happily!) take care of the relevant implementation in NSTask.

Dan

On Apr 16, 2016, at 1:50 AM, Alexander Alemayhu via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Hei Everyone,

Is anyone working on the NSTask and/or NSFileHandle implementation?

I would like to fix the hangs issue in order to revert [3aa8434][0](disable
NSTask tests for now since it can cause hangs., 2016-01-21), but want to avoid
duplicating work. Fixing this should also resolve [SR-625][1].

Thanks.

[0]: disable NSTask tests for now since it can cause hangs. · apple/swift-corelibs-foundation@3aa8434 · GitHub
[1]: [SR-625] NSTask on ubuntu dont redirect stdout to NSPipe · Issue #4464 · apple/swift-corelibs-foundation · GitHub

--
Mit freundlichen Grüßen

Alexander Alemayhu
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Hi Alexander,

Small incremental changes is usually a good approach.

As for adding tests first, we can do that but we just need to make sure they don’t fail the build. What approach would you have in mind for that?

- Tony

···

On Apr 22, 2016, at 1:37 AM, Alexander Alemayhu via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Hei Everyone,

I have been reading the documentation the last couple of days and have been
thinking that it would make more sense to try to tackle this via several
incremental changes vs a large pull request some time in the future. What do you
think?

If that is preferred, I would purpose as a first step to introduce [tests][1]
for NSFileHandle. Adding tests in general sounds like a good idea, but I am not
sure how one should test NSFileHandle. Would it be a good starting point to add
tests for the methods used by [plutil][2]?

Thanks.

[1]: https://github.com/apple/swift-corelibs-foundation/blob/master/TestFoundation/main.swift

[2]: https://github.com/apple/swift-corelibs-foundation/blob/master/Tools/plutil/main.swift

--
Mit freundlichen Grüßen

Alexander Alemayhu
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Hi Daniel:

Support for DISPATCH_SOURCE_TYPE_READ should be there. If I remember
correctly its just support for processes and VM memory pressure that isn't
available.

Chris

···

From: Daniel Eggert <danieleggert@me.com>
To: Chris Bailey/UK/IBM@IBMGB
Cc: Dan Stenmark <daniel.j.stenmark@gmail.com>, Swift core libraries
<swift-corelibs-dev@swift.org>
Date: 20/04/2016 02:46
Subject: Re: [swift-corelibs-dev] NSTask and NSFileHandle
implementation

Wouldn't it still be a huge win to use dispatch for reading from / writing
to a file descriptor?

/Daniel

On Apr 18, 2016, at 01:52, Chris Bailey via swift-corelibs-dev < swift-corelibs-dev@swift.org> wrote:

Hi Dan:

The Dispatch sources are mostly complete - unfortunately
DISPATCH_SOURCE_TYPE_PROC isn't there and it unlikely to be there in a
hurry. It would ideally need the underlying kqueue library to have
EVFILT_PROC support, which it doesn't today.

Chris

From: Dan Stenmark via swift-corelibs-dev <
swift-corelibs-dev@swift.org>
To: Alexander Alemayhu <alexander@alemayhu.com>
Cc: Swift core libraries <swift-corelibs-dev@swift.org>
Date: 16/04/2016 22:00
Subject: Re: [swift-corelibs-dev] NSTask and NSFileHandle
implementation
Sent by: swift-corelibs-dev-bounces@swift.org

While we’re on the subject, I’ve been out of the loop for a little while:
how’s the Linux-side implementation of dispatch sources looking these
days? In particular, I’m interested in the status of
DISPATCH_SOURCE_TYPE_READ and DISPATCH_SOURCE_TYPE_PROC.

Right now, NSTask is using Good Ol’ CFRunLoops for it’s event handling,
and I’d really like to move that over to GCD as soon as I can.

Dan

On Apr 16, 2016, at 1:55 PM, Dan Stenmark <daniel.j.stenmark@gmail.com> wrote:

Hey Alexander,

I supplied most of the initial implementation of NSTask, but was holding
off on IO redirection until someone tackled NSFileHandle. I can’t say if
anyone else on this list is working on this right now, but if not and if
you’re really interested in finishing NSFileHandle, I would (very
happily!) take care of the relevant implementation in NSTask.

Dan

On Apr 16, 2016, at 1:50 AM, Alexander Alemayhu via swift-corelibs-dev < swift-corelibs-dev@swift.org> wrote:

Hei Everyone,

Is anyone working on the NSTask and/or NSFileHandle implementation?

I would like to fix the hangs issue in order to revert
[3aa8434][0](disable
NSTask tests for now since it can cause hangs., 2016-01-21), but want to
avoid
duplicating work. Fixing this should also resolve [SR-625][1].

Thanks.

[0]:
https://github.com/apple/swift-corelibs-foundation/commit/3aa8434df50d9513a0ac1646fb52516a092fa728

[1]: [SR-625] NSTask on ubuntu dont redirect stdout to NSPipe · Issue #4464 · apple/swift-corelibs-foundation · GitHub

--
Mit freundlichen Grüßen

Alexander Alemayhu
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev