Skip to content

Fix crash with absolute path to binary artifact #3737

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
Sep 13, 2021

Conversation

neonichu
Copy link
Contributor

The code in Workspace.parseArtifacts() assumes prior validation of paths even though it is running before any such validation.

rdar://83059393

The code in `Workspace.parseArtifacts()` assumes prior validation of paths even though it is running before any such validation.

rdar://83059393
@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

@neonichu
Copy link
Contributor Author

This is a kind of fun gap in our unit tests, because most of them run with a MockWorkspace or no Workspace at all, so they are never hitting this code.

I also think the existence of the non-validating path initializers is kind of an anti-pattern. Paths are almost always going to be user input in some fashion and this makes it way too easy to turn a missing validation into a runtime crash with no info.

@tomerd
Copy link
Contributor

tomerd commented Sep 13, 2021

I also think the existence of the non-validating path initializers is kind of an anti-pattern. Paths are almost always going to be user input in some fashion and this makes it way too easy to turn a missing validation into a runtime crash with no info.

this sounds right to me - iow we should deprecate the non-validating initializer. @abertelrud wdyt?

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