Skip to content
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

Don't build with stdlib assertions on Linux #33393

Merged
merged 1 commit into from Aug 18, 2020

Conversation

drexin
Copy link
Member

@drexin drexin commented Aug 10, 2020

Apparently we have been building with stdlib assertions enabled on Linux. A recent change (#33390) caused a massive performance regression on Linux, which brought this to light.

@drexin
Copy link
Member Author

drexin commented Aug 10, 2020

@swift-ci smoke test

@drexin
Copy link
Member Author

drexin commented Aug 12, 2020

@swift-ci test centos 7

5 similar comments
@drexin
Copy link
Member Author

drexin commented Aug 12, 2020

@swift-ci test centos 7

@drexin
Copy link
Member Author

drexin commented Aug 13, 2020

@swift-ci test centos 7

@drexin
Copy link
Member Author

drexin commented Aug 13, 2020

@swift-ci test centos 7

@drexin
Copy link
Member Author

drexin commented Aug 14, 2020

@swift-ci test centos 7

@drexin
Copy link
Member Author

drexin commented Aug 14, 2020

@swift-ci test centos 7

@drexin
Copy link
Member Author

drexin commented Aug 17, 2020

@swift-ci test amazon linux 2

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Amazon Linux 2 Platform
Git Sha - 27102e2

@drexin
Copy link
Member Author

drexin commented Aug 17, 2020

@swift-ci test amazon linux 2

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Amazon Linux 2 Platform
Git Sha - 27102e2

@drexin drexin merged commit 7145615 into apple:master Aug 18, 2020
@vedantk
Copy link
Member

vedantk commented Aug 18, 2020

@drexin With this change, it looks like none of the Linux bots test the stdlib with assertions enabled. That disables all the swift reflection tests for ELF. Is there a more targeted option, like disabling stdlib-asserts on a subset of the Linux builders?

cc @augusto2112 @adrian-prantl

@drexin
Copy link
Member Author

drexin commented Aug 19, 2020

@vedantk I think the best option would be to configure the bots in question to enable building with stdlib-asserts. Enabling them by default does not seem like the correct thing to do.

/cc @atrick

@atrick
Copy link
Member

atrick commented Aug 19, 2020

@vedantk what really does not make sense here is that build-script --assertions enables runtime verification. Now, on top of that, we have a "lightweight_assertions" mixin that also enables runtime verification. That means that almost every time someone reports benchmark results or performance bugs from their own Swift build, the information is misleading until eventually someone wastes time tracking that down, which is often months later. We've had people working on Swift for up to a year without realizing that all their results were bogus. How long was linux being built incorrectly because of this?

@augusto2112
Copy link
Contributor

@drexin @atrick let me try to explain the problem we're having, and maybe we can come up with a solution together. Basically, we have some runtime functions that return metadata-related information when dealing with Linux (this is due to some constraints in the ELF format). We use these to provide the reflection tests the information they need to run themselves. Because this is used exclusively during testing, and shouldn't do anything on release, these functions have an empty body when assertions are off. So now you see what the problem is from our perspective. Do you have any suggestions on how we can solve this issue?

@atrick
Copy link
Member

atrick commented Aug 31, 2020

Yep, the release build obviously should not enable any runtime verification by default. I'm very unhappy with the build-script defaults, but hopefully this PR fixed your specific problem.

@augusto2112
Copy link
Contributor

@atrick the problem is since stdlib's assertions are off, we can't run the reflection tests, since the function functions we added should only run with assertions on.

@atrick
Copy link
Member

atrick commented Sep 1, 2020

Reflection testing would need the build with --stdlib-assertions. There are other stdlib unit tests that also require stdlib asserts enabled.

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.

None yet

6 participants