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

ceedling-0.31.1 error with latest rubyinstaller-3.1.0-1-x64 #657

Closed
DaPa opened this issue Jan 11, 2022 · 8 comments
Closed

ceedling-0.31.1 error with latest rubyinstaller-3.1.0-1-x64 #657

DaPa opened this issue Jan 11, 2022 · 8 comments

Comments

@DaPa
Copy link

DaPa commented Jan 11, 2022

Same gems version is installed in both latest rubyinstaller-3.1.0-1-x64 and previous rubyinstaller-3.0.3-1-x64: ceedling-0.31.1, constructor-2.0.0, deep_merge-1.2.2 and thor-0.20.3.

In latest rubyinstaller-3.1.0-1-x64 it fails with:

D:\work\unity_test>ceedling
C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:430:in `visit_Psych_Nodes_Alias': Unknown alias: common_defines (Psych::BadAlias)
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:338:in `block in register_empty'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:338:in `each'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:338:in `register_empty'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:146:in `visit_Psych_Nodes_Sequence'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych.rb:335:in `safe_load'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych.rb:370:in `load'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych.rb:671:in `block in load_file'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych.rb:670:in `open'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych.rb:670:in `load_file'
        from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ceedling-0.31.1/bin/ceedling:278:in `<top (required)>'
        from C:/Ruby31-x64/bin/ceedling:25:in `load'
        from C:/Ruby31-x64/bin/ceedling:25:in `<main>'

D:\work\unity_test>gem uninstall pyscho
Gem 'pyscho' is not installed

Tried suggestion from #615 to uninstall psycho but it tells it's not installed?!

With previous rubyinstaller-3.0.3-1-x64 it works fine:

D:\work\unity_test>ceedling

Test 'xxx.c'
-------------------------
Compiling unity.c...
Compiling CException.c...
Compiling cmock.c...
Linking xxx.out...
Running xxx.out...

...

[----------] Global test environment tear-down.
[==========] 25 tests from 3 test cases ran.
[  PASSED  ] 25 tests.
[  FAILED  ] 0 tests.

 0 FAILED TESTS

 0 FAILED TESTS

D:\work\unity_test>

Seem will have to keep the previous ruby for now. Any suggestion what can be wrong? Thanks!

@ekohandel
Copy link

I came across the same issue. It seems Ruby 3.1 uses psych gem version 4 which had a breaking change introduced to use safe_load by default instead of load. The safe_load method doesn't support alias usage in YAML files by default.

The psych gem changes can be found here.

@jonathon-generac
Copy link

@AdamLangford
Copy link

Another possible option to fix this is to add an extra argument ", aliases:true" to the calls to the YAML.load_file() function. I haven't fully tested this yet, but it seems to work for my existing test project.

bin\ceedling:278: yaml_options = YAML.load_file(main_filepath, aliases:true)
lib\ceedling\yaml_wrapper.rb:8: return YAML.load(ERB.new(File.read(filepath)).result, aliases:true)

It is probably also needed on line 56 in bin\ceedling in the upgrade() function.

@jhgorse
Copy link

jhgorse commented Jan 10, 2023

Probably worth mentioning on Readme that ceedling is incompatible with ruby 3.1.x until this is resolved.

@cormacc
Copy link

cormacc commented Jan 10, 2023

Ruby 3.0.4 appears to have introduce the same package change / error -- 3.0.3 is the latest version that works for me (manjaro linux - though a colleague has the same problem/symptoms/solution on windows).

@DaPa
Copy link
Author

DaPa commented Jan 10, 2023

Ceedling still works fine with ruby 3.0.5 on my Win10.x64 (only with 3.1.x it fails):
image

@jhgorse
Copy link

jhgorse commented Jan 11, 2023 via email

@mvandervoord
Copy link
Member

Fixed in PR #739

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

Successfully merging a pull request may close this issue.

7 participants