Skip to content

Fixed for Cygwin #733

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

Closed
wants to merge 1 commit into from

Conversation

tinysun212
Copy link

Now Cygwin can use Swift Package Manager.

@ddunbar
Copy link
Contributor

ddunbar commented Oct 14, 2016

Very cool, thanks for the PR!

@ddunbar
Copy link
Contributor

ddunbar commented Jan 20, 2017

@tinysun212 are you interested in doing more work on this PR? I don't think we should land it as is, and would rather track it in a bug unless you are going to actively update it soon.

Now Cygwin can use Swift Package Manager.
@tinysun212
Copy link
Author

tinysun212 commented Jan 21, 2017

@ddunbar, I rebased and the changes of Sources/libc/libc.swift and Sources/POSIX/stat.swift are removed. They can be resolved elsewhere.
I'll prepare a swift standard library PR instead of libc/libc.swift.

Copy link
Contributor

@ddunbar ddunbar left a comment

Choose a reason for hiding this comment

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

Great, thanks. A couple questions inline...

@@ -165,6 +165,10 @@ public final class ManifestLoader: ManifestLoaderProtocol {
var cmd = [resources.swiftCompilerPath.asString]
cmd += ["--driver-mode=swift"]
cmd += verbosity.ccArgs
#if CYGWIN
cmd += ["-D", "CYGWIN"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used in the current patch?

Copy link
Author

Choose a reason for hiding this comment

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

This is necessary to distinguish Cygwin from other Windows variants.

Copy link
Contributor

Choose a reason for hiding this comment

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

This code is loading the manifest though, and we don't want users to conditionalize their manifests in this way. Since it isn't currently required, I recommend we avoid it here.

@@ -80,9 +80,11 @@ public final class TerminalController {

// Try determining using ioctl.
var ws = winsize()
#if !CYGWIN
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Swift itself not define an os condition for Cygwin?

Copy link
Author

Choose a reason for hiding this comment

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

I couldn't use it.
os(Cygwin) PR (swiftlang/swift#2351) was not accepted for Swift compiler.
There were some opinions that Cygwin is only an environment and not OS, and os(Windows) is true for all Windows variants.
We can not distinguish the Cygwin from other Windows variant, MSVC, MinGW.
os(Windows) and CYGWIN macro will be evaluated to true for Cygwin environment.
The CYGWIN macro is also used in Swift standard library.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it... I hope eventually there is some builtin way to identify this.

@ddunbar ddunbar removed their assignment Jan 21, 2017
re.DOTALL | re.MULTILINE)
product_pattern = re.compile(
r'Library\([\n ]*name: \"(.*?)\",[\n ]*type: (.*?),[\n ]*targets: (\[.*?\])[\n ]*\)',
r'Library\([\r\n ]*name: \"(.*?)\",[\r\n ]*type: (.*?),[\r\n ]*targets: (\[.*?\])[\r\n ]*\)',
re.DOTALL | re.MULTILINE)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should need this, there should be a way to open the manifest file such that Python will automatically do the line ending conversion on reading the data.

@aciidgh
Copy link
Contributor

aciidgh commented Mar 15, 2017

Closing this due to age but feel free to reopen.

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.

3 participants