Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ jobs:
# Note: this commit is used in soundness & swifttests workflows, so they should be kept in sync
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@f84da042883848ad67aadd051dc322eec18660d3 # 0.0.9
with:
enable_windows_checks: false
windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}]"
windows_build_command: >
# swift run --configuration release BasicsAsyncSnippet;
# swift run --configuration release BasicsSnippet;
swift test --configuration release;
$swiftFiles = Get-ChildItem -Path .\Snippets -Include *.swift -Recurse;
foreach ($file in $swiftFiles) {
$basename = [System.IO.Path]::GetFileNameWithoutExtension($file.FullName);
swift run --configuration release $basename;
}
enable_macos_checks: true
macos_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.3\"}, {\"xcode_version\": \"16.4\"}]" # we require swift 6.2
Expand Down
30 changes: 15 additions & 15 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 17 additions & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,6 @@ let package = Package(
"HomomorphicEncryptionProtobuf",
"_TestUtilities",
], swiftSettings: executableSettings),
.testTarget(
name: "PIRGenerateDatabaseTests",
dependencies: ["PIRGenerateDatabase",
"_TestUtilities",
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
.testTarget(
name: "PIRProcessDatabaseTests",
dependencies: ["PIRProcessDatabase",
"_TestUtilities",
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
.testTarget(
name: "PrivateInformationRetrievalTests",
dependencies: [
Expand All @@ -249,6 +239,23 @@ let package = Package(
], swiftSettings: executableSettings),
])

// Workaround SwiftPM's attempt to link in executables which does not work on all
// platforms.
Comment on lines +242 to +243

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we come up with a different way to support these tests?
One option would be to split the executables into two parts: the library that will be imported to tests and a very minimal boilerplate main.swift that calls into the library.

Do we have other options?

#if !os(Windows)
package.targets.append(contentsOf: [
.testTarget(
name: "PIRGenerateDatabaseTests",
dependencies: ["PIRGenerateDatabase",
"_TestUtilities",
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
.testTarget(
name: "PIRProcessDatabaseTests",
dependencies: ["PIRProcessDatabase",
"_TestUtilities",
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
])
#endif

// MARK: - Benchmarks

var enableBenchmarking: Bool {
Expand Down
2 changes: 2 additions & 0 deletions Snippets/HomomorphicEncryption/BasicsSnippet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ precondition(decoded == [8, 5, 12, 12, 15, 0, 8, 5])
// plaintext to any observer. The observed value in this case is zero.
try sum -= sum
precondition(sum.isTransparent())

preconditionFailure()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mark this with a TODO to remove it.

Loading