Copilot commented on code in PR #50299: URL: https://github.com/apache/arrow/pull/50299#discussion_r3497315558
########## ci/scripts/r_docker_configure.sh: ########## @@ -86,5 +86,17 @@ else fi +# Update clang version to latest available. +# The rhub/ubuntu-clang image ships clang-15 but CRAN's debian-clang now uses +# clang 22. Install clang-22 from LLVM's apt repos to match. +if [ "$R_UPDATE_CLANG" = true ]; then + apt-get update -y --allow-releaseinfo-change + apt-get install -y gnupg + curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/llvm.gpg + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-22 main" > /etc/apt/sources.list.d/llvm22.list + apt-get update -y --allow-releaseinfo-change + apt-get install -y clang-22 lld-22 +fi Review Comment: The clang update block hardcodes the Ubuntu codename (jammy) and uses an HTTP apt repo; this is brittle if the rhub image base changes and it needlessly weakens transport security. Also, the script doesn’t explicitly ensure the `clang`/`clang++` commands resolve to v22 after installation, so the build may still compile with the older default compiler. Consider deriving the distro codename from `/etc/os-release`, using `https` + `signed-by=`, and explicitly selecting clang-22 via `update-alternatives` (and logging `clang --version` for traceability). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
