Skip to content

[CMake] Warn about not using libcxx #15204

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

Conversation

davezarzycki
Copy link
Contributor

For example, pull request: #15191

@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

@jrose-apple
Copy link
Contributor

Please don't. We don't want to require libcxx; it's an error if our tests do.

@jrose-apple
Copy link
Contributor

We could have just as much of a problem between libcxx versions.

@davezarzycki
Copy link
Contributor Author

That's why I used WARNING and the word "untested". As a warning, do you still object to this? If yes, then how do you feel about just printing the status of LLVM_ENABLE_LIBCXX as a hint that Swift mildly cares and for help in debugging other people's configurations?

@davezarzycki
Copy link
Contributor Author

Also, unless I'm missing something, the build-script always sets LLVM_ENABLE_LIBCXX, therefore as the only blessed way to build swift, LLVM_ENABLE_LIBCXX is effectively required.

@jrose-apple
Copy link
Contributor

Does LLVM_ENABLE_LIBCXX fail on systems that don't have libc++ present, though? We probably already get a warning just from that.

@davezarzycki
Copy link
Contributor Author

davezarzycki commented Mar 13, 2018

Swift doesn't do anything other than pass -DLLVM_ENABLE_LIBCXX=TRUE as a part of the build script; and LLVM ToT seems to assume that LLVM_ENABLE_LIBCXX=TRUE will work if set, but it fails by accident if libcxx is not installed (Host compiler must support std::atomic! on Fedora Linux 27).

I'm happy to close this PR if you think LLVM should just error out and then Swift can rely on that check.

@jrose-apple
Copy link
Contributor

That sounds like it would work if you had a newer libstdc++.

I'm not sure why you're pushing for this. We had a test failure because the C++ standard library was different on different platforms. That's a problem with the test. We fixed it. Why would you want to warn here?

@davezarzycki
Copy link
Contributor Author

Right now, unified builds "just work", but there are minor configuration differences. While I'd prefer to make those differences disappear, I don't think that unified builds need to be intentionally hard either. It seems reasonable to me to warn unified build users about important differences. Of course, reasonable people can disagree about whether untested C++ standard libraries count as an important difference.

You know, come to think about it, why is build-script force enabling LLVM_ENABLE_LIBCXX? I'd wager that dates back to when macOS had both C++ standard libraries installed. Can we just delete it from the build-script? That would also make me happy. :-)

@compnerd
Copy link
Member

@davezarzycki I definitely use three different C++ runtimes: libstdc++, msvcprt, and libc++.

@jrose-apple
Copy link
Contributor

Let's take this to the forums; maybe someone there will remember why LLVM_ENABLE_LIBCXX was added in the first place.

@davezarzycki
Copy link
Contributor Author

Which forum? Compiler? something else?

@jrose-apple
Copy link
Contributor

Compiler is fine. There's theoretically a distinction between the C++ stdlib we use for the compiler and the one we use for the runtime as well, but…that's probably a separate issue.

@davezarzycki
Copy link
Contributor Author

https://forums.swift.org/t/rfc-remove-hard-coding-of-libc-from-the-build-script/10958

@davezarzycki
Copy link
Contributor Author

I'm abandoning this PR in favor of no longer hard coding the use of libcxx by the build script. See #15233

@davezarzycki davezarzycki deleted the nfc_cmake_warn_about_not_libcxx_configs branch March 14, 2018 13:37
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