-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixed for Cygwin #733
Conversation
Very cool, thanks for the PR! |
@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.
05b5a81
to
9d717fc
Compare
@ddunbar, I rebased and the changes of |
There was a problem hiding this 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"] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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.
Closing this due to age but feel free to reopen. |
Now Cygwin can use Swift Package Manager.