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

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

Open
ACleverDisguise opened this issue Apr 3, 2023 · 22 comments

Comments

@ACleverDisguise
Copy link

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?

@Letme
Copy link

Letme commented Apr 3, 2023

Ruby 3.2 is not supported yet: #739

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

@ACleverDisguise
Copy link
Author

Ah. Thanks.

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

@ACleverDisguise
Copy link
Author

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

@HdAd90
Copy link

HdAd90 commented May 22, 2023

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.

@Letme
Copy link

Letme commented May 22, 2023

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.

@HdAd90
Copy link

HdAd90 commented May 22, 2023

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?

@Letme
Copy link

Letme commented May 22, 2023

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

@HdAd90
Copy link

HdAd90 commented May 22, 2023

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

@Letme
Copy link

Letme commented May 22, 2023

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>)

@HdAd90
Copy link

HdAd90 commented May 22, 2023

There is no "project" directory in current location.

@HdAd90
Copy link

HdAd90 commented May 22, 2023

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?

@Letme
Copy link

Letme commented May 22, 2023

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.

@HdAd90
Copy link

HdAd90 commented May 22, 2023

I see

@Letme
Copy link

Letme commented May 22, 2023

How about you make project directory?

@HdAd90
Copy link

HdAd90 commented May 22, 2023

I did create empty project directory. Same result.

@Letme
Copy link

Letme commented May 22, 2023

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.

@HdAd90
Copy link

HdAd90 commented May 22, 2023

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

@Letme
Copy link

Letme commented May 23, 2023

Latest Ceedling 0.31.1 is supported by ruby 3.1 versions.

@HdAd90
Copy link

HdAd90 commented May 23, 2023

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

@Letme
Copy link

Letme commented May 23, 2023

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.

@HdAd90
Copy link

HdAd90 commented May 23, 2023

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.

@Letme
Copy link

Letme commented May 23, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants