Skip to content

Revert "Revert "Enable stdlib resilience"" #15030

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
Mar 9, 2018

Conversation

adrian-prantl
Copy link
Contributor

This works around the LLDB problems by deserializing all modules with the default resilience strategy when in LLDB mode.

rdar://problem/36663932

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

// In LLDB always use the default resilience strategy, so IRGen can query
// the size of resilient types.
if (!Ctx.LangOpts.DebuggerSupport)
M.setResilienceStrategy(extendedInfo.getResilienceStrategy());
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a test for this? We already have a frontend flag to fake debugger support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The answer is of course, yes we should, but do you have any suggestion how this could be tested inside of swift? It is indirectly tested by the LLDB testsuite.

Copy link
Contributor

Choose a reason for hiding this comment

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

The SIL output should be different when passing around a struct by value. You should be able to define a resilient module with a public struct, and then examine the output of -emit-silgen on a client function that takes an argument of that type.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t think it’s worth the effort. The lldb test suite fails without this hack, and it’s only temporary. It will go away once lldb can use remote mirrors to calculate sizes of resilient types.

@jrose-apple
Copy link
Contributor

@swift-ci Please test source compatibility

@adrian-prantl
Copy link
Contributor Author

I added a testcase. Turned out to be much easier than anticipated thanks to Jordan's pointers.

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 05c8c21a6cacc233c778bedd4b9ea0be5b96be2a

@swift-ci
Copy link
Contributor

swift-ci commented Mar 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 05c8c21a6cacc233c778bedd4b9ea0be5b96be2a

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@adrian-prantl
Copy link
Contributor Author

osx failed with a timeout on two stdlib tests.

@adrian-prantl
Copy link
Contributor Author

@swift-ci test platform os x

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@jrose-apple
Copy link
Contributor

That kind of timeout could be real, since we are changing how the stdlib is built…

@adrian-prantl
Copy link
Contributor Author

Let's see if it reproduces.

…LLDB

This turns all resilient types into fixed layouts thus allowing LLDB
to query their size. The long-term plan is to use remote mirrors for
this unformation instead of swift IRGen, but the library is not yet up
to the task.

rdar://problem/36663932
@adrian-prantl
Copy link
Contributor Author

Looks like it does. I'll back out the enable resilience part for now.

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@adrian-prantl
Copy link
Contributor Author

Who is the right person to look into why enabling stdlib resilience causes stdlib test timeouts?

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@jrose-apple
Copy link
Contributor

"stdlib test timeouts" isn't very helpful. Which tests?

@adrian-prantl
Copy link
Contributor Author

https://ci.swift.org/job/swift-PR-osx/3560/testReport/
A timeout in
Swift(macosx-x86_64).stdlib.SceneKit.swift | 50 min | 1-- | -- | --
Swift(macosx-x86_64).stdlib.OpenCLSDKOverlay.swift

@swift-ci swift-ci merged commit 3ffbc41 into swiftlang:master Mar 9, 2018
@jrose-apple
Copy link
Contributor

Hm, it is totally possible that something in one of those overlays should be fixed-layout and isn't.

…although that seems weird for the OpenCL one.

No quick answer, so please file a Radar! Anna will assign it to me or Slava, most likely.

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.

4 participants