Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process: port to Windows #1907

Merged
merged 1 commit into from Feb 14, 2019
Merged

Process: port to Windows #1907

merged 1 commit into from Feb 14, 2019

Conversation

compnerd
Copy link
Collaborator

This implements the NSTask API for Windows.

@compnerd
Copy link
Collaborator Author

@compnerd
Copy link
Collaborator Author

@swift-ci please test

// Ensure that the launch path is set
guard let launchPath = self.executableURL?.path else {
throw NSError(domain: NSCocoaErrorDomain, code: NSFileNoSuchFileError)
}

#if os(Windows)
// TODO(compnerd) quote the commandline correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apple/swift-llvm has an implementation of this, @jmittert should know where.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakepetroules - apple/swift-llvm? Why is that not upstream? I know that llvm has code for unpacking the parameters, I didn't know that it did quoting too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@millenomi - does Foundation pull in LLVM to link against?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don’t link LLVM other than the language runtimes. You’ll have to port that code over to use it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its reasonable to do that as a follow up, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do so, but yup.

Foundation/FileHandle.swift Outdated Show resolved Hide resolved
Foundation/Process.swift Show resolved Hide resolved
@compnerd
Copy link
Collaborator Author

@swift-ci please test

This implements the `NSTask` API for Windows.
@compnerd
Copy link
Collaborator Author

@swift-ci please test

@millenomi millenomi merged commit 3c2fc82 into apple:master Feb 14, 2019
@jckarter
Copy link
Member

jckarter commented Feb 14, 2019

@compnerd It isn't obvious that this caused it, but the Ubuntu 18.04 bot started failing in a Process test after picking up this patch:

https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04/1099/console

11:42:46 Test Case 'TestProcess.test_passthrough_environment' started at 2019-02-14 19:44:05.374
11:42:46 
/home/buildnode/jenkins/workspace/oss-swift-package-linux-ubuntu-18_04/swift-corelibs-foundation/TestFoundation/TestProcess.swift:257: error: TestProcess.test_passthrough_environment : failed - Test failed: InvalidEnvironmentVariable("swi")

@spevans
Copy link
Collaborator

spevans commented Feb 14, 2019

I think that test has been intermittent before, maybe Jenkins is somehow setting some extra environment variables although it will be hard to track down as there are no Ubuntu18.04 CI test servers to debug against.

@jckarter
Copy link
Member

Can the test be disabled or changed to be more robust if it's intermittent?

@spevans
Copy link
Collaborator

spevans commented Feb 14, 2019

It has been disabled in
#1915

@jckarter
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants