Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313374

--enable-ccache's CCACHE_BASEDIR breaks builds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • infrastructure
    • None
    • b12
    • linux

      With ccache enabled the dependencies no longer work.

      This leads to mysterious compilation errors where one has to `rm -rf build/XXX` and rebuild it from scratch.

      I am pretty sure in some cases these broken dependencies lead even to segfaulting code which again gets fixed by `rm -rf build/XXX`. Unfortunately I do not have now a reproducer for such case.

      man ccache even documents this problem:
        there might be cases where things break. One known issue is that absolute paths are not reproduced in dependency files

      I believe the whole --enable-ccache code should be dropped as default ccache flags is up to ccache upstream, OS vendor and developer's preferences but the ccache defaults should not be quietly changed by the compiled package.


      # Tested on Fedora 38 x86_64
      git checkout master # ad34be1f329edc8e7155983835cc70d733c014b8
      patch -p1 <repro.patch
      git checkout -b master-ccache
      git commit -a --allow-empty-message -m ''
      rm -rf ~/.ccache ~/.cache/ccache
      (set -ex;KIND=release;rm -rf build/linux-x86_64-server-$KIND;export PATH="$(echo "$PATH"|sed 's#:/usr/lib64/ccache:#:#')";bash configure --disable-precompiled-headers --enable-ccache --with-debug-level=$KIND --with-boot-jdk=/usr/lib/jvm/java-20;MAKEFLAGS= time make -C build/linux-x86_64-server-$KIND JOBS=32 images)
      git checkout master
      (set -ex;KIND=release;export PATH="$(echo "$PATH"|sed 's#:/usr/lib64/ccache:#:#')";MAKEFLAGS= time make -C build/linux-x86_64-server-$KIND JOBS=32 images)

      ->

      Updating support/modules_libs/java.base/server/libjvm.so due to 1 file(s)
      /usr/bin/ld: openjdk-git/build/linux-x86_64-server-release/hotspot/variant-server/libjvm/objs/g1CollectedHeap.o: in function `G1CollectedHeap::wait_for_collection_finish()':
      make/hotspot/../../src/hotspot/share/gc/g1/g1CollectedHeap.hpp:291: undefined reference to `G1UncommitRegionTask::wait_if_active()'
      collect2: error: ld returned 1 exit status

            jkratochvil Jan Kratochvil
            jkratochvil Jan Kratochvil
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: