Hello community, here is the log from the commit of package yast2-ruby-bindings for openSUSE:Factory checked in at 2015-10-20 16:20:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old) and /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-ruby-bindings" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes 2015-08-10 09:09:37.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 2015-10-20 16:20:35.000000000 +0200 @@ -1,0 +2,14 @@ +Mon Oct 5 12:04:35 UTC 2015 - jreidin...@suse.com + +- Used rb_gc_register_address to fix 'method to_s called on + terminated object' during package installation (bsc#945299) +- 3.1.40 + +------------------------------------------------------------------- +Wed Sep 30 07:44:18 UTC 2015 - an...@suse.com + +- Added a regression test for the fix of bnc#943757 implemented + in libyui-ncurses 2.47.3 +- 3.1.39 + +------------------------------------------------------------------- Old: ---- yast2-ruby-bindings-3.1.38.tar.bz2 New: ---- yast2-ruby-bindings-3.1.40.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-ruby-bindings.spec ++++++ --- /var/tmp/diff_new_pack.3NxzK2/_old 2015-10-20 16:20:36.000000000 +0200 +++ /var/tmp/diff_new_pack.3NxzK2/_new 2015-10-20 16:20:36.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-ruby-bindings -Version: 3.1.38 +Version: 3.1.40 Release: 0 Url: https://github.com/yast/yast-ruby-bindings BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -42,6 +42,11 @@ BuildRequires: yast2-core-devel >= 2.24.0 Requires: yast2-ycp-ui-bindings >= 2.21.9 BuildRequires: yast2-ycp-ui-bindings-devel >= 2.21.9 +# The test suite includes a regression test (std_streams_spec.rb) for a +# libyui-ncurses bug fixed in 2.47.3 +BuildRequires: libyui-ncurses >= 2.47.3 +# The mentioned test requires screen in order to be executed in headless systems +BuildRequires: screen Requires: ruby Summary: Ruby bindings for the YaST platform License: GPL-2.0 ++++++ yast2-ruby-bindings-3.1.38.tar.bz2 -> yast2-ruby-bindings-3.1.40.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/.travis.yml new/yast2-ruby-bindings-3.1.40/.travis.yml --- old/yast2-ruby-bindings-3.1.38/.travis.yml 2015-08-04 18:05:11.000000000 +0200 +++ new/yast2-ruby-bindings-3.1.40/.travis.yml 2015-10-05 16:35:16.000000000 +0200 @@ -5,7 +5,7 @@ # disable rvm, use system Ruby - rvm reset - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh - - sh ./travis_setup.sh -p "docbook-xsl xsltproc yast2-core-dev yast2-devtools libxcrypt-dev cmake yast2-ycp-ui-bindings-dev ruby2.1 ruby2.1-dev rake ruby-fast-gettext language-pack-en language-pack-cs" -g "yast-rake rspec:3.3.0 rubocop:0.29.1" + - sh ./travis_setup.sh -p "docbook-xsl xsltproc yast2-core-dev yast2-devtools libxcrypt-dev cmake yast2-ycp-ui-bindings-dev ruby2.1 ruby2.1-dev rake ruby-fast-gettext language-pack-en language-pack-cs screen" -g "yast-rake rspec:3.3.0 rubocop:0.29.1" script: - rake check:syntax - rubocop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/package/yast2-ruby-bindings.changes new/yast2-ruby-bindings-3.1.40/package/yast2-ruby-bindings.changes --- old/yast2-ruby-bindings-3.1.38/package/yast2-ruby-bindings.changes 2015-08-04 18:05:11.000000000 +0200 +++ new/yast2-ruby-bindings-3.1.40/package/yast2-ruby-bindings.changes 2015-10-05 16:35:16.000000000 +0200 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Mon Oct 5 12:04:35 UTC 2015 - jreidin...@suse.com + +- Used rb_gc_register_address to fix 'method to_s called on + terminated object' during package installation (bsc#945299) +- 3.1.40 + +------------------------------------------------------------------- +Wed Sep 30 07:44:18 UTC 2015 - an...@suse.com + +- Added a regression test for the fix of bnc#943757 implemented + in libyui-ncurses 2.47.3 +- 3.1.39 + +------------------------------------------------------------------- Tue Aug 4 15:53:33 UTC 2015 - mvid...@suse.com - Applied the style guide, with Rubocop. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/package/yast2-ruby-bindings.spec new/yast2-ruby-bindings-3.1.40/package/yast2-ruby-bindings.spec --- old/yast2-ruby-bindings-3.1.38/package/yast2-ruby-bindings.spec 2015-08-04 18:05:11.000000000 +0200 +++ new/yast2-ruby-bindings-3.1.40/package/yast2-ruby-bindings.spec 2015-10-05 16:35:16.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-ruby-bindings -Version: 3.1.38 +Version: 3.1.40 Url: https://github.com/yast/yast-ruby-bindings Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -42,6 +42,11 @@ BuildRequires: yast2-core-devel >= 2.24.0 Requires: yast2-ycp-ui-bindings >= 2.21.9 BuildRequires: yast2-ycp-ui-bindings-devel >= 2.21.9 +# The test suite includes a regression test (std_streams_spec.rb) for a +# libyui-ncurses bug fixed in 2.47.3 +BuildRequires: libyui-ncurses >= 2.47.3 +# The mentioned test requires screen in order to be executed in headless systems +BuildRequires: screen Requires: ruby Summary: Ruby bindings for the YaST platform License: GPL-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/src/binary/Y2RubyReference.cc new/yast2-ruby-bindings-3.1.40/src/binary/Y2RubyReference.cc --- old/yast2-ruby-bindings-3.1.38/src/binary/Y2RubyReference.cc 2015-08-04 18:05:11.000000000 +0200 +++ new/yast2-ruby-bindings-3.1.40/src/binary/Y2RubyReference.cc 2015-10-05 16:35:16.000000000 +0200 @@ -9,10 +9,16 @@ for (int i = 0; i < m_call.size(); ++i) { VALUE value = ycpvalue_2_rbvalue(m_call.value(i)); - RB_GC_GUARD(value); params[i] = value; + // register parameters to avoid its garbage collecting during creation of + // other non trivial types. RB_GC_GUARD is not enough. (bnc#945299) + rb_gc_register_address(params + i); } YCPValue res = rbvalue_2_ycpvalue(rb_funcall3(object, rb_intern("call"),m_call.size(), params)); + for (int i = 0; i < m_call.size(); ++i) + { + rb_gc_unregister_address(params + i); + } delete[] params; return res; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/src/binary/YRuby.cc new/yast2-ruby-bindings-3.1.40/src/binary/YRuby.cc --- old/yast2-ruby-bindings-3.1.38/src/binary/YRuby.cc 2015-08-04 18:05:11.000000000 +0200 +++ new/yast2-ruby-bindings-3.1.40/src/binary/YRuby.cc 2015-10-05 16:35:16.000000000 +0200 @@ -190,14 +190,21 @@ YCPValue v = argList->value(i); y2debug("Adding argument %d of type %s", i, v->valuetype_str()); VALUE vr = ycpvalue_2_rbvalue(v); - RB_GC_GUARD(vr); values[i+3] = vr; + // register parameters to avoid its garbage collecting during creation of + // other non trivial types. RB_GC_GUARD is not enough. (bnc#945299) + rb_gc_register_address(values + i + 3); } y2debug( "Will call function '%s' in module '%s' with '%d' arguments", function.c_str(), module_name.c_str(), size-1); int error; VALUE result = rb_protect(protected_call, (VALUE)values, &error); + for (int i = 0 ; i < size; ++i ) + { + rb_gc_unregister_address(values + i + 3); + } + if (error) { VALUE exception = rb_gv_get("$!"); /* get last exception */ @@ -227,8 +234,11 @@ VALUE wfm_module = y2ruby_nested_const_get("Yast::WFM"); VALUE client_path = rb_str_new2(path.c_str()); - RB_GC_GUARD(client_path); + // register parameters to avoid its garbage collecting during creation of + // other non trivial types. RB_GC_GUARD is not enough. (bnc#945299) + rb_gc_register_address(&client_path); VALUE result = rb_funcall(wfm_module, rb_intern("run_client"), 1, client_path); + rb_gc_unregister_address(&client_path); return rbvalue_2_ycpvalue(result); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/tests/ruby/CMakeLists.txt new/yast2-ruby-bindings-3.1.40/tests/ruby/CMakeLists.txt --- old/yast2-ruby-bindings-3.1.38/tests/ruby/CMakeLists.txt 2015-08-04 18:05:11.000000000 +0200 +++ new/yast2-ruby-bindings-3.1.40/tests/ruby/CMakeLists.txt 2015-10-05 16:35:16.000000000 +0200 @@ -9,3 +9,5 @@ foreach(test ${Specs}) ADD_TEST(${test} rspec --format doc ${test}) endforeach(test) + +ADD_TEST("integration" ruby ${CMAKE_CURRENT_SOURCE_DIR}/integration/run.rb) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/tests/ruby/integration/run.rb new/yast2-ruby-bindings-3.1.40/tests/ruby/integration/run.rb --- old/yast2-ruby-bindings-3.1.38/tests/ruby/integration/run.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-ruby-bindings-3.1.40/tests/ruby/integration/run.rb 2015-10-05 16:35:16.000000000 +0200 @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +# std_streams_spec.rb is used to verify that bnc#943757 is fixed in +# libyui-ncurses >= 2.47.3. Thus, is an integration test for YaST+libyui +# +# It runs perfectly in a regular system by just calling +# rspec std_streams_spec.rb +# but headless systems like jenkins need this script to fake the screen + +test = File.dirname(__FILE__) + "/std_streams_spec.rb" +cmd = "rspec #{test}" + +`screen -D -m sh -c '#{cmd}; echo \$? > /tmp/exit'` +if File.read("/tmp/exit") != "0\n" + puts "Test failed: '#{cmd}'. Rerun manually to see the cause." + exit false +else + puts "Test succeeded." + exit true +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.38/tests/ruby/integration/std_streams_spec.rb new/yast2-ruby-bindings-3.1.40/tests/ruby/integration/std_streams_spec.rb --- old/yast2-ruby-bindings-3.1.38/tests/ruby/integration/std_streams_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-ruby-bindings-3.1.40/tests/ruby/integration/std_streams_spec.rb 2015-10-05 16:35:16.000000000 +0200 @@ -0,0 +1,40 @@ +#! /usr/bin/env rspec + +# We do not have a proper ncurses in travis at the moment +exit 0 if ENV["TRAVIS"] + +require_relative "../test_helper" +require "yast/ui_shortcuts" + +Yast.import "UI" + +def std_puts(message) + $stdout.puts "stdout: #{message}" + $stderr.puts "stderr: #{message}" +end + +# Regression test for the fix of bnc#943757 implemented +# in libyui-ncurses 2.47.3 +describe "streams redirection in libyui-ncurses" do + include Yast::UIShortcuts + + around do |example| + Yast.ui_component = "ncurses" + Yast::UI.OpenUI + example.run + Yast::UI.CloseUI + + # Having an expectation in the around block looks weird, but using around + # to execute OpenUI/CloseUI was needed to make the bug pop up. + # + # In addition to not crashing, these messages should be displayed when + # running RSpec, not sure if it's possible to check that. + expect { std_puts "tty is free again" }.to_not raise_error + end + + it "does not fall apart when stderr is used" do + Yast::UI.OpenDialog(PushButton("Hello, World!")) + expect { std_puts "NCurses is using the tty" }.to_not raise_error + Yast::UI.CloseDialog + end +end