logstash-plugins / logstash-input-beats

Apache License 2.0
87 stars 81 forks source link

shorten paths inside vendor directory to avoid errors during packaging #503

Closed jsvd closed 2 months ago

jsvd commented 2 months ago

avoid errors during building of Logstash:

* Where:
Script '/Users/joaoduarte/elastic/logstash/rubyUtils.gradle' line: 160

* What went wrong:
Execution failed for task ':assembleTarDistribution'.
> (null) File "logstash-9.0.0-beta-SNAPSHOT/vendor/bundle/jruby/3.1.0/gems/logstash-input-beats-6.9.0-java/vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.109.Final/netty-transport-native-unix-common-4.1.109.Final.jar" has a too long name (should be 100 or less)

The impact of the PR can be seen by comparing the contents of the vendor/jar-dependencies folder:

logstash-input-beats main ❯ find vendor/jar-dependencies -type f 
vendor/jar-dependencies/org/javassist/javassist/3.24.0-GA/javassist-3.24.0-GA.jar
vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.9.0/logstash-input-beats-6.9.0.jar
vendor/jar-dependencies/io/netty/netty-handler/4.1.109.Final/netty-handler-4.1.109.Final.jar
vendor/jar-dependencies/io/netty/netty-codec/4.1.109.Final/netty-codec-4.1.109.Final.jar
vendor/jar-dependencies/io/netty/netty-common/4.1.109.Final/netty-common-4.1.109.Final.jar
vendor/jar-dependencies/io/netty/netty-transport/4.1.109.Final/netty-transport-4.1.109.Final.jar
vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.109.Final/netty-transport-native-unix-common-4.1.109.Final.jar
vendor/jar-dependencies/io/netty/netty-buffer/4.1.109.Final/netty-buffer-4.1.109.Final.jar

And after:

logstash-input-beats shorten_vendor_paths ❯ find vendor/jar-dependencies -type f
vendor/jar-dependencies/netty-transport-native-unix-common-4.1.109.Final.jar
vendor/jar-dependencies/netty-codec-4.1.109.Final.jar
vendor/jar-dependencies/javassist-3.24.0-GA.jar
vendor/jar-dependencies/logstash-input-beats-6.9.0.jar
vendor/jar-dependencies/netty-handler-4.1.109.Final.jar
vendor/jar-dependencies/netty-transport-4.1.109.Final.jar
vendor/jar-dependencies/netty-buffer-4.1.109.Final.jar
vendor/jar-dependencies/netty-common-4.1.109.Final.jar
jsvd commented 2 months ago

@logstashmachine bump patch

jsvd commented 2 months ago

Contents of the gem can be seen here:

❯ gem build logstash-input-beats.gemspec 
[...]
  Successfully built RubyGem
  Name: logstash-input-beats
  Version: 6.9.0
  File: logstash-input-beats-6.9.0-java.gem

~/elastic/logstash-plugins/logstash-input-beats shorten_vendor_paths*
❯ gem unpack logstash-input-beats-6.9.0-java.gem
Unpacked gem: '/Users/joaoduarte/elastic/logstash-plugins/logstash-input-beats/logstash-input-beats-6.9.0-java'

~/elastic/logstash-plugins/logstash-input-beats shorten_vendor_paths*
❯ find logstash-input-beats-6.9.0-java/vendor -type f
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/netty-transport-native-unix-common-4.1.109.Final.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/netty-codec-4.1.109.Final.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/javassist-3.24.0-GA.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/logstash-input-beats-6.9.0.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/netty-handler-4.1.109.Final.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/netty-transport-4.1.109.Final.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/netty-buffer-4.1.109.Final.jar
logstash-input-beats-6.9.0-java/vendor/jar-dependencies/netty-common-4.1.109.Final.jar
jsvd commented 2 months ago

closed in favor or https://github.com/elastic/logstash/pull/16432