Skip to content

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

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 4 commits into from
Oct 11, 2018

Conversation

millenomi
Copy link
Contributor

This re-reproposes the patch at #1597 that was reverted by #1598. It should fix the issues from the previous two attempts. (Whoops.)

@millenomi
Copy link
Contributor Author

@swift-ci please test

@millenomi
Copy link
Contributor Author

cc @rudkx @shahmishal I'm attempting again. I'm trying to figure out why the buildbot found that issue but both local Ubuntu 16.10 and Mac builds didn't find this.

@felix91gr
Copy link
Contributor

Ubuntu 16.10

Did you try it with 16.04? Since it's LTS, it's usually more representative of how Ubuntu behaves :)

@rudkx
Copy link
Contributor

rudkx commented Jun 14, 2018

We can certainly try merging again and see what the effects are. As @felix91gr says, the same release might provide more confidence this will work, but I don't know any of the details of how the releases are configured (or any customizations in our CI), so I don't know how much of a concern that might be.

@millenomi If you do merge, can you keep an eye on the bots and revert ASAP if there are issues?

@pvieito
Copy link
Contributor

pvieito commented Jul 2, 2018

Could we retry merging the PR? Or is there extra work required?

@millenomi
Copy link
Contributor Author

We can retry but I have been unavailable to check on the patch's progress and CI for a little bit as other work priorities have weighted.

case user

init?(_ domainMask: SearchPathDomainMask) {
if domainMask == .systemDomainMask {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. domainMask is an OptionSet afaik, and urls function will return an array with multiple items if multiple masks are passes I think. I’m not sure however.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they're documented to accept a single mask at a time. Weirdness of the Darwin API, but yeah.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad — you're correct, and this patch is wrong. (url… accepts a single mask, but urls… does not.)

if domainMask == .systemDomainMask {
self = .system; return
}
if domainMask == .localDomainMask {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use switch case instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I tried, Swift complained, and I switched over without investigating.

@millenomi
Copy link
Contributor Author

@swift-ci please test

@millenomi
Copy link
Contributor Author

Turns out it is indeed helpful if I remember to ask the bot for testing.

@millenomi
Copy link
Contributor Author

This has gone on long enough. I'm going to hit that merge button, and we'll deal with bugs in future follow-ups.

@millenomi millenomi merged commit 72d6933 into swiftlang:master Oct 11, 2018
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.

5 participants