Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify/resolve warnings encountered in gradle build #1815

Closed
devinbileck opened this issue Oct 24, 2018 · 5 comments
Closed

Identify/resolve warnings encountered in gradle build #1815

devinbileck opened this issue Oct 24, 2018 · 5 comments
Assignees
Labels

Comments

@devinbileck
Copy link
Member

devinbileck commented Oct 24, 2018

The following, taken from https://travis-ci.org/bisq-network/bisq/builds/445786437, should be investigated and ideally resolved.

> Task :assets:compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :core:compileTestJava
Note: /home/travis/build/bisq-network/bisq/core/src/test/java/bisq/core/payment/PaymentAccountTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :desktop:compileTestJava
Note: /home/travis/build/bisq-network/bisq/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/travis/build/bisq-network/bisq/desktop/src/test/java/bisq/desktop/maker/PreferenceMakers.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

This needs to be resolved before migrating to Gradle 5:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
@devinbileck
Copy link
Member Author

devinbileck commented Oct 25, 2018

In Task :assets:compileJava, I noticed a lot of assets are using DefaultAddressValidator.
e.g.

assets\src\main\java\bisq\asset\coins\Burstcoin.java:26: warning: [deprecation] DefaultAddressValidator in bisq.asset has been deprecated
        super("Burstcoin", "BURST", new DefaultAddressValidator());
                                        ^

Which means Task :assets:compileTestJava has warnings like:

assets\src\test\java\bisq\asset\coins\BurstcoinTest.java:22: warning: [deprecation] AbstractAssetWithDefaultValidatorTest in bisq.asset has been deprecated
public class BurstcoinTest extends AbstractAssetWithDefaultValidatorTest {
                                   ^

These are the assets using DefaultAddressValidator:

  • Burstcoin
  • Counterparty
  • DarkNet
  • Decred
  • DynamicCoin
  • Espers
  • Ether Classic
  • Gridcoin
  • LBRY Credits
  • Lisk
  • MaidSafeCoin
  • Namecoin
  • Nav Coin
  • NuBits
  • Pepe Cash
  • PostCoin
  • ReddCoin
  • Safe FileSystem Coin
  • Siacoin
  • Siafund
  • Sibcoin
  • STEEM
  • Unobtanium
  • Zcoin

I assume these assets are likely to be removed soon enough so not worth implementing custom validators.

@devinbileck
Copy link
Member Author

Before moving to Gradle 5, we will need to consider alternatives to gradle-witness since its last activity was Nov 2014 and this issue is still outstanding:

> Configure project :desktop
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_50pvy62xio1vz17f8pklhdf32.run(C:\Users\Devin\Documents\GitHub\devinbileck\bisq\desktop\build.gradle:18)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

I found https://github.com/matthewtamlin/retrial as a potential candidate, which states:

Retrial was created to address the unresolved issues in Open Whisper Systems' gradle-witness plugin, and to provide a more convenient means of storing dependency checksums.

@devinbileck devinbileck changed the title Resolve deprecation warnings encountered in gradle build Identify/resolve warnings encountered in gradle build Oct 29, 2018
@devinbileck
Copy link
Member Author

As for this warning, it appears to be a known issue protocolbuffers/protobuf#3781

> Task :p2p:test
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/C:/Users/Devin/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protobuf-java/3.5.1/8c3492f7662fa1cbf8ca76a0f5eb1146f7725acd/protobuf-java-3.5.1.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@cbeams
Copy link
Contributor

cbeams commented Nov 3, 2018

@devinbileck wrote:

I assume these assets are likely to be removed soon enough so not worth implementing custom validators.

Yes, good point. I've created #1861 to track that de-listing process. We can return to getting rid of the remaining DefaultAddressValidator usages afterward.

Before moving to Gradle 5, we will need to consider alternatives to gradle-witness since its last activity was Nov 2014 and [the leftShift issue] is still outstanding

This is a really easy problem to solve, and we're already working from my fork of gradle-witness, so we might want to just patch this one as well instead of moving to something entirely different.

Per the commit comment at 27cc933, the gradle-witness.jar we're using today is built from the PR at signalapp/gradle-witness#26 (which comes from my fork). So we can just further patch the code there, issue another pull request to the canonical repository (to be good citizens), and rebuild and check in the new jar.

As for this [illegal reflective access] warning, it appears to be a known issue protocolbuffers/protobuf#3781

I researched this quite a bit and tried to pass --illegal-access=permit to the Gradle JVM and to the spawned JVM for the test task, and neither made a difference in quelling the warning. At this point, I'd say we need to wait for the protobuf team to produce the multi-release jar they talk about in the issue referenced above.

I'd suggest putting together PRs for what you can, creating specific issues to track the ones you can't, and closing this catch-all issue sooner than later. This is the sort of issue that can just linger open indefinitely because not every warning is fixed yet.

@devinbileck
Copy link
Member Author

@cbeams Thanks for the detailed response and investigation!

I'd suggest putting together PRs for what you can, creating specific issues to track the ones you can't, and closing this catch-all issue sooner than later.

There are some other warnings I had planned to investigate as well, but haven't had a chance. I was using this issue to track my results. But I agree, I will file individual issues for each one, and start tackling what I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants