Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

The “Just Works” example errors out with latest Ruby on Windows

Open Eekle opened this issue 1 year ago • 5 comments

Hi,

After installing the latest version of Ruby (3.1.3) on windows I can install the ceedlings gem.

I can then run ceedling example temp_sensor. However running ceedling test:all yields:

❯ ceedling test:all
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:334:in `safe_load'
        from C:/Ruby31-x64/lib/ruby/3.1.0/psych.rb:369: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:32:in `load'
        from C:/Ruby31-x64/bin/ceedling:32:in `<main>'
        ```

Eekle avatar Mar 07 '23 17:03 Eekle

If you have the time to experiment, can you download the latest pre-release gem from the releases tab here on github, and install it manually like this:

gem install --local ceedling-0.32.0-336de41.gem 

Does this have the same issue? It's been updated to support newer versions of Ruby. It also has a lot of other improvements, but hasn't yet been fully validated.

mvandervoord avatar Mar 07 '23 17:03 mvandervoord

That seems to have fixed it.

Eekle avatar Mar 07 '23 19:03 Eekle

I'm still having this problem, even with doing gem install --local ceedling-0.32.0-336de41.gem .

/usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:430:in `visit_Psych_Nodes_Alias': Unknown alias: common_defines (Psych::BadAlias)
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:338:in `block in register_empty'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:338:in `each'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:338:in `register_empty'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:146:in `visit_Psych_Nodes_Sequence'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
	from /usr/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
	from /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
	from /usr/lib/ruby/3.1.0/psych.rb:335:in `safe_load'
	from /usr/lib/ruby/3.1.0/psych.rb:370:in `load'
	from /builds/micro_x/mbs/software/mbs-tube-controller/vendor/ceedling/lib/ceedling/yaml_wrapper.rb:8:in `load'
	from /builds/micro_x/mbs/software/mbs-tube-controller/vendor/ceedling/lib/ceedling/project_file_loader.rb:82:in `load_project_config'
	from /builds/micro_x/mbs/software/mbs-tube-controller/vendor/ceedling/lib/ceedling/setupinator.rb:14:in `load_project_files'
	from vendor/ceedling/lib/../lib/ceedling/rakefile.rb:39:in `<top (required)>'
	from vendor/ceedling/lib/ceedling.rb:66:in `load'
	from vendor/ceedling/lib/ceedling.rb:66:in `load_project'
	from rakefile.rb:4:in `<top (required)>'
	from /var/lib/gems/3.1.0/gems/ceedling-0.32.0/bin/ceedling:336:in `load'
	from /var/lib/gems/3.1.0/gems/ceedling-0.32.0/bin/ceedling:336:in `<top (required)>'
	from /usr/local/bin/ceedling:25:in `load'
	from /usr/local/bin/ceedling:25:in `<main>'
***** Unit Test FAILED *****

I also tried the latest 0.32.0 release candidate (af02fcd), which equally didn't work.

I am using Debian 12 (Bookworm).

wget https://github.com/ThrowTheSwitch/Ceedling/releases/download/0.32.0-336de41/ceedling-0.32.0-336de41.gem
gem install constructor deep_merge thor
gem install --local ceedling-0.32.0-336de41.gem

Is there anything I'm missing?

sammyj85 avatar Jul 13 '23 13:07 sammyj85

I think you are updating existing project and your project.yml doesn't have all sections inside?

Letme avatar Jul 13 '23 13:07 Letme

I think you are updating existing project and your project.yml doesn't have all sections inside?

Thanks, that looks like it was it. Sorry, I may have highjacked an existing issue ticket, but.. is there a guide on what changed in 0.32 to require new sections? I'm new at Ceedling and have inherited an existing project. The new error seems to suggest :name (and :executable) are under the :tools: :test: and then :compiler:, :linker:, etc, as given in the new project.yml template? Though when I defined them, the error stayed the same?

#<Thread:0x00007f870a9d5948 /var/lib/gems/3.1.0/gems/ceedling-0.32.0/lib/ceedling/par_map.rb:7 run> terminated with exception (report_on_exception is true):
/var/lib/gems/3.1.0/gems/ceedling-0.32.0/lib/ceedling/tool_executor.rb:29:in `build_command_line': undefined method `[]' for nil:NilClass (NoMethodError)

    executable = @tool_executor_helper.osify_path_separators( expandify_element(tool_config[:name], tool_config[:executable], *args) )
                                                                                           ^^^^^^^
        from /var/lib/gems/3.1.0/gems/ceedling-0.32.0/lib/ceedling/generator.rb:103:in `generate_object_file'
        from /var/lib/gems/3.1.0/gems/ceedling-0.32.0/lib/ceedling/test_invoker_helper.rb:61:in `block in generate_objects_now'
        from /var/lib/gems/3.1.0/gems/ceedling-0.32.0/lib/ceedling/par_map.rb:10:in `block (2 levels) in par_map'
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass

EDIT: Nevermind, solved now. I upgraded the local ceedling instance, and that got past that error.

sammyj85 avatar Jul 13 '23 16:07 sammyj85