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

Include host triple test modules in ResolvedPackage #7493

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Apr 24, 2024

Modified ResolvedModule build triples were not reflected in ResolvedPackage, which excluded those modules from the build graph.

Verified manually with swift-foundation and swift-testing packages. More comprehensive automated tests will be included in a future PR.

Resolves #7479.

Modified `ResolvedModule` build triples were not reflected in `ResolvedPackage`, which meant those modules aren't included in the build graph.

Verified with `swift-foundation` and `swift-testing` packages.

Resolves #7479.
@MaxDesiatov MaxDesiatov added bug cross-compilation build system Changes to interactions with build systems modules graph Modules dependency resolution resources Package resources support labels Apr 24, 2024
@MaxDesiatov MaxDesiatov self-assigned this Apr 24, 2024
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov added the needs tests This change needs test coverage label Apr 24, 2024
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 24, 2024 16:24
@bnbarham
Copy link
Contributor

Cross PR testing toolchain + source compat suite in swiftlang/swift#71188

@MaxDesiatov MaxDesiatov disabled auto-merge April 24, 2024 16:25
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 24, 2024 16:25
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov disabled auto-merge April 24, 2024 17:04
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 24, 2024 17:04
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov changed the title Include host triple targets in ResolvedPackage Include host triple test modules in ResolvedPackage Apr 24, 2024
@MaxDesiatov MaxDesiatov disabled auto-merge April 24, 2024 19:25
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 24, 2024 19:25
@bnbarham
Copy link
Contributor

Still failures in (outside of the compiler crashes on debug):

There's one new failure from what I can see:

error: couldn't build /Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/release/libSwiftCompilerPlugin.a because of multiple producers: Archiving ./.build/x86_64-apple-macosx/release/libSwiftCompilerPlugin.a, Archiving ./.build/x86_64-apple-macosx/release/libSwiftCompilerPlugin.a
error: couldn't build /Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/release/libSwiftOperators.a because of multiple producers: Archiving ./.build/x86_64-apple-macosx/release/libSwiftOperators.a, Archiving ./.build/x86_64-apple-macosx/release/libSwiftOperators.a
error: couldn't build /Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/release/libSwiftParser.a because of multiple producers: Archiving ./.build/x86_64-apple-macosx/release/libSwiftParser.a, Archiving ./.build/x86_64-apple-macosx/release/libSwiftParser.a
error: couldn't build /Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/release/libSwiftParserDiagnostics.a because of multiple producers: Archiving ./.build/x86_64-apple-macosx/release/libSwiftParserDiagnostics.a, Archiving ./.build/x86_64-apple-macosx/release/libSwiftParserDiagnostics.a
error: couldn't build /Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/release/libSwiftSyntax.a because of multiple producers: Archiving ./.build/x86_64-apple-macosx/release/libSwiftSyntax.a, Archiving ./.build/x86_64-apple-macosx/release/libSwiftSyntax.a
error: couldn't build /Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/swift-power-assert/.build/x86_64-apple-macosx/release/libSwiftSyntaxMacros.a because of multiple producers: Archiving ./.build/x86_64-apple-macosx/release/libSwiftSyntaxMacros.a, Archiving ./.build/x86_64-apple-macosx/release/libSwiftSyntaxMacros.a

And the penny-bot failure hasn't changed:

/Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-macos/swift-source-compat-suite/project_cache/penny-bot/.build/checkouts/DiscordBM/Sources/DiscordModels/UnstableEnumMacro.swift:1:8: error: no such module 'UnstableEnumMacro'
 1 | import UnstableEnumMacro
   |        `- error: no such module 'UnstableEnumMacro'
 2 | 
 3 | /// A macro to stabilize enums that might get more cases, to some extent.
note: module 'UnstableEnumMacro' is a macro, and cannot be imported by tests and other targets

Given this fixes two of the failing projects, going to merge as is for now. Still need fixes for the other 3 though.

@@ -34,7 +34,7 @@ public struct ResolvedPackage {
public let underlying: Package

/// The targets contained in the package.
public let targets: [ResolvedModule]
public let targets: IdentifiableSet<ResolvedModule>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should really be ordered.

@MaxDesiatov MaxDesiatov merged commit b9eb3c1 into main Apr 24, 2024
5 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/fix-test-products-graph branch April 24, 2024 23:22
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
Modified `ResolvedModule` build triples were not reflected in
`ResolvedPackage`, which excluded those modules from the build graph.

Verified manually with `swift-foundation` and `swift-testing` packages.
More comprehensive automated tests will be included in a future PR.

Resolves swiftlang#7479.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
Modified `ResolvedModule` build triples were not reflected in
`ResolvedPackage`, which excluded those modules from the build graph.

Verified manually with `swift-foundation` and `swift-testing` packages.
More comprehensive automated tests will be included in a future PR.

Resolves swiftlang#7479.
MaxDesiatov added a commit that referenced this pull request Jun 6, 2024
Modified `ResolvedModule` build triples were not reflected in
`ResolvedPackage`, which excluded those modules from the build graph.

Verified manually with `swift-foundation` and `swift-testing` packages.
More comprehensive automated tests will be included in a future PR.

Resolves #7479.

(cherry picked from commit b9eb3c1)

# Conflicts:
#	Sources/PackageGraph/ModulesGraph+Loading.swift
#	Sources/PackageGraph/Resolution/ResolvedPackage.swift
xedin added a commit that referenced this pull request Jun 10, 2024
**Explanation**: Macros cross-compiled by SwiftPM with Swift SDKs should
be correctly built, loaded, and evaluated for the host triple.
**Scope**: isolated to modules dependency resolution and llbuild, does
not impact code related to XCBuild.
**Risk**: medium, known issues were addressed on `main` and are
cherry-picked here, with no new issues reported for a few weeks now.
**Testing**: added unit tests, manual end-to-end testing done with
existing Swift SDKs.
**Issue**: rdar://105991372
**Reviewers**: @bnbarham @xedin @neonichu

(cherry picked from commit cb3b085,
#7353)

```
# Conflicts:
#	CHANGELOG.md
#	Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift
#	Sources/Build/BuildManifest/LLBuildManifestBuilder.swift
#	Sources/Build/BuildPlan/BuildPlan.swift
#	Sources/Commands/SwiftTestCommand.swift
#	Sources/Commands/Utilities/PluginDelegate.swift
#	Sources/Commands/Utilities/TestingSupport.swift
#	Sources/PackageGraph/ModulesGraph+Loading.swift
#	Sources/PackageGraph/ModulesGraph.swift
#	Sources/SPMTestSupport/MockBuildTestHelper.swift
#	Sources/SPMTestSupport/MockPackageGraphs.swift
#	Sources/SPMTestSupport/PackageGraphTester.swift
#	Sources/SPMTestSupport/ResolvedTarget+Mock.swift
#	Tests/BuildTests/ClangTargetBuildDescriptionTests.swift
#	Tests/BuildTests/CrossCompilationBuildPlanTests.swift
#	Tests/SourceKitLSPAPITests/SourceKitLSPAPITests.swift
```

(cherry picked from commit b9eb3c1,
#7493)

```
# Conflicts:
#	Sources/PackageGraph/ModulesGraph+Loading.swift
#	Sources/PackageGraph/Resolution/ResolvedPackage.swift
```
(cherry picked from commit 5a4c024,
#7508)

```
# Conflicts:
#	Sources/Commands/SwiftBuildCommand.swift
#	Sources/Commands/SwiftTestCommand.swift
#	Sources/Commands/Utilities/TestingSupport.swift
```

(cherry picked from commit 8db2401,
#7519)

```
# Conflicts:
#	Tests/BuildTests/CrossCompilationBuildPlanTests.swift
```

---------

Co-authored-by: Jonathan Grynspan <jgrynspan@apple.com>
Co-authored-by: Ben Barham <ben_barham@apple.com>
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
Co-authored-by: Pavel Yaskevich <xedin@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build system Changes to interactions with build systems cross-compilation modules graph Modules dependency resolution needs tests This change needs test coverage resources Package resources support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

swift-testing does not build with ToT SwiftPM
2 participants