Skip to content

[test] add test feature static_stdlib #1806

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 29, 2016
Merged

[test] add test feature static_stdlib #1806

merged 1 commit into from
Mar 29, 2016

Conversation

drewcrawford
Copy link
Contributor

What's in this pull request?

I intend to PR some tests (not shown here) which involve working with the static standard library ("static stdlib"). It is hard to write these tests right now, and that is quite possibly why no tests involving static stdlib were written, leading to various highly complex bugs in static stdlib behavior that have gone unnoticed (not shown here).

The static standard library is not built by default (e.g. build-script -t does not build it) and so these tests would be only appropriate to run if static stdlib was built.

This PR adds:

  • a new feature to lit.cfg, allowing the conditioning of a test on the building of the static library
  • a new substitution, with the path of the static standard library

Resolved bug number: (SR-)

This is involved in, but does not resolve, SR-730


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

Add a test feature flag static_stdlib, which is enabled if the user
builds the static libraries.

We also add the substitution %target-static-stdlib-path which gives the
path of the static stdlib.

These features allow testing specifically for the static standard
library.
@gribozavr
Copy link
Contributor

To review, it would be helpful to understand better what you're trying to do with this.

For example, it seems to me that to get cheaply a lot of coverage for the static library we would just need to add a mode that changes the default compiler invocation to use the static library (just like we already have one that uses -O instead of -Onone).

@drewcrawford
Copy link
Contributor Author

we would just need to add a mode that changes the default compiler invocation to use the static library (just like we already have one that uses -O instead of -Onone).

Yes, that is the subject of SR-730. I will be PRing that, and when I do, its test coverage will rely on a static_stdlib gate for testing. Obviously the flag cannot work if the static stdlib was not built, which is the default.

However there are more problems here than merely driver flags. For example, currently any program linked with the static standard library on Linux (e.g. supposing we completely bypass the driver) has broken protocol conformance due to a quirk of the Linux runtime. You can read more about that also on SR-730. I will also be PRing that, and when I do, its test coverage will similarly rely on a static_stdlib gate, becuase we cannot test if the static stdlib was not built.

Static stdlib (on Linux, anyway) is very, very badly broken right now. This is in part because there is no test coverage, because test coverage is too hard to write, so problems are not found.

Obviously would be great to reuse all existing tests with a flag, but we are many PRs away from that being feasible. Right now not even "hello world" will link properly on Linux, and IMO the bugs are sufficiently separate that they should be separate PRs.

@tkremenek
Copy link
Member

@swift-ci test and merge

@swift-ci swift-ci merged commit 56e3875 into swiftlang:master Mar 29, 2016
@drewcrawford drewcrawford deleted the test-infrastructure-squashed branch March 30, 2016 00:29
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