[ 
https://issues.apache.org/jira/browse/AVRO-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107628#comment-15107628
 ] 

Ryan Blue commented on AVRO-1785:
---------------------------------

It's easy enough to fix the syntax errors, but then Rake's test runner fails 
with different errors depending on the version of Rake I try. I used the oldest 
version of rake supported by echoe, but that fails with another compatibility 
problem.

Next, I tried to avoid rake by running tests with {{ruby -Itest -Ilib 
test/test_schema_normalization.rb}}. Tests then fail with 2 general problems: 
the order of map keys doesn't match the test so schema strings aren't equal 
(IIRC, later versions of ruby always return insertion order) and primitive 
types aren't handled correctly because the case statement uses a splat for 
primitive types.

My take-away is that [we should let 1.8.7 
go|https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/]. Thoughts?

> Ruby: schema_normalization.rb is incompatible with Ruby 1.8.7
> -------------------------------------------------------------
>
>                 Key: AVRO-1785
>                 URL: https://issues.apache.org/jira/browse/AVRO-1785
>             Project: Avro
>          Issue Type: Bug
>          Components: ruby
>    Affects Versions: 1.8.0
>            Reporter: Ryan Blue
>
> I was just checking AVRO-1775 in 1.8.7 and ran into compile errors. The 
> schema_normalization.rb code that was introduced by AVRO-1694 is not 
> compatible with Ruby 1.8.7 because it uses the "new" hash syntax in method 
> definitions.
> {code}
> blue@work:~/workspace/avro/lang/ruby$ bundle exec rake test
> /home/blue/workspace/avro/lang/ruby/Rakefile:19: warning: already initialized 
> constant VERSION
> /home/blue/.rvm/rubies/ruby-1.8.7-p374/bin/ruby -I"lib:ext:bin:test" 
> -I"/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib" 
> "/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb"
>  "test/test_help.rb" "test/test_socket_transport.rb" 
> "test/test_fingerprints.rb" "test/test_schema_normalization.rb" 
> "test/test_schema.rb" "test/test_datafile.rb" "test/test_io.rb" 
> "test/test_protocol.rb" 
> ./lib/avro/schema_normalization.rb:67: warning: else without rescue is useless
> ./lib/avro.rb:42:in `require': ./lib/avro/schema_normalization.rb:50: syntax 
> error, unexpected ':', expecting ')' (SyntaxError)
>         normalize_named_type(schema, fields: fields)
>                                             ^
> ./lib/avro/schema_normalization.rb:52: syntax error, unexpected ':', 
> expecting ')'
>         normalize_named_type(schema, symbols: schema.symbols)
>                                              ^
> ./lib/avro/schema_normalization.rb:52: syntax error, unexpected ')', 
> expecting kEND
> ./lib/avro/schema_normalization.rb:54: syntax error, unexpected ':', 
> expecting ')'
>         normalize_named_type(schema, size: schema.size)
>                                           ^
> ./lib/avro/schema_normalization.rb:54: syntax error, unexpected ')', 
> expecting kEND
> ./lib/avro/schema_normalization.rb:56: odd number list for Hash
>         { type: type, items: normalize_schema(schema.items) }
>                ^
> ./lib/avro/schema_normalization.rb:56: syntax error, unexpected ':', 
> expecting '}'
>         { type: type, items: normalize_schema(schema.items) }
>                ^
> ./lib/avro/schema_normalization.rb:56: syntax error, unexpected ':', 
> expecting '='
>         { type: type, items: normalize_schema(schema.items) }
>                             ^
> ./lib/avro/schema_normalization.rb:56: syntax error, unexpected '}', 
> expecting kEND
> ./lib/avro/schema_normalization.rb:58: odd number list for Hash
>         { type: type, values: normalize_schema(schema.values) }
>                ^
> ./lib/avro/schema_normalization.rb:58: syntax error, unexpected ':', 
> expecting '}'
>         { type: type, values: normalize_schema(schema.values) }
>                ^
> ./lib/avro/schema_normalization.rb:58: syntax error, unexpected ':', 
> expecting '='
>         { type: type, values: normalize_schema(schema.values) }
>                              ^
> ./lib/avro/schema_normalization.rb:58: syntax error, unexpected '}', 
> expecting kEND
> ./lib/avro/schema_normalization.rb:72: odd number list for Hash
>         name: field.name,
>              ^
> ./lib/avro/schema_normalization.rb:72: syntax error, unexpected ':', 
> expecting '}'
>         name: field.name,
>              ^
> ./lib/avro/schema_normalization.rb:73: syntax error, unexpected ':', 
> expecting '='
>         type: normalize_schema(field.type)
>              ^
> ./lib/avro/schema_normalization.rb:74: syntax error, unexpected '}', 
> expecting kEND
> ./lib/avro/schema_normalization.rb:80: odd number list for Hash
>       { name: name, type: schema.type_sym.to_s }.merge(attributes)
>              ^
> ./lib/avro/schema_normalization.rb:80: syntax error, unexpected ':', 
> expecting '}'
>       { name: name, type: schema.type_sym.to_s }.merge(attributes)
>              ^
> ./lib/avro/schema_normalization.rb:80: syntax error, unexpected ':', 
> expecting '='
>       { name: name, type: schema.type_sym.to_s }.merge(attributes)
>                          ^
> ./lib/avro/schema_normalization.rb:80: syntax error, unexpected '}', 
> expecting kEND
>       { name: name, type: schema.type_sym.to_s }.merge(attributes)
>                                                 ^
>         from ./lib/avro.rb:42
>         from /home/blue/workspace/avro/lang/ruby/test/test_help.rb:22:in 
> `require'
>         from /home/blue/workspace/avro/lang/ruby/test/test_help.rb:22
>         from 
> /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:15:in
>  `require'
>         from 
> /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:15
>         from 
> /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:4:in
>  `select'
>         from 
> /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:4
> rake aborted!
> Command failed with status (1): [ruby -I"lib:ext:bin:test" 
> -I"/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib" 
> "/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb"
>  "test/test_help.rb" "test/test_socket_transport.rb" 
> "test/test_fingerprints.rb" "test/test_schema_normalization.rb" 
> "test/test_schema.rb" "test/test_datafile.rb" "test/test_io.rb" 
> "test/test_protocol.rb" ]
> /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/echoe-4.6.6/lib/echoe.rb:749:in 
> `define_tasks'
> /home/blue/.rvm/gems/ruby-1.8.7-p374/bin/ruby_executable_hooks:15
> Tasks: TOP => test_inner
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to