-
Notifications
You must be signed in to change notification settings - Fork 711
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
[libclang5] Wrong code generation surfaced by #2787 #2922
Comments
Here's a Dockerfile for anyone who wants to mess with llvm7/libclang5: FROM centos:7
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
RUN yum -y update
RUN yum install -y liblz4-dev curl make python3 pigz zlib-devel openssl centos-release-scl scl-utils scl-utils-build gcc gcc-c++
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
RUN yum install -y llvm-toolset7
ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash
USER ${USERNAME}
WORKDIR /home/${USERNAME}
# Rust install
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y Use For those who still need CentOS 7 but need llvm11/libclang11: FROM centos:7
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
RUN yum -y update
RUN yum install -y liblz4-dev curl make python3 pigz zlib-devel openssl centos-release-scl scl-utils scl-utils-build gcc gcc-c++
RUN <<EOF cat > /etc/yum.repos.d/llvmtoolset-build.repo
[llvmtoolset-build]
name=LLVM Toolset 11.0 - Build
baseurl=https://buildlogs.centos.org/c7-llvm-toolset-11.0.x86_64/
gpgcheck=0
enabled=1
EOF
RUN yum install -y --nogpgcheck llvm-toolset-11.0
ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash
USER ${USERNAME}
WORKDIR /home/${USERNAME}
# Rust install
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y Use |
I checked as far as I could with Maybe @emilio has some idea on when this happened as he has been around longer |
As @Kriskras99 says above, I suggest the answer to this issue is to drop support for libclang 5.0, in the spirit of #2166 and its related PRs, and moreover to prevent linking or loading libclang 5.0 or older. But this is just a drive-by opinion; I have nothing more useful to add. |
Yes. In fact we no longer have CI for libclang 5 (oldest is libclang 9). It seems that what is going on is the following:
I don't think this would be fixable on our end even if we wanted to fix it. |
Shall I create a PR to update the requirements page in the User Guide to libclang 9? |
That would be much appreciated
Not as a constant but maybe as a build error. On the other hand, I think its up to the folks using bindgen if they decide an unsupported version of clang if it just happen to work correctly on some instances and they have some weird restriction on their environment setup that prevents them from using a more recent version. It might be better to not explicitly forbid clang 5 from that perspective. |
If bindgen does not support libclang5 anymore (very reasonable stance), then this issue can be immediately closed.
This issue was surfaced by #2787
Input C/C++ Header
Bindgen Invocation
Actual Results
llvm7/libclang5 generated bindings:
causing
llvm11/libclang11 generated bindings (these do work)
Expected Results
The bindings to not break the compiler.
Note that it's not only field offsets that can go wrong, in the original header the size_of is also wrong:
I'd like to repeat, that it's perfectly valid to drop libclang5. Even for CentOS 7 users there is the possibility to install libclang11.
The text was updated successfully, but these errors were encountered: