r-hub / rhub-linux-builders

Docker configuration for the R-hub Linux builders
GNU General Public License v2.0
23 stars 13 forks source link

Inconsistencies with CRAN fedora-clang-devel #63

Open gowerc opened 2 years ago

gowerc commented 2 years ago

We have been trying to track down a bug in our package that only appears on CRAN fredora-clang-devel. Whilst investigating it looks like there are a number of inconsistencies between the image on Rhub vs what CRAN are running. That being said I'm not very experienced with this system configuration stuff so apologies if I have got this wrong.

In particular:

The impact though is that my unit tests are running fine on your image via rhub::check(platform = "fedora-clang-devel") even though they are failing to run on CRAN.

jameslamb commented 1 year ago

I've observed the same thing with the debian-clang-devel images.

The images are using clang 14

docker run \
    --rm \
    rhub/debian-clang-devel:latest \
    clang --version
Debian clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix

But according to https://cran.r-project.org/web/checks/check_flavors.html#r-devel-linux-x86_64-debian-clang, CRAN is using clang 15.

Screen Shot 2023-01-04 at 2 28 41 PM
jameslamb commented 1 year ago

Over in {lightgbm}, we recently experienced an issue where CRAN raised a warning for the r-devel-linux-x86_64-debian-clang check flavor (link to logs) that we didn't observe running R CMD check --as-cran in the rhub/debian-clang-devel image published here.

Found the following significant warnings:
  io/json11.cpp:207:47: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
  ...

https://github.com/microsoft/LightGBM/issues/5661

I just found that I was able to reproduce the warning I see over on CRAN by running the following in a container using that image, to upgrade to clang v15.

# remove clang stuff that comes installed in the image
apt-get autoremove -y --purge \
    clang-* \
    libclang-* \
    libunwind-* \
    llvm-*

# download equivalent clang-15 packages
apt-get update -y
apt-get install --no-install-recommends -y \
    gnupg \
    lsb-release \
    software-properties-common \
    wget

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

add-apt-repository "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main"
apt-get install -y --no-install-recommends \
    clang-15 \
    clangd-15 \
    clang-format-15 \
    clang-tidy-15 \
    clang-tools-15 \
    lldb-15 \
    lld-15 \
    llvm-15-dev \
    llvm-15-tools \
    libomp-15-dev \
    libc++-15-dev \
    libc++abi-15-dev \
    libclang-common-15-dev \
    libclang-15-dev \
    libclang-cpp15-dev \
    libunwind-15-dev

# overwrite everything in /usr/bin with the new v15 versions
cp --remove-destination /usr/lib/llvm-15/bin/* /usr/bin/

@gaborcsardi @maelle are you open to a pull request with something similar to this, to upgrade the debian and fedora images to clang 15? I'd be happy to work on such a change, test it, and propose a pull request if you support the general idea.

gaborcsardi commented 1 year ago

We are planning on rolling out new images in a week or so.

jameslamb commented 1 year ago

Oh great, glad to hear it! Thanks so much.

My offer still stands, I'm happy to help out here any time if you want. I depend on these images so much.