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

Install libc++-11 with clang-11 #252

Closed
wants to merge 1 commit into from
Closed

Conversation

Woazim
Copy link

@Woazim Woazim commented Mar 1, 2021

Changelog: Fix: This is to install libc++-11 instead of default one (6 or 7, very old)

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've followed the Best Practices guides for Dockerfile.

fixes #251

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

Unfortunately we can't accept this change. Updating libstdc++ or libstdc++11 will break official packages in Conan Center. If you really need a newer version, we can do it locally.

We will provide new Docker images soon, including newer libc version. Thus, your hotfix is still a valid idea, but it will be included for other Docker images.

@uilianries uilianries closed this Mar 2, 2021
@uilianries
Copy link
Member

Looking conan-io/conan-center-index#4630, it seems like no clang-11 package has been generated yet. Thus, it's possible to accept your PR.

@uilianries uilianries reopened this Mar 2, 2021
Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

@uilianries uilianries self-requested a review March 3, 2021 14:50
Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

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

Need to understand the implications. If we upgrade this library to version libc++11, then the binaries compiled using this new version can run with the old one? Does every consumer need to upgrade to libc++11 in order to run the binaries compiled with it?

That would be a blocker, as libc++ will be the default for many users.

@Woazim
Copy link
Author

Woazim commented Mar 4, 2021

I think there is a misunderstanding. clang-11 should come with libcxx-11. But this lib and its ABI must be installed separately as it's noticed in official clang page here (see 'To install all key packages' / '# Clang and co'. If you just install libcxx through apt-get install libcxx-dev you install a very old version of libcxx (version 6). This version does not support modern C++ and is not what clang-11 users expect.

By the way, this official LLVM link explains that "Libc++ aims to preserve stable ABI to avoid subtle bugs when code built to the old ABI is linked with the code build to the new ABI". So it should not be a problem to correct this, but, I agree with you, it can not be sure.

Finally, this Dockerfile is not consistent with the one for clang-10 (which is good). You'll see on these lines that libcxx-10-dev is installed (not libcxx-dev).

I'm sorry, but there is clearly a problem with this clang-11 installation. I don't know the right way to correct this, but it must be corrected. From your side, is it possible to rebuild all clang-11/libcxx in conan-center recipes to avoid side effects?

@jgsogo
Copy link
Contributor

jgsogo commented Mar 4, 2021

We will be using the same docker image for all the compilers (we are proposing Ubuntu 16.04) to ensure all the binaries have the same and a lower enough glibc version (this is convenient for the build_requirements). All current images will be deprecated in favor of those ones.

The issue would be, for example, if we build some tool using clang-11 (with libc++11) and then we need to run that tool on the images we use for all the gcc and clang compilers... will it run?

@uilianries
Copy link
Member

I didn't find any clear information about libc++ backward compatibility, but Marshall Clow (libc++ owner) answered that it should work.

@Woazim
Copy link
Author

Woazim commented Mar 4, 2021

I've run a little test: I build ImaGL and its test program with clang-11, libc++-11. I ran it on a fresh Ubuntu 16.04 with default libc++ (v3.7) without any problem.

@jgsogo
Copy link
Contributor

jgsogo commented Mar 5, 2021

There are several questions that came to me related to this issue and they will help us a lot with other ongoing efforts as well.

  • The plan is to move to the same base docker image for all the Linux compilers, ATM the chosen one is Ubuntu 16.04 (LTS). We still don't know if this scenario is possible, there are some questions that need answers:

    Maybe we realize we cannot use the same base image for all the compilers and it will totally change the perspective from where to look at this issue.

  • We need to understand why the libc++ package now is called libc++11, surely there is some ABI break. We just need to confirm it, it is ok to write a demo app to demonstrate it. It won't be a blocker, but we need to know the implications of the decision.

    • Can LIBCXX_ABI_VERSION help us? Can we use version 11 but use LIBCXX_ABI_VERSION to target old ABIs and still get all the modern C++ features?
  • If ABI is incompatible, should we consider it as a new entry to compiler.libcxx for Clang compilers and add libc++11 to the list?

@uilianries
Copy link
Member

I would to continue this discussion about unifying or not at #205, which is the appropriated issue. This PR is related to clang fix.

@jgsogo
Copy link
Contributor

jgsogo commented Mar 5, 2021

I think I did some fundamental failure above. The runtime packages are libc++abi1-11 and libc++1-11 which (if I'm reading the names properly) are compatible for all versions from 1 to 11 (Ubuntu 20.04). So, they must be able to run any binary compiled up to libc++-11-dev.

So, this is not about installing libc++-11 as the runtime, as a different package from libc++, this is only about upgrading the dev library (package libc++-11-dev)... and we will need to be sure that we can install libc++abi1-11/libc++1-11 in the base image we want to use.

The question, for this issue, is just: are there libc++abi1-11/libc++1-11 packages available for Ubuntu 16.04? If not, can we build them from sources?

Sorry for the misunderstanding.

@Woazim
Copy link
Author

Woazim commented Mar 5, 2021

The question, for this issue, is just: are there libc++abi1-11/libc++1-11 packages available for Ubuntu 16.04? If not, can we build them from sources?

Short answer: yes

Long answer: yes, following these instructions from a docker ubuntu:xenial image:

apt-get update
apt-get install -y wget software-properties-common apt-transport-https
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
add-apt-repository "deb http://apt.llvm.org/xenial/   llvm-toolchain-xenial-11  main"
apt-get update
apt-get install -y libc++1-11 libc++abi1-11

By the way, libc++1-12 and libc++abi1-12 from clang-12 are also installable with this script.

@jgsogo
Copy link
Contributor

jgsogo commented Jun 9, 2021

Please, have a look to this approach: #267

@ericLemanissier ericLemanissier mentioned this pull request Oct 1, 2021
5 tasks
@ericLemanissier
Copy link
Contributor

This can now be closed

@jgsogo jgsogo closed this Oct 2, 2021
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.

Wrong libc++ version installed with clang-11
5 participants