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

False positive "side effects" warning when using Swift Macros #6209

Open
pepicrft opened this issue Apr 19, 2024 · 0 comments · May be fixed by #6210
Open

False positive "side effects" warning when using Swift Macros #6209

pepicrft opened this issue Apr 19, 2024 · 0 comments · May be fixed by #6210
Labels
good first issue Good for newcomers type:bug Something isn't working

Comments

@pepicrft
Copy link
Contributor

pepicrft commented Apr 19, 2024

What happened?

Users reported getting "static side effects" warnings that seem to be false positives in their projects. They happen when the project has Swift Macros; our logic doesn't account for that. We need to adjust the logic that checks for side effects to skip the traversal when it comes across a macro executable.

How do we reproduce it?

  1. Create a project with an app that depends on 2 dynamic frameworks
  2. Add a Swift Macros to each of those 2 dynamic frameworks
  3. Generate the project

Error log

From a user:

Loading and constructing the graph
It might take a while if the cache is empty
Using cache binaries for the following targets: Dependencies, SwiftCompilerPlugin, SwiftSyntaxMacros, SwiftParser, ComposableArchitectureMacros, SwiftSyntaxMacroExpansion, SwiftSyntax510, SwiftParserDiagnostics, CombineSchedulers, SwiftSyntax509, SwiftCompilerPluginMessageHandling, CasePathsMacros, XCTestDynamicOverlay, SwiftUINavigationCore, SwiftBasicFormat, ComposableArchitecture, PerceptionMacros, OrderedCollections, SwiftSyntax, Clocks, DependenciesMacrosPlugin, SwiftSyntaxBuilder, DependenciesMacros, CustomDump, _CollectionsUtilities, Perception, SwiftOperators, SwiftDiagnostics, IdentifiedCollections, ConcurrencyExtras, CasePaths
Generating workspace Ratings.xcworkspace
Generating project Ratings
Project generated.
Total time taken: 0.464s

The following warnings need attention:
 · Xcframework 'DependenciesMacros.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'CustomDump.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'CustomDump.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'Perception.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'OrderedCollections.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftBasicFormat.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'Dependencies.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftOperators.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'CombineSchedulers.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'Clocks.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntax509.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntaxMacros.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntax.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'CombineSchedulers.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftCompilerPlugin.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'XCTestDynamicOverlay.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'IdentifiedCollections.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftCompilerPlugin.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftParser.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'ConcurrencyExtras.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'IdentifiedCollections.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntaxBuilder.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftParser.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftUINavigationCore.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework '_CollectionsUtilities.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'CasePaths.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntax.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'DependenciesMacros.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework '_CollectionsUtilities.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftBasicFormat.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'CasePaths.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftOperators.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntaxMacroExpansion.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'Clocks.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftParserDiagnostics.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntax510.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'Perception.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'XCTestDynamicOverlay.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'OrderedCollections.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntaxMacros.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftUINavigationCore.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntaxBuilder.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftCompilerPluginMessageHandling.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'Dependencies.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftDiagnostics.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntax509.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntaxMacroExpansion.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftDiagnostics.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
 · Xcframework 'ConcurrencyExtras.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftCompilerPluginMessageHandling.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftParserDiagnostics.xcframework' has been linked from target 'AppFeature' and target 'HomeFeature', it is a static product so may introduce unwanted side effects.
 · Xcframework 'SwiftSyntax510.xcframework' has been linked from target 'AppFeature', target 'HomeFeature', and target 'Ratings', it is a static product so may introduce unwanted side effects.
@pepicrft pepicrft added type:bug Something isn't working good first issue Good for newcomers labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant