-
Notifications
You must be signed in to change notification settings - Fork 59
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
Portable build tool / Windows testing #1026
Conversation
3215f01
to
9972086
Compare
@@ -4,6 +4,7 @@ import Utils | |||
|
|||
/// A command-line tool that generates XCTest cases for a list of annotated ".hylo" | |||
/// files as part of our build process. | |||
@main |
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.
Last time this change got merged it caused Windows to fail. That had been done because we couldn't write GenerateHyloFileTests.main()
at the top level. My fix was to create the main.swift
file that this PR wants to remove. Is that change necessary?
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.
Yes, it's necessary. Use of @main
is fine on all platforms if you pass the (required on all platforms but not enforced) --parse-as-library
option to swift
, as I have done in Package.swift
.
8d58528
to
7b3f6b2
Compare
The SPM has fixes, I think.
Maybe SPM is recent enough that `swift run` invokes an `.exe`.
@C-BJ I have pushed this a long way down the road to working; in fact, the tests all run on my local Windows VM. Most of them, by far, pass (there are some problems with the executables we generate). I need to focus on other things and don't really have the tools to diagnose the problem myself, but would be happy to work with you to push it over the line. Then we would be in a good position to try to address #864. WDYT? |
Regardless, the current status of this PR is:
|
One way to get this running in CI is to remove the ArgumentParser dependency from GenerateHyloFileTests and invoke it as That will work around the SPM path bug by not using SPM. I'd be happy to make that update. |
This is really a flawed approach. We need a FileSystemPath type.
|
@dabrahams I think we should put the support library in the same folder as hc so we can link it easily. I'm trying to figure out how to get the path to |
As far as I know, we are using debug mode build for Windows on CI right now, but the CI title says release. |
Please don't worry about where we put this library until you figure out how to make the executables generated by
No, we should update the title. We shouldn't worry about testing release builds until we have gotten debug builds to generate working executables.
CI isn't flaky; it's just that I tried to do this. I believe we need to be on a release snapshot rather than the final release; I'll make that change… but there is no Windows release snapshot there, so we need to go back to the Browser Company build of Swift. Done. |
Do you have another theory about what makes the generated executables fail to work? If not, maybe it's worth trying these other configurations to see if they make a difference. |
|
45d413a
to
6be1064
Compare
Sorry, I don't understand the statement (or question, if that's what it is). |
I'll try to fix it, but I don't have much time. |
Maybe let kyouko-taiga see if there's any relationship between those failed tests? |
I don't know, sorry. I also don't think you should be trying to put the library where hc.exe is, or into your MSVC installation for that matter. Linkers accept full paths to libraries and also library search path entries on their command lines. If you need to point at the support library, you can use that facility. Unless the link command somehow fails to report an error when you remove or rename the support library, the library is being found by the linker. And I can confirm that hc fails to generate an executable when the support library is missing. |
Feel free to ask her. I have tried to find a relationship and come up empty. |
@compnerd suggests that we need to use clang to link on Windows, like on linux. I havent' had time to investigate. |
It's a lot faster if they are already built.
Update: this problem is solved, I think:
If you don't want to increase build times and are willing to live with the inconvenience of the above dance, you can set |
Diagnostics were added that reveal it is crashing in LLVM or Swifty-LLVM doing the mandatory passes:
|
It's currently blocked on what appears to be a Swifty-LLVM bug: hylo-lang/Swifty-LLVM#24
Fixes #805