Skip to content

[Attempt 2] Implement FileManager.url{s,}(for:…) and NSSearchPathForDirectoriesInDomains. #1597

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

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

millenomi
Copy link
Contributor

This re-proposes the patch at #1456 — see there for discussion.

Unlike that patch, this one changes the test setup and build so that NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT is defined iif the build product can be used in a @testable import expression, and conditionalizes white-box tests to the presence of that flag. That flag is never available if DEPLOYMENT_RUNTIME_OBJC, since macOS's Foundation will never be usable with @testable import.

…ectoriesInDomains.

Implement urls(for:…) as the primitive directory method:
 - In Darwin, match paths with the Objective-C implementation wherever possible.
 - On platforms that use FHS/XDG, implement reading user-dirs.* files to determine XDG directories;

Implement url(for:in:…) and NSSearchPathForDirectoriesInDomains() in terms of urls(for:…).
…able.

Additionally: allow building in Release correctly during development on Darwin.
@millenomi
Copy link
Contributor Author

@swift-ci please test

@millenomi
Copy link
Contributor Author

This fixes the issues that caused the revert at #1596.

@millenomi
Copy link
Contributor Author

cc @rudkx @shahmishal

@millenomi
Copy link
Contributor Author

I have locally tested this built in Debug and Release on Darwin.

@millenomi millenomi merged commit 1afa1ef into swiftlang:master Jun 12, 2018
@rudkx
Copy link
Contributor

rudkx commented Jun 12, 2018

It looks like this still isn't making it past the CI builders. https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04/4421/

Perhaps a difference in your configuration vs. the builders?

I'll need to revert ASAP as this will hold other PR testing.

@jrose-apple
Copy link
Contributor

It's passing PR testing, so it could also be an an incremental vs. clean build issue.

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.

3 participants