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 all commits
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
37 changes: 19 additions & 18 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,18 @@ jobs:
https://github.com/apple/swift-package-manager/issues/6595" && false) )

build-native-windows:
name: "Native, no testing: windows-latest/release"
name: "Native: windows-latest, debug"
strategy:
fail-fast: false
runs-on: windows-latest
steps:
- name: Setup swift
uses: compnerd/gha-setup-swift@main
with:
branch: swift-5.8.1-release
tag: 5.8.1-RELEASE
github-repo: thebrowsercompany/swift-build
release-asset-name: installer-amd64.exe
release-tag-name: 20231010.3
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v3

Expand All @@ -159,26 +161,25 @@ jobs:
7z x llvm-15.0.6-windows-x86-msvc17-msvcrt.7z -oC:\
Add-Content $env:GITHUB_PATH 'C:\llvm-15.0.6-windows-x86-msvc17-msvcrt\bin'

- name: Copy LLVM's include and lib to include and lib folder of MSVC
run: |
xcopy c:\llvm-15.0.6-windows-x86-msvc17-msvcrt\include\*.* c:\program" "files\microsoft" "visual" "studio\2022\enterprise\vc\tools\msvc\${{ env.VCToolsVersion }}\include\ /s /h
xcopy c:\llvm-15.0.6-windows-x86-msvc17-msvcrt\lib\*.* c:\program" "files\microsoft" "visual" "studio\2022\enterprise\vc\tools\msvc\${{ env.VCToolsVersion }}\lib\x64\ /s /h

- run: llvm-config --version

- name: Generate LLVM pkgconfig file
run: |
swift package resolve
& "C:\Program Files\Git\bin\bash.exe" .build/checkouts/Swifty-LLVM/Tools/make-pkgconfig.sh llvm.pc
type llvm.pc

- name: Build support library
run: clang -c ./Library/Hylo/LibC.c -o HyloLibC.lib

- name: Copy support library
run: xcopy HyloLibC.lib c:\program" "files\microsoft" "visual" "studio\2022\enterprise\vc\tools\msvc\${{ env.VCToolsVersion }}\lib\x64\
- name: Prevent reentrant builds for speed
run: echo 'HYLO_NO_REENTRANT_BUILD=1' >> $env:GITHUB_ENV

- name: Build (Release)
id: build
continue-on-error: true
run: swift build -v -c release
- name: Non-test build ensuring that build tools have been built
run: swift build --pkg-config-path .

- name: Retry on failure
continue-on-error: false
if: steps.build.outcome != 'success'
run: swift build -v -c release
- name: Build tests
run: swift build --build-tests --pkg-config-path .

- name: Test
run: swift test --skip-build --pkg-config-path .
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@
}
],
"version" : 2
}
}
13 changes: 10 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// swift-tools-version:5.7
import PackageDescription

#if os(Windows)
let onWindows = true
#else
let onWindows = false
#endif

/// Settings to be passed to swiftc for all targets.
let allTargetsSwiftSettings: [SwiftSetting] = [
.unsafeFlags(["-warnings-as-errors"])
Expand Down Expand Up @@ -126,15 +132,16 @@ let package = Package(

.plugin(
name: "TestGeneratorPlugin", capability: .buildTool(),
dependencies: [.target(name: "GenerateHyloFileTests")]),
// Workaround for SPM bug; see PortableBuildToolPlugin.swift
dependencies: onWindows ? [] : ["GenerateHyloFileTests"]),

.executableTarget(
name: "GenerateHyloFileTests",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Utils",
],
swiftSettings: allTargetsSwiftSettings),
swiftSettings: allTargetsSwiftSettings + [ .unsafeFlags(["-parse-as-library"]) ]),

// Test targets.
.testTarget(
Expand All @@ -144,7 +151,7 @@ let package = Package(

.testTarget(
name: "DriverTests",
dependencies: ["Driver"],
dependencies: ["Driver", "TestUtils"],
swiftSettings: allTargetsSwiftSettings),

.testTarget(
Expand Down
Loading