JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.31k stars 54 forks source link

Failures with parser-2.3.0.6 #69

Closed avdi closed 8 years ago

avdi commented 8 years ago

Recently sib started blowing up on me, and I traced it to the parser gem version. I had the latest version (2.3.0.6) installed, along with an older one (2.2.3.0). When I removed the newer version, stuff started working again.

Here's the error I was getting on any Ruby source code:

program-without-annotations:3:1: error: cannot insert "$SiB.record_result(3, ("
program-without-annotations:3: STOP_WORDS = %w[when in the of]
program-without-annotations:3:                                
program-without-annotations:3:1: note: clobbered by: insert "begin; $SiB.number_of_captures = Float::INFINITY; "
program-without-annotations:3: STOP_WORDS = %w[when in the of]
program-without-annotations:3:                                
Parser::ClobberingError
Parser::Source::Rewriter detected clobbering

/home/avdi/.gem/ruby/2.3.0/gems/parser-2.3.0.6/lib/parser/source/rewriter.rb:387:in `raise_clobber_error'
/home/avdi/.gem/ruby/2.3.0/gems/parser-2.3.0.6/lib/parser/source/rewriter.rb:209:in `append'
/home/avdi/.gem/ruby/2.3.0/gems/parser-2.3.0.6/lib/parser/source/rewriter.rb:64:in `insert_before'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/wrap_expressions.rb:36:in `block in call'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/wrap_expressions.rb:35:in `each'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/wrap_expressions.rb:35:in `call'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/wrap_expressions.rb:11:in `call'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing.rb:52:in `program_that_will_record_expressions'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing.rb:34:in `call'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing.rb:15:in `call'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/binary/add_annotations.rb:29:in `initialize'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/binary.rb:154:in `new'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/binary.rb:154:in `annotator'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/binary.rb:114:in `evaluate_program'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/lib/seeing_is_believing/binary.rb:45:in `call'
/home/avdi/.gem/ruby/2.3.0/gems/seeing_is_believing-2.2.0/bin/seeing_is_believing:6:in `<top (required)>'
/home/avdi/.gem/ruby/2.3.0/bin/seeing_is_believing:23:in `load'
/home/avdi/.gem/ruby/2.3.0/bin/seeing_is_believing:23:in `<main>'
lcguida commented 8 years ago

I've experienced the same problem. Rolling back the parser gem version to 2.2.3.0 worked.

terlar commented 8 years ago

I experience the same thing and but with the seeing_is_believing vim plugin. And I cant downgrade the version because rubocop requires a higher one.

JoshCheek commented 8 years ago

Aye. They have a newer version that probably works. I've been intending to try to upgrade, but too many plates to keep them all spinning. If anyone wants to try restricting the version or updating the code, I'm happy to pull (prob ping me on Twitter, issues get lost in my inbox).

JoshCheek commented 8 years ago

Oh, in the interim, you can specify the version to use for a gem with a special argument (eg if you can't an an env var)

$ rails -v
Rails 4.2.5

$ rails _4.2.2_ -v
Rails 4.2.2
JoshCheek commented 8 years ago

I've got it mostly there. It fixes this common issue (against Parser's HEAD, the change isn't released yet). But other changes prevent it from extracting valid comments (ie clearing the annotations partway through an edit that leaves the file in an invalid state).

mann commented 8 years ago

I was trying to get seeing_is_believing (s_i_b) working with Sublime Text 3 and was also getting a parser error. It was suggested by Josh to downgrade from my current parser gem of parser-2.3.0.6 to parser-2.2.2.6 by doing a gem uninstall parser, then reinstall the older version with gem install parser --version 2.2.2.6. That's is the parser version s_i_b was written against. This worked for me! I verified by running this at the terminal with seeing_is_believing -e '1+1' which printed out 1+1 # => 2, I also verified by going into sublime and writing something in ruby to be evaluated (eg. 2 + 2). That worked too.

JoshCheek commented 8 years ago

How to fix the issue!!

You should be able to get a working version now, with $ gem install seeing_is_believing --version 3.0.0.beta.7 I understand that I should obviously just release v3.0, but give me 3 months more, and then you can yell at me and I'll say "yes, you're right". Part of the problem is the implication of major versions, so I pushed a lot of changes towards this, rather than feeling comfortable releasing them incrementally :(

Commits

Here are all the commits since last release.

Synopsis

They pushed a newer version of parser, largely b/c of this issue, 4 days ago. I just released a new version of SiB https://rubygems.org/gems/seeing_is_believing/versions/3.0.0.beta.7

I think that's most of it. The crux of it is that my deps updated while I was busy, and SemVer wasn't sufficient to imply that they would break SiB, so when they updated, the newer deps got downloaded and ran with SiB,

avdi commented 8 years ago

Thanks a lot, Josh!

On Tue, Mar 29, 2016 at 11:55 PM Josh Cheek notifications@github.com wrote:

How to fix the issue!!

You should be able to get a working version now, with $ gem install seeing_is_believing --version 3.0.0.beta.7 I understand that I should obviously just release v3.0, but give me 3 months more, and then you can yell at me and I'll say "yes, you're right". Part of the problem is the implication of major versions, so I pushed a lot of changes towards this, rather than feeling comfortable releasing them incrementally :( Commits

Here https://github.com/JoshCheek/seeing_is_believing/compare/252911d...e73fced are all the commits since last release. Synopsis

They pushed a newer version of parser, largely b/c of this issue, 4 days ago. I just released a new version of SiB https://rubygems.org/gems/seeing_is_believing/versions/3.0.0.beta.7

I think that's most of it. The crux of it is that my deps updated while I was busy, and SemVer wasn't sufficient to imply that they would break SiB, so when they updated, the newer deps got downloaded and ran with SiB,

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/JoshCheek/seeing_is_believing/issues/69#issuecomment-203235161

lcguida commented 8 years ago

Thanks :clap:

Jpease1020 commented 8 years ago

My favorite tool is back!