Skip to content

Adding file to module A triggers rebuild of module B #7886

Open
@rauhul

Description

@rauhul

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

Given a package with structure:

ModuleA/Foo.swift
ModuleB/Empty.swift

where ModuleB's content really comes from a build tool plugin

Adding a file to Module A like Bar.swift will trigger SwiftPM to rebuild ModuleB even though none of its inputs have changed. This can be really rough for users because ModuleB may take a while to compile, see the RP2350 module in swift-embedded-examples:

Compiling Swift Module 'RP2350' (7 sources) (1m 14.92s)

which gets rebuilt anytime the Application module adds or removes files.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions