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

Use the OS separator to invoke gradlew from Rake script #13000

Merged

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Jun 17, 2021

Release notes

[rn:skip]

What does this PR do?

Uses the OS defined path separator in Rake script to invoke the gradlew command. Without this the sh('./gradlew assemble') results in error when running .\gradlew clean installDefaultGems.

Why is it important/What is the impact to the user?

This fixes a problem that Windows developers could find, starting from #12975

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • test on Windows

How to test this PR locally

On a Windows host run .\gradlew clean installDefaultGems

Related issues

Use cases

Screenshots

Logs

Use `bundle info [gemname]` to see where a bundled gem is installed.
Building logstash-core using gradle
./gradlew assemble

'.' is not recognized as an internal or external command,
operable program or batch file.

> Task :installDefaultGems FAILED
#<Class:0x3a7b8619>: Command failed with status (1): [./gradlew assemble...]
     create_shell_runner at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/file_utils.rb:67
                      sh at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/file_utils.rb:57
                  <main> at C:/Users/andrea_selva/workspace/logstash/rakelib/compile.rake:34
                 execute at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:273
                    each at org/jruby/RubyArray.java:1820
                 execute at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:273
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:214
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:237
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:236
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:233
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:194
    invoke_prerequisites at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:238
                    each at org/jruby/RubyArray.java:1820
    invoke_prerequisites at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:236
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:213
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:237
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:236
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:233
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:194
    invoke_prerequisites at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:238
                    each at org/jruby/RubyArray.java:1820
    invoke_prerequisites at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:236
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:213
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:237
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:236
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:233
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:194
    invoke_prerequisites at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:238
                    each at org/jruby/RubyArray.java:1820
    invoke_prerequisites at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:236
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:213
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:237
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:236
        handle_interrupt at org/jruby/RubyThread.java:759
         mon_synchronize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/monitor.rb:233
  invoke_with_call_chain at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:194
                  invoke at C:/Users/andrea_selva/workspace/logstash/vendor/bundle/jruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb:183
                  <main> at <script>:5

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\andrea_selva\workspace\logstash\rubyUtils.gradle' line: 143

* What went wrong:
Execution failed for task ':installDefaultGems'.
> (null) Command failed with status (1): [./gradlew assemble...]

@andsel andsel added the bug label Jun 17, 2021
@andsel andsel marked this pull request as ready for review June 18, 2021 07:26
@elasticsearch-bot elasticsearch-bot self-assigned this Jun 18, 2021
@andsel andsel assigned andsel and unassigned elasticsearch-bot Jun 18, 2021
@kaisecheng kaisecheng self-requested a review June 18, 2021 15:57
Copy link
Contributor

@kares kares left a comment

Choose a reason for hiding this comment

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

thanks for taking care of this, 🔴 CI is unrelated

@kaisecheng kaisecheng removed their request for review June 21, 2021 07:09
@andsel andsel merged commit d2c68fc into elastic:master Jun 21, 2021
andsel added a commit to andsel/logstash that referenced this pull request Jun 21, 2021
Uses the OS defined path separator in Rake script to invoke the gradlew command. Without this the sh('./gradlew assemble') results in error when running .\gradlew clean installDefaultGems.

(cherry picked from commit d2c68fc)
andsel added a commit that referenced this pull request Jun 21, 2021
)

Uses the OS defined path separator in Rake script to invoke the gradlew command. Without this the sh('./gradlew assemble') results in error when running .\gradlew clean installDefaultGems.

(cherry picked from commit d2c68fc)
kares added a commit to kares/logstash that referenced this pull request Jul 1, 2021
* master: (41 commits)
  Test: resolve integration failure due ECS mode (elastic#13044)
  Feat: event factory support (elastic#13017)
  Doc: Add geoip database API to node stats (elastic#13019)
  Add geoip database metrics to /node/stats API (elastic#13004)
  ecs: on-by-default plus docs (elastic#12830)
  ispec: fix cross-spec leak from fatal error integration specs (elastic#13002)
  Fix UBI source URL (elastic#13008)
  update fpm to allow pkg creation on jdk11+jruby 9.2 (elastic#13005)
  Add unit test to grant that production aliases correspond to a published RubyGem (elastic#12993)
  Fix logstash.bat not setting exit code (elastic#12948)
  Use the OS separator to invoke gradlew from Rake script (elastic#13000)
  Allow per-pipeline config of ECS Compatibility mode via Central Management (elastic#12861)
  Update jinja2 dependency in docker build (elastic#12994)
  fix database manager with multiple pipelines (elastic#12862)
  Fix Reflections stack traces when process yml files in classpath and debug is enabled (elastic#12991)
  Fix/log4j routing to avoid create spurious file (elastic#12965)
  Deps: update JRuby to 9.2.19.0 (elastic#12989)
  Doc: Add tip for checking for existing field (elastic#12899)
  Added test to cover the installation of aliased plugins (elastic#12967)
  CI: Update logstash_release.json after 7.3.12 (elastic#12986)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants