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

[SR-13948] SPM doesn't exclude files and directories marked as exclude #4460

Open
swift-ci opened this issue Dec 9, 2020 · 10 comments
Open
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Dec 9, 2020

Previous ID SR-13948
Radar rdar://problem/72160849
Original Reporter tallariel (JIRA User)
Type Bug

Attachment: Download

Environment

Swift 5.3

Xcode 12.2

Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 935b0a6f5320e383eed668eabaa960a1

Issue Description:

Marking directories and files in a target's `exclude` seems to have no effect.

See an example here:

https://github.com/pocketsvg/PocketSVG/

https://github.com/pocketsvg/PocketSVG/blob/master/Package.swift#L25

I would expect "Demos", "ci", "derived_data", "PocketSVG.podspec" to be excluded, but they are still included in the package when you open it in Xcode.

@typesanitizer
Copy link

@swift-ci create

@neonichu
Copy link
Member

The `exclude` parameter solely has an effect on the build, not on which files are shown in Xcode. Xcode will currently always show any files that are part of the directory tree that contains the package manifest (with some limited exceptions, e.g. we won't show .xcodeproj files).

@swift-ci
Copy link
Contributor Author

Comment by Ariel Elkin (JIRA)

@neonichu I see now. I find this counterintuitive.

When Xcode opens an .xcodeproj file it only displays the files included therein. This is intuitive, as you'd expect to see just the files included in the Xcode project.

So I would expect Xcode to behave analogously when opening a Package.swift file. It should just display files explicitly marked as being part of the package, and not display files explicitly marked as NOT being part of the package. In addition, showing excluded files in Xcode leads to unnecessarily higher cognitive load (a package's directory can include files irrelevant to the package itself such as ci scripts, derived data folders, ancillary files from other dependency managers. All these will bloat Xcode's UI)

Please consider amending the current behaviour, or updating the docs for `exclude`

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@sivx76
Copy link

sivx76 commented Aug 31, 2022

Seconded! I am the developer of a free and opensource library and I find this to be very annoying.

For Cocoapods support this issue doesn't appear for our users. For SPM support it does.

My first reaction and others from my users was this was a huge issue for our Swift package.

Is there any way to prioritize this? @neonichu @tomerd @shahmishal

Thanks!

@tomerd
Copy link
Member

tomerd commented Aug 31, 2022

@neonichu this seems to be more of an Xcode level issue, correct?

@neonichu
Copy link
Member

Yep, this is entirely about what is shown by the project navigator in Xcode.

@tomerd
Copy link
Member

tomerd commented Aug 31, 2022

is there better way to track this then? maybe apple feedback?

@sivx76
Copy link

sivx76 commented Aug 31, 2022

Opened a ticket on Feedback Assistant. Ticket ID: FB11422233 (Issue with Swift Package Manager)

@neonichu @tomerd - thank you for both of your prompt responses.

It means a lot for the opensource community. Let us know if there is any way we can help or to escalate this issue.

Benyam

@setoelkahfi
Copy link

I recently faced a similar issue. I ended up using a workaround posted here to use an empty Package.swift file like so:

// swift-tools-version:5.5

import PackageDescription

let package = Package()

@MaxDesiatov
Copy link
Member

@setoelkahfi is this issue reproducible for you only in Xcode or with command-line invocations of SwiftPM too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants