Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

package import Foundation.NSData#231

Open
JanGorman wants to merge 3 commits into
pointfreeco:mainpointfreeco/swift-sharing:mainfrom
JanGorman:mainJanGorman/swift-sharing:mainCopy head branch name to clipboard
Open

package import Foundation.NSData#231
JanGorman wants to merge 3 commits into
pointfreeco:mainpointfreeco/swift-sharing:mainfrom
JanGorman:mainJanGorman/swift-sharing:mainCopy head branch name to clipboard

Conversation

@JanGorman

Copy link
Copy Markdown

This changes the package import Foundation in Deprecations.swift to a package import Foundation.NSData.

This solves the issue mentioned here #229 where the release build of our application was failing with errors like this one.

ambiguous implicit access level for import of 'Foundation'; it is imported as 'package' elsewhere
[11:36:26]: ▸ import class Foundation.Bundle

@mbrandonw

Copy link
Copy Markdown
Member

Hi @JanGorman, I think there is another solution. I think the problem is that the DocC bundle is being included in the package (there's even a warning in the logs about it), that causes a resource_bundle_accessor.swift file to be injected into the compilation with an import class Foundation.Bundle, and then that conflicts with our package import Foundation.

Can you point to the branch resource-docc-fix and see if it fixes it for you? There's a chance we may want both your fix and my fix, but first I would like to confirm that resource-docc-fix does fix it.

@JanGorman

Copy link
Copy Markdown
Author

Thanks @mbrandonw! I tested that branch on CI just now. Unfortunately it fails with same ambiguous implicit access level for import of 'Foundation'; it is imported as 'package' elsewhere error as before 😕

@mbrandonw

Copy link
Copy Markdown
Member

Huh, in that case maybe it’s the privacy plist resource that is included. Either way, your change looks good! We’ll get a release out later today.

@JanGorman

Copy link
Copy Markdown
Author

Amazing, thank you 🙏

@mbrandonw

mbrandonw commented Jul 22, 2026

Copy link
Copy Markdown
Member

Hi @JanGorman, sorry one more request. Can you double check if this would work too:

package import struct Foundation.Data

It's weird to import NSData when it isn't actually being used (though I guess some bridging is working here), and also not sure how it works to import Foundation.NSData without specifying class.

@JanGorman

Copy link
Copy Markdown
Author

Hey @mbrandonw, oddly enough the package import struct Foundation.Data did not work. I got the same errors again as before, here's an extract from the logs. 🤔 This is very strange to me too. I'll be happy to try again once we've switched to Xcode 27 in a couple of months’ time.

[08:46:18]: ▸ ::error file=/Users/photoroom/Library/Developer/Xcode/DerivedData/Photoroom-fyzrycmbowqaufaazarkvrwffnvz/Build/Intermediates.noindex/ArchiveIntermediates/Photoroom/IntermediateBuildFilesPath/swift-sharing.build/Release-iphoneos/Sharing.build/DerivedSources/resource_bundle_accessor.swift,line=1,col=14::ambiguous implicit access level for import of 'Foundation'; it is imported as 'package' elsewhere
[08:46:18]: ▸ import class Foundation.Bundle
[08:46:18]: ▸              ^
[08:46:18]: ▸ ::error file=/Users/photoroom/Library/Developer/Xcode/DerivedData/Photoroom-fyzrycmbowqaufaazarkvrwffnvz/Build/Intermediates.noindex/ArchiveIntermediates/Photoroom/IntermediateBuildFilesPath/swift-sharing.build/Release-iphoneos/Sharing.build/DerivedSources/resource_bundle_accessor.swift,line=2,col=14::ambiguous implicit access level for import of 'Foundation'; it is imported as 'package' elsewhere
[08:46:18]: ▸ import class Foundation.ProcessInfo
[08:46:18]: ▸              ^
[08:46:18]: ▸ ::error file=/Users/photoroom/Library/Developer/Xcode/DerivedData/Photoroom-fyzrycmbowqaufaazarkvrwffnvz/Build/Intermediates.noindex/ArchiveIntermediates/Photoroom/IntermediateBuildFilesPath/swift-sharing.build/Release-iphoneos/Sharing.build/DerivedSources/resource_bundle_accessor.swift,line=3,col=15::ambiguous implicit access level for import of 'Foundation'; it is imported as 'package' elsewhere
[08:46:18]: ▸ import struct Foundation.URL
[08:46:18]: ▸               ^
[08:46:18]: ▸ ::error file=/Users/photoroom/Library/Developer/Xcode/DerivedData/Photoroom-fyzrycmbowqaufaazarkvrwffnvz/SourcePackages/checkouts/swift-sharing/Sources/Sharing/Internal/MutexBackport.swift,line=1,col=8::ambiguous implicit access level for import of 'Foundation'; it is imported as 'package' elsewhere
[08:46:18]: ▸ import Foundation
[08:46:18]: ▸  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.