Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-11827

Gradle task :checkJavaLinkage is not working

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • None
    • Not applicable
    • build-system
    • None

    Description

      https://github.com/apache/beam/pull/13994 revealed that the :checkJavaLinkage task in the root Gradle file does not generate the expected file.
       

      suztomo@suztomo:~/beam$ ./gradlew -Ppublishing -PskipCheckerFramework -PjavaLinkageArtifactIds=beam-sdks-java-io-google-cloud-platform -PjavaLinkageWriteBaseline=build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml :checkJavaLinkage
      Configuration on demand is an incubating feature.
      
      > Task :checkJavaLinkage
      NOTE: This task published artifacts into your local Maven repository. You may want to remove them manually.
      
      Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
      Use '--warning-mode all' to show the individual deprecation warnings.
      See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
      
      BUILD SUCCESSFUL in 51s
      1115 actionable tasks: 201 executed, 914 up-to-date
      suztomo@suztomo:~/beam$ 
      suztomo@suztomo:~/beam$ ls build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml
      ls: cannot access 'build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml': No such file or directory
      

      It's as if the "com.google.cloud.tools.opensource.classpath.LinkageCheckerMain" is not called at all while it does resolve the Gradle task dependencies (such as publishMavenJavaPublicationToMavenLocal).

      How to attach Java debugger to checkJavaLinkage task

      In MacBook, I was able to produce the problem. The checkJavaLinkage task does not generate the expected file.

      ./gradlew  --stacktrace -Ppublishing -PskipCheckerFramework \
        -PjavaLinkageArtifactIds=beam-sdks-java-io-google-cloud-platform \
        -PjavaLinkageWriteBaseline=build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml \
        :checkJavaLinkage --debug-jvm
      

      I found that the build.gradle.kts passes garbage to LinkageCheckerMain class.

      Attachments

        Issue Links

          Activity

            People

              suztomo Tomo Suzuki
              suztomo Tomo Suzuki
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 40m
                  40m