Skip to content

Conversation

@harlanhaskins
Copy link
Contributor

@harlanhaskins harlanhaskins commented Mar 8, 2019

In addition to being wasteful, this is a correctness issue -- the
compiler should only ever have one view of this file, and it should not
read a potentially different file after validating dependencies.

rdar://48654608

@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch 2 times, most recently from 789b52f to c3b8f15 Compare March 8, 2019 01:56
@Azoy
Copy link
Contributor

Azoy commented Mar 8, 2019

Really amazing comments in this patch!

@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch from c3b8f15 to 43ca89a Compare March 8, 2019 02:59
@harlanhaskins
Copy link
Contributor Author

harlanhaskins commented Mar 8, 2019

@Azoy Thanks! (for those just joining, this is referring to the comments in #22603 which were in this patch before I rebased)

@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch 4 times, most recently from 68009f7 to 75515ff Compare March 11, 2019 17:14
@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch from 75515ff to 71eb4f1 Compare March 20, 2019 22:44
@harlanhaskins harlanhaskins changed the title [ParseableInterface] Only open module buffers once while loading [ParseableInterface] Serialize module into buffer and load from it Mar 20, 2019
@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

I like the safety of std::unique_ptr a lot here. Ownership FTW!

Copy link
Contributor

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Harlan!

In addition to being wasteful, this is a correctness issue -- the
compiler should only ever have one view of this file, and it should not
read a potentially different file after validating dependencies.

rdar://48654608
@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch from 481ff9c to 7bdf542 Compare March 22, 2019 01:17
@harlanhaskins harlanhaskins marked this pull request as ready for review March 22, 2019 01:17
@harlanhaskins
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7bdf5421c6182b300494e72ed2e86e4e036d5921

@harlanhaskins
Copy link
Contributor Author

@jrose-apple Are these ClangImporter changes okay?

@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test Linux

@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch from 5d897b8 to 18aee59 Compare March 22, 2019 18:52
@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test Linux

@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test macOS

@harlanhaskins
Copy link
Contributor Author

Seems like the Linux bot had issues. Let's try again.

@swift-ci please smoke test Linux

@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch from 18aee59 to 7e22618 Compare March 23, 2019 00:23
Harlan Haskins added 2 commits March 22, 2019 17:29
Previously, we would assert that there's a runtime resource dir
available, but then accept the possibility of no glibc.modulemap. We
should just do the same thing for 'no resource dir' as 'no module map'.
@harlanhaskins harlanhaskins force-pushed the never-trust-the-system branch from 7e22618 to 5a29cdc Compare March 23, 2019 00:29
@harlanhaskins
Copy link
Contributor Author

@swift-ci please test and merge

@harlanhaskins
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7bdf5421c6182b300494e72ed2e86e4e036d5921

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7bdf5421c6182b300494e72ed2e86e4e036d5921

@harlanhaskins harlanhaskins merged commit 714a2b4 into swiftlang:master Mar 23, 2019
harlanhaskins pushed a commit to harlanhaskins/swift that referenced this pull request Mar 23, 2019
…-system

 [ParseableInterface] Serialize module into buffer and load from it
harlanhaskins pushed a commit to harlanhaskins/swift that referenced this pull request Mar 23, 2019
…-system

 [ParseableInterface] Serialize module into buffer and load from it
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