Skip to content

Commit

Permalink
apacheGH-39955: [C++] Use make -j1 to install bundled bzip2 (apache#3…
Browse files Browse the repository at this point in the history
…9956)

### Rationale for this change

It seems that parallel "make install" isn't stable with "-G 'Unix Makefiles'" ("read jobs pipe: Bad file descriptor.  Stop." is the important part):

    [ 19%] Performing install step for 'bzip2_ep'
    CMake Error at /tmp/Rtmp5v99SJ/file70b591df48f/bzip2_ep-prefix/src/bzip2_ep-stamp/bzip2_ep-install-RELEASE.cmake:37 (message):
      Command failed: 2

       '/bin/make' 'install' 'PREFIX=/tmp/Rtmp5v99SJ/file70b591df48f/bzip2_ep-install' 'CC=/bin/gcc' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/reproducible-path/r-base-4.3.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC' 'AR=/bin/ar' 'RANLIB=/bin/ranlib'

      See also

        /tmp/Rtmp5v99SJ/file70b591df48f/bzip2_ep-prefix/src/bzip2_ep-stamp/bzip2_ep-install-*.log

    -- stdout output is:

    -- stderr output is:
    make[3]: *** read jobs pipe: Bad file descriptor.  Stop.
    make[3]: *** Waiting for unfinished jobs....
    bzip2.c: In function ‘applySavedFileAttrToOutputFile’:
    bzip2.c:1073:11: warning: ignoring return value of ‘fchown’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
     1073 |    (void) fchown ( fd, fileMetaInfo.st_uid, fileMetaInfo.st_gid );
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    CMake Error at /tmp/Rtmp5v99SJ/file70b591df48f/bzip2_ep-prefix/src/bzip2_ep-stamp/bzip2_ep-install-RELEASE.cmake:47 (message):
      Stopping after outputting logs.

    make[2]: *** [CMakeFiles/bzip2_ep.dir/build.make:104: bzip2_ep-prefix/src/bzip2_ep-stamp/bzip2_ep-install] Error 1
    make[1]: *** [CMakeFiles/Makefile2:1205: CMakeFiles/bzip2_ep.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....

### What changes are included in this PR?

Force to disable parallel processing for `make install`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: apache#39955

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored and thisisnic committed Mar 8, 2024
1 parent 607eab9 commit e714539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ macro(build_bzip2)
BUILD_IN_SOURCE 1
BUILD_COMMAND ${MAKE} libbz2.a ${MAKE_BUILD_ARGS}
${BZIP2_EXTRA_ARGS}
INSTALL_COMMAND ${MAKE} install PREFIX=${BZIP2_PREFIX}
INSTALL_COMMAND ${MAKE} install -j1 PREFIX=${BZIP2_PREFIX}
${BZIP2_EXTRA_ARGS}
INSTALL_DIR ${BZIP2_PREFIX}
URL ${ARROW_BZIP2_SOURCE_URL}
Expand Down

0 comments on commit e714539

Please sign in to comment.