Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-14210

[C++] CMAKE_AR is not passed to bzip2 thirdparty dependency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.0
    • 6.0.0
    • C++

    Description

      It seems like the AR or CMAKE_AR variables aren't getting passed for the bzip2 build, which causes if to fail if we're doing a BUNDLED build and ar isn't available in the $PATH (e.g. in a conda environment).

      To replicate:
      1. Download Arrow and start an interactive shell in a container
      (docker should be fine if you prefer it to podman)

      git clone --depth 1 git@github.com:apache/arrow.git
      podman run -it --rm -v ./arrow:/arrow:Z docker://ursalab/amd64-ubuntu-18.04-conda-python-3.6:worker bash
      

      2. Build Arrow by running this in in the container:

      export ARROW_BUILD_TOOLCHAIN=$CONDA_PREFIX
      export ARROW_HOME=$CONDA_PREFIX
      export PARQUET_HOME=$CONDA_PREFIX
      export ARROW_BUILD_TYPE=DEBUG
      
      cd /arrow
      mkdir -p cpp/build
      pushd cpp/build
      
      cmake \
            -DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \
            -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
            -DCMAKE_AR=${AR} \
            -DCMAKE_RANLIB=${RANLIB} \
            -DARROW_WITH_BZ2=ON \
            -DARROW_VERBOSE_THIRDPARTY_BUILD=ON \
            -DARROW_JEMALLOC=OFF \
            -DARROW_SIMD_LEVEL=NONE -DARROW_RUNTIME_SIMD_LEVEL=NONE \
            -DARROW_DEPENDENCY_SOURCE=BUNDLED \
            ..
      make
      # make[3]: ar: No such file or directory
      # make[3]: *** [Makefile:48: libbz2.a] Error 127
      # make[2]: *** [CMakeFiles/bzip2_ep.dir/build.make:135: bzip2_ep-prefix/src/bzip2_ep-stamp/bzip2_ep-build] Error 2
      # make[1]: *** [CMakeFiles/Makefile2:726: CMakeFiles/bzip2_ep.dir/all] Error 2
      
      

      In the cmake call above, ARROW_JEMALLOC and the SIMD flags are just to skip compiling irrelevant things.

      I think this line in ThirdpartyToolchain.cmake needs to be changed to pass CMAKE_AR.
      https://github.com/apache/arrow/blob/bad8824d5cda0fd8337c7167729c49af868f93a5/cpp/cmake_modules/ThirdpartyToolchain.cmake#L2211

      Other related issues have also needed to pass CMAKE_RANLIB, in addition to CMAKE_AR. I'm not sure if that applies here.

       
      Related: ARROW-4471, ARROW-4831

      Edit: added ARROW_BUILD_TYPE above.

      Attachments

        Issue Links

          Activity

            People

              karldw Karl Dunkle Werner
              karldw Karl Dunkle Werner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h