Skip to content

Reduce use of AbsolutePath with precondition failure #5797

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 1 commit into from
Oct 19, 2022

Conversation

neonichu
Copy link
Contributor

@neonichu neonichu commented Oct 5, 2022

Since it comes up regularly as a perceived user facing crash, we should reduce our use of the plain AbsolutePath initializer. I actually don't think it makes sense to even provide a non-throwing initializer that takes anything but a StaticString and even that's debatable.

This doesn't resolve all possible uses and specifically excludes uses in tests, but does fix several user facing issues, e.g.

❯ export SWIFTPM_TESTS_MODULECACHE=blah
❯ swift test
zsh: illegal hardware instruction  swift test

@neonichu neonichu self-assigned this Oct 5, 2022
@neonichu neonichu force-pushed the reduce-use-of-absolutepath-with-precondition-failure branch from ef50e94 to f68a78a Compare October 5, 2022 05:41
@neonichu
Copy link
Contributor Author

neonichu commented Oct 5, 2022

@swift-ci please smoke test

@neonichu neonichu marked this pull request as draft October 5, 2022 22:59
@neonichu
Copy link
Contributor Author

neonichu commented Oct 5, 2022

Moved to draft since I'll be addressing the remaining call sites as well as discussed.

neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 14, 2022
neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 17, 2022
neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 17, 2022
neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 17, 2022
neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 18, 2022
@neonichu neonichu force-pushed the reduce-use-of-absolutepath-with-precondition-failure branch from f68a78a to 9a04192 Compare October 18, 2022 06:42
neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 18, 2022
@neonichu neonichu force-pushed the reduce-use-of-absolutepath-with-precondition-failure branch from 9a04192 to 1c9a81e Compare October 18, 2022 18:33
@neonichu
Copy link
Contributor Author

swiftlang/swift-tools-support-core#353
@swift-ci please smoke test

Since it comes up regularly as a perceived user facing crash, we should reduce our use of the plain `AbsolutePath` initializer. I actually don't think it makes sense to even provide a non-throwing initializer that takes anything but a `StaticString` and even that's debatable.

This doesn't resolve all possible uses and specifically excludes uses in tests, but does fix several user facing issues, e.g.

```
❯ export SWIFTPM_TESTS_MODULECACHE=blah
❯ swift test
zsh: illegal hardware instruction  swift test
```
@neonichu neonichu force-pushed the reduce-use-of-absolutepath-with-precondition-failure branch from 1c9a81e to 136ffef Compare October 18, 2022 19:10
@neonichu
Copy link
Contributor Author

swiftlang/swift-tools-support-core#353
@swift-ci please smoke test

@neonichu neonichu marked this pull request as ready for review October 18, 2022 19:10
@neonichu
Copy link
Contributor Author

Self-hosted jobs are expected to fail because they don't support cross-repo testing.

@neonichu
Copy link
Contributor Author

@neonichu
Copy link
Contributor Author

neonichu added a commit to neonichu/swift-tools-support-core that referenced this pull request Oct 18, 2022
@neonichu
Copy link
Contributor Author

neonichu added a commit to swiftlang/swift-tools-support-core that referenced this pull request Oct 19, 2022
@neonichu neonichu merged commit d98de63 into main Oct 19, 2022
@neonichu neonichu deleted the reduce-use-of-absolutepath-with-precondition-failure branch October 19, 2022 20:23
neonichu added a commit that referenced this pull request Nov 4, 2022
In #5797, I introduced the outer `do`-block here, but did not move the existing `defer` from the now inner `do`-block.

Related to rdar://101956252
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