Skip to content

Conversation

@suztomo
Copy link
Contributor

@suztomo suztomo commented Feb 17, 2021

https://issues.apache.org/jira/browse/BEAM-11827

Problem

The sdks/java/build-tools/beam-linkage-check.sh is not working. It fails with "Failed to generate the baseline file. Check the build error above." (full log).

It's because ./gradlew ... -PjavaLinkageWriteBaseline=build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml :checkJavaLinkage task does not generate a file.

Diagnosis

Beam repository has migrated to the Gradle Kotlin DSL recently. The Kotlin Gradle DSL needs to add a spread operator when passing an array to "args" method. Otherwise the DSL passes a String argument from toString of the array (see the screenshot of the problem below; it shows the DSL passed an unexpected String to LinkageCheckerMain):

Screen Shot 2021-02-17 at 13 55 35

The fix is to add a spread operator "*" when passing the array to the method.

Confirmation

I confirmed the fix works:

suztomo@suztomo:~/beam$ mkdir build/linkagecheck
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
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Wrote the linkage errors as exclusion file: build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml
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 1m 49s
1121 actionable tasks: 203 executed, 918 up-to-date
suztomo@suztomo:~/beam$ ls build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml
build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml
suztomo@suztomo:~/beam$ head build/linkagecheck/baseline-beam-sdks-java-io-google-cloud-platform.xml
<?xml version="1.0" encoding="UTF-8"?>
<LinkageCheckerFilter>
  <LinkageError>
    <Target>
      <Class name="org.tukaani.xz.LZMAOutputStream"/>
    </Target>
    <Source>
      <Class name="org.apache.beam.repackaged.core.org.apache.commons.compress.compressors.lzma.LZMACompressorOutputStream"/>
    </Source>
  </LinkageError>
suztomo@suztomo:~/beam$ 

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status --- --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

val linkageCheckerJava by configurations.creating
dependencies {
linkageCheckerJava("com.google.cloud.tools:dependencies:1.5.4")
linkageCheckerJava("com.google.cloud.tools:dependencies:1.5.6")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the latest Linkage Checker version.

@suztomo suztomo changed the title checkJavaLinkage task requires a spread operator for args [BEAM-11827] checkJavaLinkage task requires a spread operator for args Feb 17, 2021
@suztomo
Copy link
Contributor Author

suztomo commented Feb 17, 2021

retest this please

@suztomo
Copy link
Contributor Author

suztomo commented Feb 17, 2021

R: @kennknowles @TheNeuralBit
CC: @ramazan-yapparov

While I don't see the Jenkins/GitHub checks running today, the change is for Beam's build tools and is not supposed to affect the checks.

Copy link
Member

@TheNeuralBit TheNeuralBit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for tracking this down @suztomo, sorry I didn't catch it.

@TheNeuralBit TheNeuralBit merged commit 01258f1 into apache:master Feb 17, 2021
@suztomo
Copy link
Contributor Author

suztomo commented Feb 18, 2021

@TheNeuralBit Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants