Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

Fresh install of Ruby 3.2.1 and Ceedling 0.31.1 on Windows 10 fails with weird error.

Open ACleverDisguise opened this issue 1 year ago • 22 comments

I installed msys64, and in msys64 installed ruby. I updated to the latest version of gem, then installed ceedling. Once I corrected a PATH issue, I experienced, in sequence:

  1. There was a cheery deprecation warning on each invocation of ceedling related to the "did you mean" system.
  2. After the two-line fix in the Thor gem, I got rid of that only to be faced with File.exists? (and later Dir.exists?) errors any time I tried to use ceedling for anything.
  3. Fixing those (in a surprisingly large number of spaces) led to a final problem I have no idea how to fix. I generated an example project with ceedling example, cded to the generated directory, and got this:
 $ ./ceedling
/usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:432:in `visit_Psych_Nodes_Alias': Alias parsing was not enabled. To enable it, pass `aliases: true` to `Psych::load` or `Psych::safe_load`. (Psych::AliasesNotEnabled)
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:30:in `visit'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:6:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:340:in `block in register_empty'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:340:in `each'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:340:in `register_empty'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:148:in `visit_Psych_Nodes_Sequence'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:30:in `visit'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:6:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:347:in `block in revive_hash'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:345:in `each'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:345:in `each_slice'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:345:in `revive_hash'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:169:in `visit_Psych_Nodes_Mapping'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:30:in `visit'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:6:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:347:in `block in revive_hash'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:345:in `each'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:345:in `each_slice'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:345:in `revive_hash'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:169:in `visit_Psych_Nodes_Mapping'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:30:in `visit'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:6:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:320:in `visit_Psych_Nodes_Document'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:30:in `visit'
        from /usr/lib/ruby/3.2.0/psych/visitors/visitor.rb:6:in `accept'
        from /usr/lib/ruby/3.2.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /usr/lib/ruby/3.2.0/psych.rb:334:in `safe_load'
        from /usr/lib/ruby/3.2.0/psych.rb:369:in `load'
        from /usr/lib/ruby/3.2.0/psych.rb:671:in `block in load_file'
        from /usr/lib/ruby/3.2.0/psych.rb:670:in `open'
        from /usr/lib/ruby/3.2.0/psych.rb:670:in `load_file'
        from vendor/ceedling/bin/ceedling:278:in `<main>'

All the usual stuff to help figure out the problem:

  • uname -a → MINGW64_NT-10.0-19045 DESKTOP-HJV57MC 3.4.6.x86_64 2023-02-15 18:03 UTC x86_64 Msys
  • msys installation → msys2-x86_64-20221028.exe
  • ruby --version → ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-cygwin]
  • ceedling version → Ceedling:: 0.31.1 CMock:: 2.5.4 Unity:: 2.5.4 CException:: 1.3.3

Is there a known-good pairing of Ruby version and Ceedling version so I can continue evaluating the suite?

ACleverDisguise avatar Apr 03 '23 02:04 ACleverDisguise

Ruby 3.2 is not supported yet: #739

I suggest you either test ceedling 0.32 or you downgrade ruby to 3.1

Letme avatar Apr 03 '23 06:04 Letme

Ah. Thanks.

I'll do the downgrade. It's not fair to evaluate a package based on a pre-release.

ACleverDisguise avatar Apr 04 '23 05:04 ACleverDisguise

I'm kind of shocked that in a point release there's major, breaking API changes in Ruby, mind. That's ... serious cringe!

ACleverDisguise avatar Apr 04 '23 06:04 ACleverDisguise

Hello, I am facing the same problem with Ruby 3.2.2 and Ceddling 0.31.1 on Windows. I see 0.32.0 in PR. Can you provide me some steps to upgrade to 0.32.0? I downloaded, the Git repo for ceedling master, but was unable to upgrade to 0.32.0 gem.

HdAd90 avatar May 22 '23 17:05 HdAd90

There are published released gems (for that 0.32.0 version as pre-release https://github.com/ThrowTheSwitch/Ceedling/releases/tag/0.32.0-772f5f4) under Code/Releases (https://github.com/ThrowTheSwitch/Ceedling/releases) which you download and then simply use gem install filename.gem to install.

Letme avatar May 22 '23 18:05 Letme

Example Ok thanks, I installed the 0.32.0 ceedling. But now it's giving me the above error, any idea why that would be?

HdAd90 avatar May 22 '23 18:05 HdAd90

Is project directory already existing? I havent run that command for a long time.

Letme avatar May 22 '23 19:05 Letme

No, I want to create a new project. What should be the command if the project would have already exists?

HdAd90 avatar May 22 '23 19:05 HdAd90

you are creating a new project named project which would create a directory project at your current location. So you are either missing that directory and Ceedling has trouble creating it, or you have the directory and ceedling doesn't want to overwrite it.

To update the project, that pull request says try: ceedling upgrade <dirname> (which means you execute ceedling command outside of your project - or maybe use . as <dirname>)

Letme avatar May 22 '23 20:05 Letme

There is no "project" directory in current location.

HdAd90 avatar May 22 '23 20:05 HdAd90

Moreover, if I create a dummy folder "project" and execute that command, it still gives the same error. Do I need to have source control inside my current project? Wouldn't ceedling execute under my local copy?

HdAd90 avatar May 22 '23 20:05 HdAd90

I think that branch needs a fix as it is using invalid method to open a directory (it opens it as file). At least that's what Googling about the issue gives me.

Letme avatar May 22 '23 20:05 Letme

I see

HdAd90 avatar May 22 '23 20:05 HdAd90

How about you make project directory?

Letme avatar May 22 '23 20:05 Letme

I did create empty project directory. Same result.

HdAd90 avatar May 22 '23 21:05 HdAd90

OK, that is then the issue in that pre-release. I glanced over a code and could not find where root project directory is created (that is why i thought making a project directory and then running ceedling new project from its parent would solve the problem), but the core issue is that file read assumes a file, but gets a directory.

Letme avatar May 22 '23 21:05 Letme

Which versions you would recommend me to start using ceedling with ruby? Please let me know ruby version and ceedling version.

HdAd90 avatar May 22 '23 22:05 HdAd90

Latest Ceedling 0.31.1 is supported by ruby 3.1 versions.

Letme avatar May 23 '23 08:05 Letme

I installed ruby 3.1.4 and ceedling 0.32.0, looks like it is working now. Thanks for all your help.

HdAd90 avatar May 23 '23 13:05 HdAd90

0.32.0 is still a pre-release and as you can see from the pull request it still has some issues. The 0.31.1 is the last release. Just as a side note.

Letme avatar May 23 '23 13:05 Letme

image

If I install 0.31.1 with 3.1.4 ruby version then I get above error in snapshot. Will this cause any issues? new project "Fun" gets created though.

HdAd90 avatar May 23 '23 14:05 HdAd90

It doesnt say its an error, its just a deprecation warning.

Letme avatar May 23 '23 14:05 Letme