From 93cd20d5df8b3c3c1b7d82ba070228b6269a4cda Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 6 Feb 2023 17:12:58 +0900 Subject: [PATCH 01/21] GH-32292: [R][Packaging] Use binaries build on CentOS 7 for Ubuntu < 22.04 Binaries build on CentOS 7 uses `_GLIBCXX_USE_CXX11_ABI=0`. So we can't use them on Ubuntu 20.04 because Ubuntu 20.04 uses `_GLIBCXX_USE_CXX11_ABI=1`. If we use them on Ubuntu 20.04, our R package should also uses `_GLIBCXX_USE_CXX11_ABI=0`. This changes adds `-D_GLIBCXX_USE_CXX11_ABI=0` to `Cflags` in `arrow.pc`. our R package uses `Cflags` in `arrow.pc`. So users don't need to specify `-D_GLIBCXX_USE_CXX11_ABI=0` explicitly. --- cpp/CMakeLists.txt | 1 + cpp/src/arrow/CMakeLists.txt | 16 ++++++++++++++-- dev/tasks/macros.jinja | 2 +- dev/tasks/r/github.packages.yml | 1 - dev/tasks/tasks.yml | 1 - r/tools/nixlibs.R | 20 +++----------------- r/tools/test-nixlibs.R | 6 +++--- r/vignettes/developers/setup.Rmd | 3 +-- r/vignettes/install.Rmd | 4 ++-- 9 files changed, 25 insertions(+), 29 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 14de0cd496af..b6d18cd39f49 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -491,6 +491,7 @@ enable_testing() # For arrow.pc. Cflags.private, Libs.private and Requires.private are # used when "pkg-config --cflags --libs --static arrow" is used. +set(ARROW_PC_CFLAGS "") set(ARROW_PC_CFLAGS_PRIVATE " -DARROW_STATIC") set(ARROW_PC_LIBS_PRIVATE "") set(ARROW_PC_REQUIRES_PRIVATE "") diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index 28f37af9bf14..a3233148cc72 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -601,6 +601,19 @@ if(ARROW_BUILD_BUNDLED_DEPENDENCIES) string(APPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies") list(INSERT ARROW_STATIC_INSTALL_INTERFACE_LIBS 0 "Arrow::arrow_bundled_dependencies") endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(GLIBCXX_USE_CXX11_ABI_SOURCE + ${CMAKE_CURRENT_BINARY_DIR}/try_compile_glibcxx_use_cxx_abi.cc) + file(WRITE ${GLIBCXX_USE_CXX11_ABI_SOURCE} "#if !_GLIBCXX_USE_CXX11_ABI\n" + "#error Not using CXX11 ABI\n" "#endif\n") + try_compile(IS_GLIBCXX_USE_CXX11_ABI ${CMAKE_CURRENT_BINARY_DIR}/try_compile + SOURCES ${GLIBCXX_USE_CXX11_ABI_SOURCE}) + if(NOT IS_GLIBCXX_USE_CXX11_ABI) + string(APPEND ARROW_PC_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0") + endif() +endif() + # Need -latomic on Raspbian. # See also: https://issues.apache.org/jira/browse/ARROW-12860 if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7") @@ -614,7 +627,7 @@ endif() # linking. ARROW_PC_* except ARROW_PC_*_PRIVATE are for the static # linking case. if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC) - set(ARROW_PC_CFLAGS "${ARROW_PC_CFLAGS_PRIVATE}") + string(APPEND ARROW_PC_CFLAGS "${ARROW_PC_CFLAGS_PRIVATE}") set(ARROW_PC_CFLAGS_PRIVATE "") set(ARROW_PC_LIBS "${ARROW_PC_LIBS_PRIVATE}") set(ARROW_PC_LIBS_PRIVATE "") @@ -624,7 +637,6 @@ if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC) string(APPEND ARROW_TESTING_PC_CFLAGS "${ARROW_TESTING_PC_CFLAGS_PRIVATE}") set(ARROW_TESTING_PC_CFLAGS_PRIVATE "") else() - set(ARROW_PC_CFLAGS "") set(ARROW_PC_LIBS "") set(ARROW_PC_REQUIRES "") endif() diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index 9cb0c0f8a847..b1dcd7561c8b 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -320,7 +320,7 @@ on: path: repo/libarrow/bin/windows {% endif %} {% if get_nix %} - {% for os in ["ubuntu-18.04", "ubuntu-22.04", "centos-7"] %} + {% for os in ["ubuntu-22.04", "centos-7"] %} - name: Get {{ os }} binary uses: actions/download-artifact@v3 with: diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index b02fc0ade5cd..d2da5febf38a 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -64,7 +64,6 @@ jobs: fail-fast: false matrix: config: - - { os: ubuntu, version: "18.04" } - { os: ubuntu, version: "22.04" } - { os: centos, version: "7" } env: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index b345bcd48e9a..19f1f35de181 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -990,7 +990,6 @@ tasks: artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__centos-7__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__ubuntu-18.04__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.2__arrow_{no_rc_r_version}\.zip diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 3d9edf03687b..f91bc3bb4678 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -99,8 +99,7 @@ download_binary <- function(lib) { # * Some other string: a "distro-version" that corresponds to a binary that is # available, to override what this function may discover by default. # Possible values are: -# * "centos-7" (gcc 8 (devtoolset), openssl 1, glib 2.17) -# * "ubuntu-18.04" (gcc 8, openssl 1, glib 2.27) +# * "centos-7" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1) # * "ubuntu-22.04" (openssl 3) # These string values, along with `NULL`, are the potential return values of # this function. @@ -168,10 +167,6 @@ test_for_curl_and_openssl <- " #error Using libc++ #endif -#if !( __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 27) -#error glibc version too old -#endif - #include #include #if OPENSSL_VERSION_NUMBER < 0x10002000L @@ -190,14 +185,13 @@ compile_test_program <- function(code) { suppressWarnings(system2("echo", sprintf('"%s" | %s -', code, runner), stdout = FALSE, stderr = TRUE)) } -# TODO(ARROW-16976): drop "ubuntu-18.04" and just use "centos-7" # (built with newer devtoolset but older glibc (2.17) for broader compatibility,# like manylinux2014) determine_binary_from_stderr <- function(errs) { if (is.null(attr(errs, "status"))) { # There was no error in compiling: so we found libcurl and openssl > 1.0.2, - # openssl is < 3.0, glibc is >= 2.27, and we're not using a strict libc++ + # openssl is < 3.0, and we're not using a strict libc++ cat("*** Found libcurl and openssl >= 1.0.2\n") - return("ubuntu-18.04") + return("centos-7") # Else, check for dealbreakers: } else if (any(grepl("Using libc++", errs, fixed = TRUE))) { # Our binaries are all built with GNU stdlib so they fail with libc++ @@ -213,14 +207,6 @@ determine_binary_from_stderr <- function(errs) { cat("*** openssl found but version >= 1.0.2 is required for some features\n") return(NULL) # Else, determine which other binary will work - } else if (any(grepl("glibc version too old", errs))) { - # ubuntu-18.04 has glibc 2.27, so even if you install newer compilers - # (e.g. devtoolset on centos) and have curl/openssl, you run into problems - # TODO(ARROW-16976): build binaries with older glibc - cat("*** Checking glibc version\n") - # If we're here, we're on an older OS but with a new enough compiler - # (e.g. CentOS 7 with devtoolset-8) - return("centos-7") } else if (any(grepl("Using OpenSSL version 3", errs))) { cat("*** Found libcurl and openssl >= 3.0.0\n") return("ubuntu-22.04") diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R index 631ff7a3e351..3676f6f323bb 100644 --- a/r/tools/test-nixlibs.R +++ b/r/tools/test-nixlibs.R @@ -26,7 +26,7 @@ source("nixlibs.R", local = TRUE) test_that("identify_binary() based on LIBARROW_BINARY", { expect_null(identify_binary("FALSE")) - expect_identical(identify_binary("ubuntu-18.04"), "ubuntu-18.04") + expect_identical(identify_binary("centos-7"), "centos-7") expect_null(identify_binary("", info = list(id = "debian"))) }) @@ -52,7 +52,7 @@ test_that("determine_binary_from_stderr", { expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("int a;")), - "ubuntu-18.04" + "centos-7" ), "Found libcurl and openssl >= 1.0.2" ) @@ -75,7 +75,7 @@ test_that("select_binary() with test program", { expect_output( expect_identical( select_binary("linux", "x86_64", "int a;"), - "ubuntu-18.04" + "centos-7" ), "Found libcurl and openssl >= 1.0.2" ) diff --git a/r/vignettes/developers/setup.Rmd b/r/vignettes/developers/setup.Rmd index 88f14a189737..85d9693a3bac 100644 --- a/r/vignettes/developers/setup.Rmd +++ b/r/vignettes/developers/setup.Rmd @@ -54,8 +54,7 @@ On Linux, you can download a .zip file containing libarrow from the [nightly repository](https://nightlies.apache.org/arrow/r/libarrow/bin/). The directory names correspond to the OS the binaries where built on: -- "centos-7" (gcc 8 via devtoolset, openssl 1, glib 2.17) -- "ubuntu-18.04" (gcc 8, openssl 1, glib 2.27) +- "centos-7" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1) - "ubuntu-22.04" (openssl 3) Version numbers in that repository correspond to dates. diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd index 8051debc8439..58cc57991db1 100644 --- a/r/vignettes/install.Rmd +++ b/r/vignettes/install.Rmd @@ -297,8 +297,8 @@ See below for more in-depth explanations of these environment variables. will work with your system. You can set it to `false` to skip this option altogether, or you can specify a string "distro-version" that corresponds to a binary that is available, to override what this function may discover by - default. Possible values are: "centos-7", - "ubuntu-18.04" (both with gcc 8, and openssl 1), "ubuntu-22.04" (openssl 3). + default. Possible values are: "centos-7" (openssl 1), "ubuntu-22.04" + (openssl 3). * `LIBARROW_BUILD` : If set to `false`, the build script will not attempt to build the C++ from source. This means you will only get a working arrow R package if a prebuilt binary is found. From 2b8c35f31a625d45006c7550343a23a6e265597d Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 6 Feb 2023 18:16:57 +0900 Subject: [PATCH 02/21] More robust --- cpp/src/arrow/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index a3233148cc72..a3e9f7c7334b 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -605,8 +605,12 @@ endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(GLIBCXX_USE_CXX11_ABI_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/try_compile_glibcxx_use_cxx_abi.cc) - file(WRITE ${GLIBCXX_USE_CXX11_ABI_SOURCE} "#if !_GLIBCXX_USE_CXX11_ABI\n" - "#error Not using CXX11 ABI\n" "#endif\n") + file(WRITE ${GLIBCXX_USE_CXX11_ABI_SOURCE} + "#include \n" + "#if !_GLIBCXX_USE_CXX11_ABI\n" + "#error Not using CXX11 ABI\n" + "#endif\n" + "int main(void) {return 0;}\n") try_compile(IS_GLIBCXX_USE_CXX11_ABI ${CMAKE_CURRENT_BINARY_DIR}/try_compile SOURCES ${GLIBCXX_USE_CXX11_ABI_SOURCE}) if(NOT IS_GLIBCXX_USE_CXX11_ABI) From d0fdb851e72e8761253691e0367f7329ba7cd252 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 6 Feb 2023 21:27:00 +0900 Subject: [PATCH 03/21] Ensure installing pkg-config --- ci/scripts/r_install_system_dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/r_install_system_dependencies.sh b/ci/scripts/r_install_system_dependencies.sh index d824c3e81ed7..b7bddb204d79 100755 --- a/ci/scripts/r_install_system_dependencies.sh +++ b/ci/scripts/r_install_system_dependencies.sh @@ -37,10 +37,10 @@ if [ "$ARROW_S3" == "ON" ] || [ "$ARROW_GCS" == "ON" ] || [ "$ARROW_R_DEV" == "T # Install curl and OpenSSL for S3/GCS support case "$PACKAGE_MANAGER" in apt-get) - apt-get install -y libcurl4-openssl-dev libssl-dev + apt-get install -y libcurl4-openssl-dev libssl-dev pkg-config ;; *) - $PACKAGE_MANAGER install -y libcurl-devel openssl-devel + $PACKAGE_MANAGER install -y libcurl-devel openssl-devel pkg-config ;; esac From 7c79ea46611c15ebeb1b92f58b5389ecb558b1fa Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 9 Feb 2023 15:47:06 +0900 Subject: [PATCH 04/21] Don't require pkg-config --- ci/scripts/r_install_system_dependencies.sh | 4 ++-- r/configure | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/scripts/r_install_system_dependencies.sh b/ci/scripts/r_install_system_dependencies.sh index b7bddb204d79..d824c3e81ed7 100755 --- a/ci/scripts/r_install_system_dependencies.sh +++ b/ci/scripts/r_install_system_dependencies.sh @@ -37,10 +37,10 @@ if [ "$ARROW_S3" == "ON" ] || [ "$ARROW_GCS" == "ON" ] || [ "$ARROW_R_DEV" == "T # Install curl and OpenSSL for S3/GCS support case "$PACKAGE_MANAGER" in apt-get) - apt-get install -y libcurl4-openssl-dev libssl-dev pkg-config + apt-get install -y libcurl4-openssl-dev libssl-dev ;; *) - $PACKAGE_MANAGER install -y libcurl-devel openssl-devel pkg-config + $PACKAGE_MANAGER install -y libcurl-devel openssl-devel ;; esac diff --git a/r/configure b/r/configure index 05ff4ae93c2d..dc0e8e63192b 100755 --- a/r/configure +++ b/r/configure @@ -211,6 +211,9 @@ else else # This case must be ARROW_DEPENDENCY_SOURCE=BUNDLED. PKG_CFLAGS="-I${LIB_DIR}/../include $PKG_CFLAGS" + if grep -q "_GLIBCXX_USE_CXX11_ABI=0" "${LIB_DIR}/pkgconfig/arrow.pc"; then + PKG_CFLAGS="${PKG_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0" + fi PKG_DIRS="-L${LIB_DIR}" if [ "${OPENSSL_ROOT_DIR}" != "" ]; then PKG_DIRS="${PKG_DIRS} -L${OPENSSL_ROOT_DIR}/lib" From 93274ea289188e9043be6a5ef9ef96df7dab8f08 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 9 Feb 2023 16:04:47 +0900 Subject: [PATCH 05/21] Use static OpenSSL --- r/inst/build_arrow_static.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh index 800b9cde3f62..e11992ff0d0a 100755 --- a/r/inst/build_arrow_static.sh +++ b/r/inst/build_arrow_static.sh @@ -65,6 +65,7 @@ ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \ -DARROW_JEMALLOC=${ARROW_JEMALLOC:-$ARROW_DEFAULT_PARAM} \ -DARROW_MIMALLOC=${ARROW_MIMALLOC:-ON} \ -DARROW_JSON=${ARROW_JSON:-ON} \ + -DARROW_ARROW_OPENSSL_USE_SHARED=OFF \ -DARROW_PARQUET=${ARROW_PARQUET:-ON} \ -DARROW_S3=${ARROW_S3:-$ARROW_DEFAULT_PARAM} \ -DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI:-$ARROW_DEFAULT_PARAM} \ From d8e426803be97053640a8914d6e8e912204a453b Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 10 Feb 2023 12:53:46 +0900 Subject: [PATCH 06/21] Fix a typo --- r/inst/build_arrow_static.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh index e11992ff0d0a..ffe50c463e42 100755 --- a/r/inst/build_arrow_static.sh +++ b/r/inst/build_arrow_static.sh @@ -65,7 +65,7 @@ ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \ -DARROW_JEMALLOC=${ARROW_JEMALLOC:-$ARROW_DEFAULT_PARAM} \ -DARROW_MIMALLOC=${ARROW_MIMALLOC:-ON} \ -DARROW_JSON=${ARROW_JSON:-ON} \ - -DARROW_ARROW_OPENSSL_USE_SHARED=OFF \ + -DARROW_OPENSSL_USE_SHARED=OFF \ -DARROW_PARQUET=${ARROW_PARQUET:-ON} \ -DARROW_S3=${ARROW_S3:-$ARROW_DEFAULT_PARAM} \ -DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI:-$ARROW_DEFAULT_PARAM} \ From 15fd156c930aca08fca9579c458f0cdd8d972d80 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 10 Feb 2023 13:44:03 +0900 Subject: [PATCH 07/21] Install libssl.a --- ci/docker/centos-7-cpp.dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/docker/centos-7-cpp.dockerfile b/ci/docker/centos-7-cpp.dockerfile index f4e0430aad69..545cd1282894 100644 --- a/ci/docker/centos-7-cpp.dockerfile +++ b/ci/docker/centos-7-cpp.dockerfile @@ -25,6 +25,7 @@ RUN yum install -y \ libcurl-devel \ make \ openssl-devel \ + openssl-static \ wget \ which From ab1b1d3880c8a1d67f9f1e322798655051fd37cf Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 02:05:25 +0900 Subject: [PATCH 08/21] Build with OpenSSL 1.1 --- ci/docker/centos-7-cpp.dockerfile | 40 +++++++++++++++---------------- dev/tasks/macros.jinja | 8 +++---- dev/tasks/r/github.packages.yml | 22 ++++++++++++----- dev/tasks/tasks.yml | 3 ++- docker-compose.yml | 2 +- r/inst/build_arrow_static.sh | 1 - r/tools/nixlibs.R | 17 +++++++++---- r/vignettes/developers/setup.Rmd | 3 ++- r/vignettes/install.Rmd | 4 ++-- 9 files changed, 58 insertions(+), 42 deletions(-) diff --git a/ci/docker/centos-7-cpp.dockerfile b/ci/docker/centos-7-cpp.dockerfile index 545cd1282894..8c1893cbbb2a 100644 --- a/ci/docker/centos-7-cpp.dockerfile +++ b/ci/docker/centos-7-cpp.dockerfile @@ -17,29 +17,27 @@ FROM centos:centos7 -RUN yum install -y \ - centos-release-scl \ - curl \ - diffutils \ - gcc-c++ \ - libcurl-devel \ - make \ - openssl-devel \ - openssl-static \ - wget \ - which - # devtoolset is required for C++17 -RUN yum install -y devtoolset-8 - -# yum install cmake version is too old -ARG cmake=3.23.1 -RUN mkdir /opt/cmake-${cmake} -RUN wget -nv -O - https://github.com/Kitware/CMake/releases/download/v${cmake}/cmake-${cmake}-Linux-x86_64.tar.gz | \ - tar -xzf - --strip-components=1 -C /opt/cmake-${cmake} +RUN \ + yum install -y \ + centos-release-scl \ + epel-release && \ + yum install -y \ + cmake3 \ + curl \ + devtoolset-8 \ + diffutils \ + gcc-c++ \ + libcurl-devel \ + make \ + openssl-devel \ + openssl11-devel \ + wget \ + which COPY ci/scripts/install_sccache.sh /arrow/ci/scripts/ RUN bash /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin -ENV PATH=/opt/cmake-${cmake}/bin:$PATH \ - ARROW_R_DEV=TRUE +ENV \ + ARROW_R_DEV=TRUE \ + CMAKE=/usr/bin/cmake3 diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index b1dcd7561c8b..a68bcbccd22b 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -320,12 +320,12 @@ on: path: repo/libarrow/bin/windows {% endif %} {% if get_nix %} - {% for os in ["ubuntu-22.04", "centos-7"] %} - - name: Get {{ os }} binary + {% for id in ["ubuntu-22.04", "centos-7", "centos-7-openssl-1.1"] %} + - name: Get {{ id }} binary uses: actions/download-artifact@v3 with: - name: r-lib__libarrow__bin__{{ os }} - path: repo/libarrow/bin/{{ os }} + name: r-lib__libarrow__bin__{{ id }} + path: repo/libarrow/bin/{{ id }} {% endfor %} {% endif %} - name: Get src pkg diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index d2da5febf38a..14c783ef6b96 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -63,9 +63,17 @@ jobs: strategy: fail-fast: false matrix: - config: - - { os: ubuntu, version: "22.04" } - - { os: centos, version: "7" } + include: + - id: "ubuntu-22.04" + os: ubuntu + ubuntu: "22.04" + - id: "centos-7" + os: centos + - extra-cmake-flags: >- + -DCMAKE_INCLUDE_PATH=/usr/include/openssl11 + -DCMAKE_LIBRARY_PATH=/usr/lib64/openssl11 + id: "centos-7-openssl-1.1" + os: centos env: UBUNTU: {{ '${{ matrix.config.version }}' }} steps: @@ -76,12 +84,14 @@ jobs: - name: Build libarrow shell: bash env: - UBUNTU: {{ '"${{ matrix.config.version }}"' }} + UBUNTU: {{ '"${{ matrix.ubuntu }}"' }} {{ macros.github_set_sccache_envvars()|indent(8) }} run: | sudo sysctl -w kernel.core_pattern="core.%e.%p" ulimit -c unlimited - archery docker run {{ '${{ matrix.config.os}}' }}-cpp-static + archery docker run \ + -e EXTRA_CMAKE_FLAGS="{{ '${{ matrix.extra-cmake-flags }}' }}" \ + {{ '${{ matrix.config.os }}' }}-cpp-static - name: Bundle libarrow shell: bash env: @@ -95,7 +105,7 @@ jobs: - name: Upload binary artifact uses: actions/upload-artifact@v3 with: - name: r-lib__libarrow__bin__{{ '${{ matrix.config.os}}-${{ matrix.config.version}}' }} + name: r-lib__libarrow__bin__{{ '${{ matrix.id }}' }} path: arrow/r/libarrow/dist/arrow-*.zip windows-cpp: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 19f1f35de181..8ec8e723027d 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,7 +989,8 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7-openssl-1.0__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7-openssl-1.1__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.2__arrow_{no_rc_r_version}\.zip diff --git a/docker-compose.yml b/docker-compose.yml index c9b02c45d1c5..31595f791fc9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -443,7 +443,7 @@ services: ARROW_DEPENDENCY_SOURCE: BUNDLED ARROW_HOME: /arrow LIBARROW_MINIMAL: "false" - command: /bin/bash -c " + command: /bin/bash -c " scl enable devtoolset-8 '/arrow/r/inst/build_arrow_static.sh'" ubuntu-cpp-bundled: diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh index ffe50c463e42..800b9cde3f62 100755 --- a/r/inst/build_arrow_static.sh +++ b/r/inst/build_arrow_static.sh @@ -65,7 +65,6 @@ ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \ -DARROW_JEMALLOC=${ARROW_JEMALLOC:-$ARROW_DEFAULT_PARAM} \ -DARROW_MIMALLOC=${ARROW_MIMALLOC:-ON} \ -DARROW_JSON=${ARROW_JSON:-ON} \ - -DARROW_OPENSSL_USE_SHARED=OFF \ -DARROW_PARQUET=${ARROW_PARQUET:-ON} \ -DARROW_S3=${ARROW_S3:-$ARROW_DEFAULT_PARAM} \ -DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI:-$ARROW_DEFAULT_PARAM} \ diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index f91bc3bb4678..5502bc86f78a 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -99,7 +99,8 @@ download_binary <- function(lib) { # * Some other string: a "distro-version" that corresponds to a binary that is # available, to override what this function may discover by default. # Possible values are: -# * "centos-7" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1) +# * "centos-7" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.0) +# * "centos-7-openssl-1.1" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.1) # * "ubuntu-22.04" (openssl 3) # These string values, along with `NULL`, are the potential return values of # this function. @@ -172,6 +173,9 @@ test_for_curl_and_openssl <- " #if OPENSSL_VERSION_NUMBER < 0x10002000L #error OpenSSL version too old #endif +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#error Using OpenSSL version 1.0 +#endif #if OPENSSL_VERSION_NUMBER >= 0x30000000L #error Using OpenSSL version 3 #endif @@ -188,10 +192,10 @@ compile_test_program <- function(code) { # (built with newer devtoolset but older glibc (2.17) for broader compatibility,# like manylinux2014) determine_binary_from_stderr <- function(errs) { if (is.null(attr(errs, "status"))) { - # There was no error in compiling: so we found libcurl and openssl > 1.0.2, - # openssl is < 3.0, and we're not using a strict libc++ - cat("*** Found libcurl and openssl >= 1.0.2\n") - return("centos-7") + # There was no error in compiling: so we found libcurl and openssl >= 1.1, + # openssl is < 3.0 + cat("*** Found libcurl and openssl >= 1.1\n") + return("centos-7-openssl-1.1") # Else, check for dealbreakers: } else if (any(grepl("Using libc++", errs, fixed = TRUE))) { # Our binaries are all built with GNU stdlib so they fail with libc++ @@ -207,6 +211,9 @@ determine_binary_from_stderr <- function(errs) { cat("*** openssl found but version >= 1.0.2 is required for some features\n") return(NULL) # Else, determine which other binary will work + } else if (any(grepl("Using OpenSSL version 1.0", errs))) { + cat("*** Found libcurl and openssl < 1.1\n") + return("centos-7") } else if (any(grepl("Using OpenSSL version 3", errs))) { cat("*** Found libcurl and openssl >= 3.0.0\n") return("ubuntu-22.04") diff --git a/r/vignettes/developers/setup.Rmd b/r/vignettes/developers/setup.Rmd index 85d9693a3bac..fcb5b73e7685 100644 --- a/r/vignettes/developers/setup.Rmd +++ b/r/vignettes/developers/setup.Rmd @@ -54,7 +54,8 @@ On Linux, you can download a .zip file containing libarrow from the [nightly repository](https://nightlies.apache.org/arrow/r/libarrow/bin/). The directory names correspond to the OS the binaries where built on: -- "centos-7" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1) +- "centos-7" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.0) +- "centos-7-openssl-1.1" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.1) - "ubuntu-22.04" (openssl 3) Version numbers in that repository correspond to dates. diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd index 58cc57991db1..09b06510b1f6 100644 --- a/r/vignettes/install.Rmd +++ b/r/vignettes/install.Rmd @@ -297,8 +297,8 @@ See below for more in-depth explanations of these environment variables. will work with your system. You can set it to `false` to skip this option altogether, or you can specify a string "distro-version" that corresponds to a binary that is available, to override what this function may discover by - default. Possible values are: "centos-7" (openssl 1), "ubuntu-22.04" - (openssl 3). + default. Possible values are: "centos-7" (openssl 1.0), "centos-7-openssl-1.1" + (openssl 1.1), "ubuntu-22.04" (openssl 3). * `LIBARROW_BUILD` : If set to `false`, the build script will not attempt to build the C++ from source. This means you will only get a working arrow R package if a prebuilt binary is found. From 46fb732d5e6fa2f8e021204f76432d50388cc097 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 02:13:40 +0900 Subject: [PATCH 09/21] Follow changes --- dev/tasks/r/github.packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 14c783ef6b96..1a2ee28e795d 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -57,7 +57,7 @@ jobs: path: arrow/r/arrow_*.tar.gz linux-cpp: - name: C++ Binary {{ '${{ matrix.config.os }}-${{ matrix.config.version }}' }} + name: C++ Binary {{ '${{ matrix.id }}' }} runs-on: ubuntu-latest needs: source strategy: From 685e8e2855883672c71272d11dae54632700b423 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 08:04:05 +0900 Subject: [PATCH 10/21] Follow changes --- dev/tasks/r/github.packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 1a2ee28e795d..1a3d27c74d82 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -91,7 +91,7 @@ jobs: ulimit -c unlimited archery docker run \ -e EXTRA_CMAKE_FLAGS="{{ '${{ matrix.extra-cmake-flags }}' }}" \ - {{ '${{ matrix.config.os }}' }}-cpp-static + {{ '${{ matrix.os }}' }}-cpp-static - name: Bundle libarrow shell: bash env: From 24c85664071d04c1c180e30fc6d48bef00c57713 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 09:49:27 +0900 Subject: [PATCH 11/21] Use Ubuntu 20.04 --- ci/docker/centos-7-cpp.dockerfile | 1 - dev/tasks/macros.jinja | 8 ++++---- dev/tasks/r/github.packages.yml | 25 ++++++++----------------- dev/tasks/tasks.yml | 4 ++-- r/tools/nixlibs.R | 4 ++-- r/tools/test-nixlibs.R | 15 +++++++++++---- r/vignettes/developers/setup.Rmd | 2 +- r/vignettes/install.Rmd | 2 +- 8 files changed, 29 insertions(+), 32 deletions(-) diff --git a/ci/docker/centos-7-cpp.dockerfile b/ci/docker/centos-7-cpp.dockerfile index 8c1893cbbb2a..f66fd33aebbe 100644 --- a/ci/docker/centos-7-cpp.dockerfile +++ b/ci/docker/centos-7-cpp.dockerfile @@ -31,7 +31,6 @@ RUN \ libcurl-devel \ make \ openssl-devel \ - openssl11-devel \ wget \ which diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index a68bcbccd22b..dbbf1246a053 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -320,12 +320,12 @@ on: path: repo/libarrow/bin/windows {% endif %} {% if get_nix %} - {% for id in ["ubuntu-22.04", "centos-7", "centos-7-openssl-1.1"] %} - - name: Get {{ id }} binary + {% for os in ["ubuntu-20.04", "ubuntu-22.04", "centos-7"] %} + - name: Get {{ os }} binary uses: actions/download-artifact@v3 with: - name: r-lib__libarrow__bin__{{ id }} - path: repo/libarrow/bin/{{ id }} + name: r-lib__libarrow__bin__{{ os }} + path: repo/libarrow/bin/{{ os }} {% endfor %} {% endif %} - name: Get src pkg diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 1a3d27c74d82..29c27519129b 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -57,23 +57,16 @@ jobs: path: arrow/r/arrow_*.tar.gz linux-cpp: - name: C++ Binary {{ '${{ matrix.id }}' }} + name: C++ Binary {{ '${{ matrix.config.os }}-${{ matrix.config.version }}' }} runs-on: ubuntu-latest needs: source strategy: fail-fast: false matrix: - include: - - id: "ubuntu-22.04" - os: ubuntu - ubuntu: "22.04" - - id: "centos-7" - os: centos - - extra-cmake-flags: >- - -DCMAKE_INCLUDE_PATH=/usr/include/openssl11 - -DCMAKE_LIBRARY_PATH=/usr/lib64/openssl11 - id: "centos-7-openssl-1.1" - os: centos + config: + - { os: ubuntu, version: "20.04" } + - { os: ubuntu, version: "22.04" } + - { os: centos, version: "7" } env: UBUNTU: {{ '${{ matrix.config.version }}' }} steps: @@ -84,14 +77,12 @@ jobs: - name: Build libarrow shell: bash env: - UBUNTU: {{ '"${{ matrix.ubuntu }}"' }} + UBUNTU: {{ '"${{ matrix.config.version }}"' }} {{ macros.github_set_sccache_envvars()|indent(8) }} run: | sudo sysctl -w kernel.core_pattern="core.%e.%p" ulimit -c unlimited - archery docker run \ - -e EXTRA_CMAKE_FLAGS="{{ '${{ matrix.extra-cmake-flags }}' }}" \ - {{ '${{ matrix.os }}' }}-cpp-static + archery docker run {{ '${{ matrix.os }}' }}-cpp-static - name: Bundle libarrow shell: bash env: @@ -105,7 +96,7 @@ jobs: - name: Upload binary artifact uses: actions/upload-artifact@v3 with: - name: r-lib__libarrow__bin__{{ '${{ matrix.id }}' }} + name: r-lib__libarrow__bin__{{ '${{ matrix.config.os}}-${{ matrix.config.version}}' }} path: arrow/r/libarrow/dist/arrow-*.zip windows-cpp: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 8ec8e723027d..c7dd3eb4b281 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,8 +989,8 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7-openssl-1.0__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7-openssl-1.1__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7_arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__ubuntu-20.04__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.2__arrow_{no_rc_r_version}\.zip diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 5502bc86f78a..097bbc812631 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -100,7 +100,7 @@ download_binary <- function(lib) { # available, to override what this function may discover by default. # Possible values are: # * "centos-7" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.0) -# * "centos-7-openssl-1.1" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.1) +# * "ubuntu-20.04" (openssl 1.1) # * "ubuntu-22.04" (openssl 3) # These string values, along with `NULL`, are the potential return values of # this function. @@ -195,7 +195,7 @@ determine_binary_from_stderr <- function(errs) { # There was no error in compiling: so we found libcurl and openssl >= 1.1, # openssl is < 3.0 cat("*** Found libcurl and openssl >= 1.1\n") - return("centos-7-openssl-1.1") + return("ubuntu-20.04") # Else, check for dealbreakers: } else if (any(grepl("Using libc++", errs, fixed = TRUE))) { # Our binaries are all built with GNU stdlib so they fail with libc++ diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R index 3676f6f323bb..663cd9e22d07 100644 --- a/r/tools/test-nixlibs.R +++ b/r/tools/test-nixlibs.R @@ -26,7 +26,7 @@ source("nixlibs.R", local = TRUE) test_that("identify_binary() based on LIBARROW_BINARY", { expect_null(identify_binary("FALSE")) - expect_identical(identify_binary("centos-7"), "centos-7") + expect_identical(identify_binary("ubuntu-20.04"), "ubuntu-20.04") expect_null(identify_binary("", info = list(id = "debian"))) }) @@ -52,9 +52,9 @@ test_that("determine_binary_from_stderr", { expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("int a;")), - "centos-7" + "ubuntu-20.04" ), - "Found libcurl and openssl >= 1.0.2" + "Found libcurl and openssl >= 1.1" ) expect_output( expect_identical( @@ -75,9 +75,16 @@ test_that("select_binary() with test program", { expect_output( expect_identical( select_binary("linux", "x86_64", "int a;"), + "ubuntu-20.04" + ), + "Found libcurl and openssl >= 1.1" + ) + expect_output( + expect_identical( + select_binary("linux", "x86_64", "#error Using OpenSSL version 1.0"), "centos-7" ), - "Found libcurl and openssl >= 1.0.2" + "Found libcurl and openssl < 1.1" ) expect_output( expect_identical( diff --git a/r/vignettes/developers/setup.Rmd b/r/vignettes/developers/setup.Rmd index fcb5b73e7685..efba6966e51d 100644 --- a/r/vignettes/developers/setup.Rmd +++ b/r/vignettes/developers/setup.Rmd @@ -55,7 +55,7 @@ On Linux, you can download a .zip file containing libarrow from the The directory names correspond to the OS the binaries where built on: - "centos-7" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.0) -- "centos-7-openssl-1.1" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.1) +- "ubuntu-20.04" (openssl 1.1) - "ubuntu-22.04" (openssl 3) Version numbers in that repository correspond to dates. diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd index 09b06510b1f6..5b528d304b2d 100644 --- a/r/vignettes/install.Rmd +++ b/r/vignettes/install.Rmd @@ -297,7 +297,7 @@ See below for more in-depth explanations of these environment variables. will work with your system. You can set it to `false` to skip this option altogether, or you can specify a string "distro-version" that corresponds to a binary that is available, to override what this function may discover by - default. Possible values are: "centos-7" (openssl 1.0), "centos-7-openssl-1.1" + default. Possible values are: "centos-7" (openssl 1.0), "ubuntu-20.04" (openssl 1.1), "ubuntu-22.04" (openssl 3). * `LIBARROW_BUILD` : If set to `false`, the build script will not attempt to build the C++ from source. This means you will only get From ba6ed4318f974c012c687f0d723b29db024974ed Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 09:51:45 +0900 Subject: [PATCH 12/21] Revert more --- dev/tasks/r/github.packages.yml | 2 +- dev/tasks/tasks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 29c27519129b..1cd838928c69 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -82,7 +82,7 @@ jobs: run: | sudo sysctl -w kernel.core_pattern="core.%e.%p" ulimit -c unlimited - archery docker run {{ '${{ matrix.os }}' }}-cpp-static + archery docker run {{ '${{ matrix.config.os }}' }}-cpp-static - name: Bundle libarrow shell: bash env: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index c7dd3eb4b281..1d23e7815f03 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,7 +989,7 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7_arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-20.04__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip From f93cf3ab8170d8e9cc9b187210ab5c76a828316c Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 11:58:27 +0900 Subject: [PATCH 13/21] Revert "Revert more" This reverts commit 2f8b11d2c93b777883ff1214e4fd5bc2ee7e6367. --- dev/tasks/r/github.packages.yml | 2 +- dev/tasks/tasks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 1cd838928c69..29c27519129b 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -82,7 +82,7 @@ jobs: run: | sudo sysctl -w kernel.core_pattern="core.%e.%p" ulimit -c unlimited - archery docker run {{ '${{ matrix.config.os }}' }}-cpp-static + archery docker run {{ '${{ matrix.os }}' }}-cpp-static - name: Bundle libarrow shell: bash env: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 1d23e7815f03..c7dd3eb4b281 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,7 +989,7 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7_arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-20.04__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip From df57c948b2b9af594a69d5558fdbb15b6e54d593 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 11:58:30 +0900 Subject: [PATCH 14/21] Revert "Use Ubuntu 20.04" This reverts commit ed561d53b0e03a71bcf100af4e52f216fc6f157a. --- ci/docker/centos-7-cpp.dockerfile | 1 + dev/tasks/macros.jinja | 8 ++++---- dev/tasks/r/github.packages.yml | 25 +++++++++++++++++-------- dev/tasks/tasks.yml | 4 ++-- r/tools/nixlibs.R | 4 ++-- r/tools/test-nixlibs.R | 15 ++++----------- r/vignettes/developers/setup.Rmd | 2 +- r/vignettes/install.Rmd | 2 +- 8 files changed, 32 insertions(+), 29 deletions(-) diff --git a/ci/docker/centos-7-cpp.dockerfile b/ci/docker/centos-7-cpp.dockerfile index f66fd33aebbe..8c1893cbbb2a 100644 --- a/ci/docker/centos-7-cpp.dockerfile +++ b/ci/docker/centos-7-cpp.dockerfile @@ -31,6 +31,7 @@ RUN \ libcurl-devel \ make \ openssl-devel \ + openssl11-devel \ wget \ which diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index dbbf1246a053..a68bcbccd22b 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -320,12 +320,12 @@ on: path: repo/libarrow/bin/windows {% endif %} {% if get_nix %} - {% for os in ["ubuntu-20.04", "ubuntu-22.04", "centos-7"] %} - - name: Get {{ os }} binary + {% for id in ["ubuntu-22.04", "centos-7", "centos-7-openssl-1.1"] %} + - name: Get {{ id }} binary uses: actions/download-artifact@v3 with: - name: r-lib__libarrow__bin__{{ os }} - path: repo/libarrow/bin/{{ os }} + name: r-lib__libarrow__bin__{{ id }} + path: repo/libarrow/bin/{{ id }} {% endfor %} {% endif %} - name: Get src pkg diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 29c27519129b..1a3d27c74d82 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -57,16 +57,23 @@ jobs: path: arrow/r/arrow_*.tar.gz linux-cpp: - name: C++ Binary {{ '${{ matrix.config.os }}-${{ matrix.config.version }}' }} + name: C++ Binary {{ '${{ matrix.id }}' }} runs-on: ubuntu-latest needs: source strategy: fail-fast: false matrix: - config: - - { os: ubuntu, version: "20.04" } - - { os: ubuntu, version: "22.04" } - - { os: centos, version: "7" } + include: + - id: "ubuntu-22.04" + os: ubuntu + ubuntu: "22.04" + - id: "centos-7" + os: centos + - extra-cmake-flags: >- + -DCMAKE_INCLUDE_PATH=/usr/include/openssl11 + -DCMAKE_LIBRARY_PATH=/usr/lib64/openssl11 + id: "centos-7-openssl-1.1" + os: centos env: UBUNTU: {{ '${{ matrix.config.version }}' }} steps: @@ -77,12 +84,14 @@ jobs: - name: Build libarrow shell: bash env: - UBUNTU: {{ '"${{ matrix.config.version }}"' }} + UBUNTU: {{ '"${{ matrix.ubuntu }}"' }} {{ macros.github_set_sccache_envvars()|indent(8) }} run: | sudo sysctl -w kernel.core_pattern="core.%e.%p" ulimit -c unlimited - archery docker run {{ '${{ matrix.os }}' }}-cpp-static + archery docker run \ + -e EXTRA_CMAKE_FLAGS="{{ '${{ matrix.extra-cmake-flags }}' }}" \ + {{ '${{ matrix.os }}' }}-cpp-static - name: Bundle libarrow shell: bash env: @@ -96,7 +105,7 @@ jobs: - name: Upload binary artifact uses: actions/upload-artifact@v3 with: - name: r-lib__libarrow__bin__{{ '${{ matrix.config.os}}-${{ matrix.config.version}}' }} + name: r-lib__libarrow__bin__{{ '${{ matrix.id }}' }} path: arrow/r/libarrow/dist/arrow-*.zip windows-cpp: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index c7dd3eb4b281..8ec8e723027d 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,8 +989,8 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7_arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__ubuntu-20.04__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7-openssl-1.0__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7-openssl-1.1__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.2__arrow_{no_rc_r_version}\.zip diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 097bbc812631..5502bc86f78a 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -100,7 +100,7 @@ download_binary <- function(lib) { # available, to override what this function may discover by default. # Possible values are: # * "centos-7" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.0) -# * "ubuntu-20.04" (openssl 1.1) +# * "centos-7-openssl-1.1" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.1) # * "ubuntu-22.04" (openssl 3) # These string values, along with `NULL`, are the potential return values of # this function. @@ -195,7 +195,7 @@ determine_binary_from_stderr <- function(errs) { # There was no error in compiling: so we found libcurl and openssl >= 1.1, # openssl is < 3.0 cat("*** Found libcurl and openssl >= 1.1\n") - return("ubuntu-20.04") + return("centos-7-openssl-1.1") # Else, check for dealbreakers: } else if (any(grepl("Using libc++", errs, fixed = TRUE))) { # Our binaries are all built with GNU stdlib so they fail with libc++ diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R index 663cd9e22d07..3676f6f323bb 100644 --- a/r/tools/test-nixlibs.R +++ b/r/tools/test-nixlibs.R @@ -26,7 +26,7 @@ source("nixlibs.R", local = TRUE) test_that("identify_binary() based on LIBARROW_BINARY", { expect_null(identify_binary("FALSE")) - expect_identical(identify_binary("ubuntu-20.04"), "ubuntu-20.04") + expect_identical(identify_binary("centos-7"), "centos-7") expect_null(identify_binary("", info = list(id = "debian"))) }) @@ -52,9 +52,9 @@ test_that("determine_binary_from_stderr", { expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("int a;")), - "ubuntu-20.04" + "centos-7" ), - "Found libcurl and openssl >= 1.1" + "Found libcurl and openssl >= 1.0.2" ) expect_output( expect_identical( @@ -75,16 +75,9 @@ test_that("select_binary() with test program", { expect_output( expect_identical( select_binary("linux", "x86_64", "int a;"), - "ubuntu-20.04" - ), - "Found libcurl and openssl >= 1.1" - ) - expect_output( - expect_identical( - select_binary("linux", "x86_64", "#error Using OpenSSL version 1.0"), "centos-7" ), - "Found libcurl and openssl < 1.1" + "Found libcurl and openssl >= 1.0.2" ) expect_output( expect_identical( diff --git a/r/vignettes/developers/setup.Rmd b/r/vignettes/developers/setup.Rmd index efba6966e51d..fcb5b73e7685 100644 --- a/r/vignettes/developers/setup.Rmd +++ b/r/vignettes/developers/setup.Rmd @@ -55,7 +55,7 @@ On Linux, you can download a .zip file containing libarrow from the The directory names correspond to the OS the binaries where built on: - "centos-7" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.0) -- "ubuntu-20.04" (openssl 1.1) +- "centos-7-openssl-1.1" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.1) - "ubuntu-22.04" (openssl 3) Version numbers in that repository correspond to dates. diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd index 5b528d304b2d..09b06510b1f6 100644 --- a/r/vignettes/install.Rmd +++ b/r/vignettes/install.Rmd @@ -297,7 +297,7 @@ See below for more in-depth explanations of these environment variables. will work with your system. You can set it to `false` to skip this option altogether, or you can specify a string "distro-version" that corresponds to a binary that is available, to override what this function may discover by - default. Possible values are: "centos-7" (openssl 1.0), "ubuntu-20.04" + default. Possible values are: "centos-7" (openssl 1.0), "centos-7-openssl-1.1" (openssl 1.1), "ubuntu-22.04" (openssl 3). * `LIBARROW_BUILD` : If set to `false`, the build script will not attempt to build the C++ from source. This means you will only get From 1777858cc1d30c9014aba828fd33bc948917e7ce Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 19 Mar 2023 12:06:46 +0900 Subject: [PATCH 15/21] Use the same OpenSSL --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 8b7e62b734f7..54ec3aa1ea07 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4754,10 +4754,12 @@ macro(build_awssdk) # provide hint for AWS SDK to link with the already located libcurl and zlib list(APPEND AWSSDK_CMAKE_ARGS - -DCURL_LIBRARY=${CURL_ROOT_HINT}/lib -DCURL_INCLUDE_DIR=${CURL_ROOT_HINT}/include + -DCURL_LIBRARY=${CURL_ROOT_HINT}/lib + -DZLIB_INCLUDE_DIR=${ZLIB_ROOT_HINT}/include -DZLIB_LIBRARY=${ZLIB_ROOT_HINT}/lib - -DZLIB_INCLUDE_DIR=${ZLIB_ROOT_HINT}/include) + -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) endif() file(MAKE_DIRECTORY ${AWSSDK_INCLUDE_DIR}) From cc526e19cd8977fae85cbcc36f9dfa0d96dc88a7 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 20 Mar 2023 05:34:03 +0900 Subject: [PATCH 16/21] Ensure using the same OpenSSL --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 34 +++++++++++---------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 54ec3aa1ea07..044950343688 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -3872,7 +3872,11 @@ macro(build_grpc) "${EP_COMMON_CMAKE_ARGS}" "-DCMAKE_C_FLAGS=${GRPC_C_FLAGS}" "-DCMAKE_CXX_FLAGS=${GRPC_CXX_FLAGS}" + -DCMAKE_INSTALL_PREFIX=${GRPC_PREFIX} -DCMAKE_PREFIX_PATH='${GRPC_PREFIX_PATH_ALT_SEP}' + -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} -DgRPC_ABSL_PROVIDER=package -DgRPC_BUILD_CSHARP_EXT=OFF -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF @@ -3888,14 +3892,10 @@ macro(build_grpc) -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_RE2_PROVIDER=package -DgRPC_SSL_PROVIDER=package - -DgRPC_ZLIB_PROVIDER=package - -DCMAKE_INSTALL_PREFIX=${GRPC_PREFIX}) + -DgRPC_ZLIB_PROVIDER=package) if(PROTOBUF_VENDORED) list(APPEND GRPC_CMAKE_ARGS -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG) endif() - if(OPENSSL_ROOT_DIR) - list(APPEND GRPC_CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}) - endif() # XXX the gRPC git checkout is huge and takes a long time # Ideally, we should be able to use the tarballs, but they don't contain @@ -4224,10 +4224,10 @@ macro(build_google_cloud_cpp_storage) -DGOOGLE_CLOUD_CPP_ENABLE=storage # We need this to build with OpenSSL 3.0. # See also: https://github.com/googleapis/google-cloud-cpp/issues/8544 - -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF) - if(OPENSSL_ROOT_DIR) - list(APPEND GOOGLE_CLOUD_CPP_CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}) - endif() + -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF + -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY}) add_custom_target(google_cloud_cpp_dependencies) @@ -4729,16 +4729,20 @@ macro(build_awssdk) set(AWSSDK_BUILD_TYPE release) endif() - # provide hint for AWS SDK to link with the already located openssl - get_filename_component(OPENSSL_ROOT_HINT "${OPENSSL_INCLUDE_DIR}" DIRECTORY) set(AWSSDK_COMMON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${AWSSDK_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${AWSSDK_PREFIX} - -DCMAKE_PREFIX_PATH=${AWSSDK_PREFIX}\\$${OPENSSL_ROOT_HINT} + -DCMAKE_PREFIX_PATH=${AWSSDK_PREFIX} -DENABLE_TESTING=OFF -DENABLE_UNITY_BUILD=ON - -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_HINT}) + -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} + -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} + -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -Dcrypto_SHARED_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) set(AWSSDK_CMAKE_ARGS ${AWSSDK_COMMON_CMAKE_ARGS} -DBUILD_DEPS=OFF @@ -4757,9 +4761,7 @@ macro(build_awssdk) -DCURL_INCLUDE_DIR=${CURL_ROOT_HINT}/include -DCURL_LIBRARY=${CURL_ROOT_HINT}/lib -DZLIB_INCLUDE_DIR=${ZLIB_ROOT_HINT}/include - -DZLIB_LIBRARY=${ZLIB_ROOT_HINT}/lib - -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} - -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + -DZLIB_LIBRARY=${ZLIB_ROOT_HINT}/lib) endif() file(MAKE_DIRECTORY ${AWSSDK_INCLUDE_DIR}) From f86e69c2efa42c7a98769f302a9e20349460707c Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 20 Mar 2023 06:31:01 +0900 Subject: [PATCH 17/21] Clean --- dev/tasks/r/github.packages.yml | 2 -- dev/tasks/tasks.yml | 2 +- r/tools/test-nixlibs.R | 18 ++++++++++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 1a3d27c74d82..6953b4ca8398 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -74,8 +74,6 @@ jobs: -DCMAKE_LIBRARY_PATH=/usr/lib64/openssl11 id: "centos-7-openssl-1.1" os: centos - env: - UBUNTU: {{ '${{ matrix.config.version }}' }} steps: {{ macros.github_checkout_arrow()|indent }} {{ macros.github_change_r_pkg_version(is_fork, '${{ needs.source.outputs.pkg_version }}')|indent }} diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 8ec8e723027d..cf557434a164 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,7 +989,7 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7-openssl-1.0__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__centos-7__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__centos-7-openssl-1.1__arrow-{no_rc_r_version}\.zip - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R index 3676f6f323bb..2ea850e441b6 100644 --- a/r/tools/test-nixlibs.R +++ b/r/tools/test-nixlibs.R @@ -52,9 +52,16 @@ test_that("determine_binary_from_stderr", { expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("int a;")), + "centos-7-openssl-1.1" + ), + "Found libcurl and openssl >= 1.1" + ) + expect_output( + expect_identical( + determine_binary_from_stderr(compile_test_program("#error Using OpenSSL version 1.0")), "centos-7" ), - "Found libcurl and openssl >= 1.0.2" + "Found libcurl and openssl < 1.1" ) expect_output( expect_identical( @@ -75,9 +82,16 @@ test_that("select_binary() with test program", { expect_output( expect_identical( select_binary("linux", "x86_64", "int a;"), + "centos-7-openssl-1.1" + ), + "Found libcurl and openssl >= 1.1" + ) + expect_output( + expect_identical( + select_binary("linux", "x86_64", "#error Using OpenSSL version 1.0"), "centos-7" ), - "Found libcurl and openssl >= 1.0.2" + "Found libcurl and openssl < 1.1" ) expect_output( expect_identical( From c408a2ee3952ee783c0957742cf872521d761e9f Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 21 Mar 2023 23:21:15 +0900 Subject: [PATCH 18/21] Don't use OpenSSL for s2n-tls --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 044950343688..2232177dd914 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4740,9 +4740,14 @@ macro(build_awssdk) -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} -Dcrypto_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} - -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} - -Dcrypto_SHARED_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} - -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + -Dcrypto_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + if(ARROW_OPENSSL_USE_SHARED) + list(APPEND AWSSDK_COMMON_CMAKE_ARGS + -Dcrypto_SHARED_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + else() + list(APPEND AWSSDK_COMMON_CMAKE_ARGS + -Dcrypto_STATIC_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}) + endif() set(AWSSDK_CMAKE_ARGS ${AWSSDK_COMMON_CMAKE_ARGS} -DBUILD_DEPS=OFF @@ -4883,9 +4888,15 @@ macro(build_awssdk) set(S2N_TLS_CMAKE_ARGS ${AWSSDK_COMMON_CMAKE_ARGS}) list(APPEND S2N_TLS_CMAKE_ARGS - -DS2N_INTERN_LIBCRYPTO=ON # internalize libcrypto to avoid name conflict with openssl - -DCMAKE_PREFIX_PATH=${AWS_LC_PREFIX} # path to find crypto provided by aws-lc - -DCMAKE_C_FLAGS=${S2N_TLS_C_FLAGS}) + # internalize libcrypto to avoid name conflict with OpenSSL + -DS2N_INTERN_LIBCRYPTO=ON + # path to find crypto provided by aws-lc + -DCMAKE_PREFIX_PATH=${AWS_LC_PREFIX} + -DCMAKE_C_FLAGS=${S2N_TLS_C_FLAGS} + # paths to find crypto provided by aws-lc + -Dcrypto_INCLUDE_DIR=${AWS_LC_PREFIX}/include + -Dcrypto_LIBRARY=${AWS_LC_STATIC_LIBRARY} + -Dcrypto_STATIC_LIBRARY=${AWS_LC_STATIC_LIBRARY}) externalproject_add(s2n_tls_ep ${EP_COMMON_OPTIONS} From 514f27c803d9cc98d37c6f0b7e30def451adbe29 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 21 Mar 2023 23:21:38 +0900 Subject: [PATCH 19/21] Rename binaries to "linux-openssl-X.Y" --- dev/tasks/macros.jinja | 6 +++--- dev/tasks/r/github.packages.yml | 12 ++++++------ dev/tasks/tasks.yml | 6 +++--- r/tools/nixlibs.R | 27 ++++++++++++++------------- r/tools/test-nixlibs.R | 28 ++++++++++++++-------------- r/vignettes/developers/setup.Rmd | 8 ++++---- r/vignettes/install.Rmd | 4 ++-- 7 files changed, 46 insertions(+), 45 deletions(-) diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index a68bcbccd22b..e26b43a10c25 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -320,12 +320,12 @@ on: path: repo/libarrow/bin/windows {% endif %} {% if get_nix %} - {% for id in ["ubuntu-22.04", "centos-7", "centos-7-openssl-1.1"] %} + {% for openssl_version in ["1.0", "1.1", "3.0"] %} - name: Get {{ id }} binary uses: actions/download-artifact@v3 with: - name: r-lib__libarrow__bin__{{ id }} - path: repo/libarrow/bin/{{ id }} + name: r-lib__libarrow__bin__linux-openssl-{{ openssl_version }} + path: repo/libarrow/bin/linux-openssl-{{ openssl_version }} {% endfor %} {% endif %} - name: Get src pkg diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 6953b4ca8398..1ecacb057502 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -57,22 +57,22 @@ jobs: path: arrow/r/arrow_*.tar.gz linux-cpp: - name: C++ Binary {{ '${{ matrix.id }}' }} + name: C++ Binary Linux OpenSSL {{ '${{ matrix.openssl }}' }} runs-on: ubuntu-latest needs: source strategy: fail-fast: false matrix: include: - - id: "ubuntu-22.04" + - openssl: "3.0" os: ubuntu ubuntu: "22.04" - - id: "centos-7" - os: centos - extra-cmake-flags: >- -DCMAKE_INCLUDE_PATH=/usr/include/openssl11 -DCMAKE_LIBRARY_PATH=/usr/lib64/openssl11 - id: "centos-7-openssl-1.1" + openssl: "1.1" + os: centos + - openssl: "1.0" os: centos steps: {{ macros.github_checkout_arrow()|indent }} @@ -103,7 +103,7 @@ jobs: - name: Upload binary artifact uses: actions/upload-artifact@v3 with: - name: r-lib__libarrow__bin__{{ '${{ matrix.id }}' }} + name: r-lib__libarrow__bin__linux-openssl-{{ '${{ matrix.openssl }}' }} path: arrow/r/libarrow/dist/arrow-*.zip windows-cpp: diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index cf557434a164..f387fdbf945f 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -989,9 +989,9 @@ tasks: custom_version: Unset artifacts: - r-lib__libarrow__bin__windows__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__centos-7-openssl-1.1__arrow-{no_rc_r_version}\.zip - - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__linux-openssl-1.0__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__linux-openssl-1.1__arrow-{no_rc_r_version}\.zip + - r-lib__libarrow__bin__linux-openssl-3.0__arrow-{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_r_version}\.zip - r-pkg__bin__windows__contrib__4.2__arrow_{no_rc_r_version}\.zip - r-pkg__bin__macosx__contrib__4.1__arrow_{no_rc_r_version}\.tgz diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 5502bc86f78a..df6c5b0488c8 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -96,12 +96,13 @@ download_binary <- function(lib) { # of action based on the current system. Other values you can set it to: # * "FALSE" (not case-sensitive), to skip this option altogether # * "TRUE" (not case-sensitive), to try to discover your current OS, or -# * Some other string: a "distro-version" that corresponds to a binary that is -# available, to override what this function may discover by default. +# * Some other string: a "linux-openssl-${OPENSSL_VERSION}" that corresponds to +# a binary that is available, to override what this function may discover by +# default. # Possible values are: -# * "centos-7" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.0) -# * "centos-7-openssl-1.1" (gcc 8 (devtoolset), _GLIBCXX_USE_CXX11_ABI=0, openssl 1.1) -# * "ubuntu-22.04" (openssl 3) +# * "linux-openssl-1.0" (OpenSSL 1.0) +# * "linux-openssl-1.1" (OpenSSL 1.1) +# * "linux-openssl-3.0" (OpenSSL 3.0) # These string values, along with `NULL`, are the potential return values of # this function. identify_binary <- function(lib = Sys.getenv("LIBARROW_BINARY"), info = distro()) { @@ -160,7 +161,7 @@ select_binary <- function(os = tolower(Sys.info()[["sysname"]]), } } -# This tests that curl and openssl are present (bc we can include their headers) +# This tests that curl and OpenSSL are present (bc we can include their headers) # and it checks for other versions/features and raises errors that we grep for test_for_curl_and_openssl <- " #include @@ -195,7 +196,7 @@ determine_binary_from_stderr <- function(errs) { # There was no error in compiling: so we found libcurl and openssl >= 1.1, # openssl is < 3.0 cat("*** Found libcurl and openssl >= 1.1\n") - return("centos-7-openssl-1.1") + return("linux-openssl-1.1") # Else, check for dealbreakers: } else if (any(grepl("Using libc++", errs, fixed = TRUE))) { # Our binaries are all built with GNU stdlib so they fail with libc++ @@ -205,18 +206,18 @@ determine_binary_from_stderr <- function(errs) { cat("*** libcurl not found\n") return(NULL) } else if (header_not_found("openssl/opensslv", errs)) { - cat("*** openssl not found\n") + cat("*** OpenSSL not found\n") return(NULL) } else if (any(grepl("OpenSSL version too old", errs))) { - cat("*** openssl found but version >= 1.0.2 is required for some features\n") + cat("*** OpenSSL found but version >= 1.0.2 is required for some features\n") return(NULL) # Else, determine which other binary will work } else if (any(grepl("Using OpenSSL version 1.0", errs))) { - cat("*** Found libcurl and openssl < 1.1\n") - return("centos-7") + cat("*** Found libcurl and OpenSSL < 1.1\n") + return("linux-openssl-1.0") } else if (any(grepl("Using OpenSSL version 3", errs))) { - cat("*** Found libcurl and openssl >= 3.0.0\n") - return("ubuntu-22.04") + cat("*** Found libcurl and OpenSSL >= 3.0.0\n") + return("linux-openssl-3.0") } NULL } diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R index 2ea850e441b6..e099dcdad4ac 100644 --- a/r/tools/test-nixlibs.R +++ b/r/tools/test-nixlibs.R @@ -26,7 +26,7 @@ source("nixlibs.R", local = TRUE) test_that("identify_binary() based on LIBARROW_BINARY", { expect_null(identify_binary("FALSE")) - expect_identical(identify_binary("centos-7"), "centos-7") + expect_identical(identify_binary("linux-openssl-1.0"), "linux-openssl-1.0") expect_null(identify_binary("", info = list(id = "debian"))) }) @@ -52,29 +52,29 @@ test_that("determine_binary_from_stderr", { expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("int a;")), - "centos-7-openssl-1.1" + "linux-openssl-1.1" ), - "Found libcurl and openssl >= 1.1" + "Found libcurl and OpenSSL >= 1.1" ) expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("#error Using OpenSSL version 1.0")), - "centos-7" + "linux-openssl-1.0" ), - "Found libcurl and openssl < 1.1" + "Found libcurl and OpenSSL < 1.1" ) expect_output( expect_identical( determine_binary_from_stderr(compile_test_program("#error Using OpenSSL version 3")), - "ubuntu-22.04" + "linux-openssl-3.0" ), - "Found libcurl and openssl >= 3.0.0" + "Found libcurl and OpenSSL >= 3.0.0" ) expect_output( expect_null( determine_binary_from_stderr(compile_test_program("#error OpenSSL version too old")) ), - "openssl found but version >= 1.0.2 is required for some features" + "OpenSSL found but version >= 1.0.2 is required for some features" ) }) @@ -82,23 +82,23 @@ test_that("select_binary() with test program", { expect_output( expect_identical( select_binary("linux", "x86_64", "int a;"), - "centos-7-openssl-1.1" + "linux-openssl-1.1" ), - "Found libcurl and openssl >= 1.1" + "Found libcurl and OpenSSL >= 1.1" ) expect_output( expect_identical( select_binary("linux", "x86_64", "#error Using OpenSSL version 1.0"), - "centos-7" + "linux-openssl-1.0" ), - "Found libcurl and openssl < 1.1" + "Found libcurl and OpenSSL < 1.1" ) expect_output( expect_identical( select_binary("linux", "x86_64", "#error Using OpenSSL version 3"), - "ubuntu-22.04" + "linux-openssl-3.0" ), - "Found libcurl and openssl >= 3.0.0" + "Found libcurl and OpenSSL >= 3.0.0" ) }) diff --git a/r/vignettes/developers/setup.Rmd b/r/vignettes/developers/setup.Rmd index fcb5b73e7685..f678338fc0cf 100644 --- a/r/vignettes/developers/setup.Rmd +++ b/r/vignettes/developers/setup.Rmd @@ -53,10 +53,10 @@ recent version of the library without building from source. On Linux, you can download a .zip file containing libarrow from the [nightly repository](https://nightlies.apache.org/arrow/r/libarrow/bin/). -The directory names correspond to the OS the binaries where built on: -- "centos-7" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.0) -- "centos-7-openssl-1.1" (gcc 8 via devtoolset, `_GLIBCXX_USE_CXX11_ABI=0`, openssl 1.1) -- "ubuntu-22.04" (openssl 3) +The directory names correspond to the OpenSSL version the binaries built with: +- "linux-openssl-1.0" (OpenSSL 1.0) +- "linux-openssl-1.1" (OpenSSL 1.1) +- "linux-openssl-3.0" (OpenSSL 3.0) Version numbers in that repository correspond to dates. diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd index 09b06510b1f6..b33c439236fc 100644 --- a/r/vignettes/install.Rmd +++ b/r/vignettes/install.Rmd @@ -297,8 +297,8 @@ See below for more in-depth explanations of these environment variables. will work with your system. You can set it to `false` to skip this option altogether, or you can specify a string "distro-version" that corresponds to a binary that is available, to override what this function may discover by - default. Possible values are: "centos-7" (openssl 1.0), "centos-7-openssl-1.1" - (openssl 1.1), "ubuntu-22.04" (openssl 3). + default. Possible values are: "linux-openssl-1.0", "linux-openssl-1.1", + "linux-openssl-3.0". * `LIBARROW_BUILD` : If set to `false`, the build script will not attempt to build the C++ from source. This means you will only get a working arrow R package if a prebuilt binary is found. From b7dd9a420caca5190c868475046cf977359f4506 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 21 Mar 2023 23:55:58 +0900 Subject: [PATCH 20/21] Follow changes --- dev/tasks/macros.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index e26b43a10c25..8eedb971635b 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -321,7 +321,7 @@ on: {% endif %} {% if get_nix %} {% for openssl_version in ["1.0", "1.1", "3.0"] %} - - name: Get {{ id }} binary + - name: Get Linux OpenSSL {{ openssl_version }} binary uses: actions/download-artifact@v3 with: name: r-lib__libarrow__bin__linux-openssl-{{ openssl_version }} From 955aa34cbe395f266c4a4de5e833d880436256b0 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 22 Mar 2023 06:27:17 +0900 Subject: [PATCH 21/21] Change openssl to OpenSSL --- r/tools/nixlibs.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index df6c5b0488c8..b1af28272ad1 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -193,9 +193,9 @@ compile_test_program <- function(code) { # (built with newer devtoolset but older glibc (2.17) for broader compatibility,# like manylinux2014) determine_binary_from_stderr <- function(errs) { if (is.null(attr(errs, "status"))) { - # There was no error in compiling: so we found libcurl and openssl >= 1.1, + # There was no error in compiling: so we found libcurl and OpenSSL >= 1.1, # openssl is < 3.0 - cat("*** Found libcurl and openssl >= 1.1\n") + cat("*** Found libcurl and OpenSSL >= 1.1\n") return("linux-openssl-1.1") # Else, check for dealbreakers: } else if (any(grepl("Using libc++", errs, fixed = TRUE))) {