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

[BUG] debug in intellij shows build failed #15528

Closed
asifbashar opened this issue Aug 30, 2024 · 2 comments
Closed

[BUG] debug in intellij shows build failed #15528

asifbashar opened this issue Aug 30, 2024 · 2 comments
Labels
bug Something isn't working Plugins untriaged

Comments

@asifbashar
Copy link

asifbashar commented Aug 30, 2024

Describe the bug

I have copied the reporting plugin source to OpenSearch OpenSearch/plugins/reporting
I have loaded the project in Intellij
When I execute "debug 'gradlew'", I get following error

/bin/sh /Users/developer1/sourcecode/git/OpenSearch/gradlew
loaded .zprofile
(base) developer1@MacBook-Pro-58 OpenSearch % /bin/sh /Users/developer1/sourcecode/git/OpenSearch/gradlew
Starting a Gradle Daemon, 2 busy Daemons could not be reused, use --status for details

> Configure project :
========================= WARNING =========================
         Backwards compatibility tests are disabled!
See https:/github.com/opensearch-project/OpenSearch/issues/4173
===========================================================

> Configure project :plugins:reporting
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 152
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure9.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:152)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 152
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure9.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:152)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 163
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure11$_closure47.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 163
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure11$_closure47.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure11.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:162)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Script '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build-tools/pkgbuild.gradle': line 16
The AbstractArchiveTask.archivePath property has been deprecated. This is scheduled to be removed in Gradle 9.0. Please use the archiveFile property instead. For more information, please refer to https:/docs.gradle.org/8.6/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:archivePath in the Gradle documentation.
        at pkgbuild_1lhr6jkgw6l48svy6g1e5k6jk$_run_closure1$_closure2.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build-tools/pkgbuild.gradle:16)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at pkgbuild_1lhr6jkgw6l48svy6g1e5k6jk$_run_closure1.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build-tools/pkgbuild.gradle:10)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.6
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 11 (Apple JDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/applejdk-11.0.8.10.2.jdk/Contents/Home
  Random Testing Seed   : 1F2DC9091961A6A0
  In FIPS 140 mode      : false
=======================================

> Task :help

Welcome to Gradle 8.6.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see more detail about a task, run gradlew help --task <task>

To see a list of command-line options, run gradlew --help

For more detail on using Gradle, see https:/docs.gradle.org/8.6/userguide/command_line_interface.html

For troubleshooting, visit https:/help.gradle.org

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle' line: 152

* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https:/help.gradle.org.

BUILD FAILED in 34s
9 actionable tasks: 1 executed, 8 up-to-date
(base) developer1@MacBook-Pro-58 OpenSearch % /bin/sh /Users/developer1/sourcecode/git/OpenSearch/gradlew

> Configure project :
========================= WARNING =========================
         Backwards compatibility tests are disabled!
See https:/github.com/opensearch-project/OpenSearch/issues/4173
===========================================================

> Configure project :plugins:reporting
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 152
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure9.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:152)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 152
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure9.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:152)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 163
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure11$_closure47.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle': line 163
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https:/docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure11$_closure47.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:163)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_6g03j0829xbhwctya11ux7jy2$_run_closure11.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle:162)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Script '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build-tools/pkgbuild.gradle': line 16
The AbstractArchiveTask.archivePath property has been deprecated. This is scheduled to be removed in Gradle 9.0. Please use the archiveFile property instead. For more information, please refer to https:/docs.gradle.org/8.6/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:archivePath in the Gradle documentation.
        at pkgbuild_1lhr6jkgw6l48svy6g1e5k6jk$_run_closure1$_closure2.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build-tools/pkgbuild.gradle:16)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at pkgbuild_1lhr6jkgw6l48svy6g1e5k6jk$_run_closure1.doCall$original(/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build-tools/pkgbuild.gradle:10)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.6
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 11 (Apple JDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/applejdk-11.0.8.10.2.jdk/Contents/Home
  Random Testing Seed   : 6EAEB01154CB2ECB
  In FIPS 140 mode      : false
=======================================

> Task :help

Welcome to Gradle 8.6.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see more detail about a task, run gradlew help --task <task>

To see a list of command-line options, run gradlew --help

For more detail on using Gradle, see https:/docs.gradle.org/8.6/userguide/command_line_interface.html

For troubleshooting, visit https:/help.gradle.org

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/developer1/sourcecode/git/OpenSearch/plugins/reporting/build.gradle' line: 152

* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https:/help.gradle.org.

BUILD FAILED in 7s
9 actionable tasks: 1 executed, 8 up-to-date
(base) developer1@MacBook-Pro-58 OpenSearch % gradle

Related component

Plugins

To Reproduce

  • copy the reporting plugin source to OpenSearch/plugins/
  • Load the project in Intellij
  • Execute "debug 'gradlew'"

Expected behavior

starts in debug mode

Additional Details

Plugins
Reporting

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: macOS
  • Version [14.6.1 (23G93)]

Additional context

@asifbashar asifbashar added bug Something isn't working untriaged labels Aug 30, 2024
@asifbashar
Copy link
Author

asifbashar commented Aug 30, 2024

Please assign this to @dblock

@dblock
Copy link
Member

dblock commented Aug 30, 2024

@asifbashar This is not a bug. Copying source code into the plugins folder as is will not work without making non-trivial changes to the gradle files in the plugin. To build the reporting plugin, check out https://github.com/opensearch-project/reporting and build with ./gradlew build from there.

You can actually run OpenSearch with the reporting plugin together from there too with ./gradlew run.

osx ~/source/opensearch-project/reporting/dblock-reporting (main)$ ./gradlew run
Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.5
  OS Info               : Mac OS X 14.6.1 (aarch64)
  JDK Version           : 11 (Eclipse Temurin JDK)
  JAVA_HOME             : /Users/dblock/.sdkman/candidates/java/11.0.21-tem
  Random Testing Seed   : 68A7A90D5A7CA665
  In FIPS 140 mode      : false
=======================================
<===========--> 88% EXECUTING [5s]
> :run

If you need to make changes to both the core and the plugin, the easiest it to do the following (I took these from the k-nn plugin developer guide):

OpenSearch/dblock-OpenSearch (main)$ ./gradlew -p distribution/archives/darwin-tar assemble
...

You should see a opensearch-min--SNAPSHOT-darwin-x64.tar.gz file present in distribution/archives/darwin-tar/build/distributions/:

$ find . -name *SNAPSHOT-darwin*
./distribution/archives/darwin-tar/build/distributions/opensearch-min-3.0.0-SNAPSHOT-darwin-x64.tar.gz

You can use this output in the reporting project.

$ ./gradlew run -PcustomDistributionUrl=./distribution/archives/darwin-tar/build/distributions/opensearch-min-3.0.0-SNAPSHOT-darwin-x64.tar.gz

I'll close this, but please feel free to ask more questions below. Also, https://opensearch.org/slack.html is the best place to ask general questions like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Plugins untriaged
Projects
None yet
Development

No branches or pull requests

2 participants