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

Portable build tool / Windows testing #1026

Merged
merged 45 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
87dc481
Try to make TestGeneratorPlugin portable
dabrahams Sep 24, 2023
7dbcdc6
Try enabling Windows testing in CI
dabrahams Sep 24, 2023
da73fdd
Remove unworkable dependency on Windows
dabrahams Sep 24, 2023
db4ab20
Fix spell-o
dabrahams Sep 25, 2023
9972086
Merge branch 'main' of github.com:val-lang/val into portable-build-tool
dabrahams Sep 25, 2023
91ea5cd
Windows fixen
dabrahams Sep 25, 2023
3232ffd
Nix a little debug output
dabrahams Sep 25, 2023
e011682
Run tests on Windows
dabrahams Sep 30, 2023
7b3f6b2
Try to make Windows CI work.
dabrahams Oct 10, 2023
8ffb4b8
Stop trying to use cmd shell
dabrahams Oct 10, 2023
d507da2
Fix workflow syntax
dabrahams Oct 10, 2023
ce64550
Properly invoke quoted path in Powershell
dabrahams Oct 10, 2023
8c3f0ee
Try using the standard Swift setup to get v 5.9
dabrahams Oct 11, 2023
1ff2b5e
Try getting 5.9 with compnerd's action
dabrahams Oct 11, 2023
36fabb3
Fix branch/tag spec
dabrahams Oct 11, 2023
acf8ed7
Attempt to use a dev snapshot on Windows
dabrahams Oct 11, 2023
0d63e25
Darn tag name is not a tag name
dabrahams Oct 11, 2023
62e8963
Try using a Browser Company build of Swift
dabrahams Oct 11, 2023
15344fa
Fix install-swift invocation
dabrahams Oct 11, 2023
3c5d1e4
Merge branch 'main' of github.com:hylo-lang/hylo into portable-build-…
dabrahams Oct 11, 2023
aa24faf
Add missing github-token
dabrahams Oct 11, 2023
d327742
Try invoking swift with the cmd shell
dabrahams Oct 11, 2023
c0c78cd
Gather more diagnostic information from the GitHub Windows runner.
dabrahams Oct 11, 2023
2ec4ca7
Attempt to properly represent filesystem paths.
dabrahams Oct 12, 2023
76a57be
Nix nonportable autoreleasepool
dabrahams Oct 12, 2023
a9ff0b5
Try to work around SPM relative path problem, maybe.
dabrahams Oct 13, 2023
e015200
Try to work around issue in CI by using relative paths.
dabrahams Oct 13, 2023
0a113d9
Try *not* disabling the sandbox on Windows
dabrahams Oct 14, 2023
67f2bfd
Fix relative path computation for different drives.
dabrahams Oct 14, 2023
615f4ba
fix think-o
dabrahams Oct 14, 2023
086ac91
Revert relative path shenanigans
dabrahams Oct 14, 2023
5611f1c
Merge branch 'portable-build-tool' of github.com:hylo-lang/hylo into …
dabrahams Oct 14, 2023
15b8e02
Merge branch 'portable-build-tool' of file:///z:/src/hylo into portab…
dabrahams Oct 14, 2023
a6e13e4
Try skipping the build when testing
dabrahams Oct 14, 2023
6be1064
--skip-build, not --skip-tests
dabrahams Oct 14, 2023
0955205
Attempt to make Windows reentrant build work.
dabrahams Oct 17, 2023
7e8d1db
Make reentrant build of build tools optional on Windows.
dabrahams Oct 18, 2023
aa742b0
Turn reentrant builds off in CI for speed.
dabrahams Oct 18, 2023
7247cb6
Merge branch 'main' of github.com:hylo-lang/hylo into portable-build-…
dabrahams Oct 28, 2023
3d1b14c
Merge branch 'portable-build-tool' from Mac into portable-build-tool
dabrahams Oct 28, 2023
d3cb14f
Verbose diagnostics for llvm work.
dabrahams Oct 30, 2023
125168a
Disable Windows testing until we can make it pass.
dabrahams Oct 29, 2023
742a8f3
Enable as many tests on Windows as will pass.
dabrahams Nov 3, 2023
753e63a
Merge branch 'main' of github.com:hylo-lang/hylo into portable-build-…
dabrahams Nov 3, 2023
38f1f86
Fix reporting about Windows build, add missing SPM dependency
dabrahams Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
}
],
"version" : 2
}
}
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ let package = Package(
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Utils",
],
swiftSettings: allTargetsSwiftSettings),
swiftSettings: allTargetsSwiftSettings + [ .unsafeFlags(["-parse-as-library"]) ]),

// Test targets.
.testTarget(
Expand Down
7 changes: 4 additions & 3 deletions Sources/GenerateHyloFileTests/GenerateHyloFileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

struct GenerateHyloFileTests: ParsableCommand {

@Option(
Expand All @@ -24,9 +25,7 @@ struct GenerateHyloFileTests: ParsableCommand {

/// Returns the Swift source of the test function for the Hylo file at `source`.
func swiftFunctionTesting(valAt source: URL) throws -> String {
let firstLine =
try String(contentsOf: source)
.split(separator: "\n", maxSplits: 1).first ?? ""
let firstLine = try String(contentsOf: source).prefix { !$0.isNewline }
let parsed = try firstLine.parsedAsFirstLineOfAnnotatedHyloFileTest()
let testID = source.deletingPathExtension().lastPathComponent.asSwiftIdentifier

Expand Down Expand Up @@ -62,6 +61,8 @@ struct GenerateHyloFileTests: ParsableCommand {
output += "\n}\n"

try output.write(to: outputURL, atomically: true, encoding: .utf8)
print("########## Generated \(outputURL.path)...")

}

}
Expand Down
1 change: 0 additions & 1 deletion Sources/GenerateHyloFileTests/main.swift

This file was deleted.

Loading