Bug 530275 - Review Request: rubygem-erubis - A fast and extensible eRuby implementation
Summary: Review Request: rubygem-erubis - A fast and extensible eRuby implementation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mamoru TASAKA
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 529799
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-22 05:52 UTC by Matthew Kent
Modified: 2015-02-17 13:43 UTC (History)
5 users (show)

Fixed In Version: 2.6.5-2.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-04 12:21:00 UTC
mtasaka: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)

Description Matthew Kent 2009-10-22 05:52:58 UTC
Spec URL: http://magoazul.com/wip/SPECS/rubygem-erubis.spec
SRPM URL: http://magoazul.com/wip/SRPMS/rubygem-erubis-2.6.5-1.fc12.src.rpm
Description: Erubis is a very fast, secure, and extensible implementation of eRuby.

mkent@fedora-devel-chef:~/rpmbuild/SPECS$ rpmlint rubygem-erubis.spec /var/tmp/results/rubygem-erubis-*
rubygem-erubis-doc.noarch: W: no-documentation
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Helpers/RailsHelper/init_properties%3d-c.yaml %3d
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Context/%5b%5d%3d-i.yaml %5b
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Engine/convert%21-i.yaml %21
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Helpers/RailsFormHelper/_pp_check_box_checked%3f-i.yaml %3f
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Helpers/RailsHelper/show_src%3d-c.yaml %3d
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Helpers/RailsHelper/preprocessing%3d-c.yaml %3d
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Context/%5b%5d-i.yaml %5b
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Helpers/RailsHelper/engine_class%3d-c.yaml %3d
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/PreprocessingHelper/_%3f-i.yaml %3f
rubygem-erubis-doc.noarch: W: misspelled-macro /usr/lib/ruby/gems/1.8/doc/erubis-2.6.5/ri/Erubis/Helpers/RailsFormHelper/_pp_radio_button_checked%3f-i.yaml %3f
3 packages and 1 specfiles checked; 0 errors, 11 warnings.

Comment 1 Mamoru TASAKA 2009-10-27 09:21:12 UTC
I will post some comments on this later, however
first of all would you check if test_syntax2 test passes
with the following rpms?

http://koji.fedoraproject.org/scratch/mtasaka/task_1771739/

Comment 2 Mamoru TASAKA 2009-10-27 18:31:46 UTC
Rather please try:
http://koji.fedoraproject.org/scratch/mtasaka/task_1773253/

Comment 3 Matthew Kent 2009-10-28 05:19:44 UTC
(In reply to comment #2)
> Rather please try:
> http://koji.fedoraproject.org/scratch/mtasaka/task_1773253/  

Yes the test passes with this version:

147 tests, 222 assertions, 0 failures, 0 errors

Comment 4 Mamoru TASAKA 2009-10-28 19:02:21 UTC
Well, finaly I reached the reason why test_syntax2 fails, which is
actually how ruby (especially parse.c) is rebuilt.

The failing test program is:
$ ruby -e 'require "rubygems" ; require "erubis" ; require "erubis/main" ; Erubis::Main.new.execute(["-z", "tmp.test_syntax2"])'
where the file "tmp.test_syntax2" is as below:
------------------------------------------------------------
$ cat tmp.test_syntax2 
<ul>
<% for item in list %>
  <li><%= item[:name]] %></li>
<% end %>
</ul>
------------------------------------------------------------

The result expected by rubygem-erubis's test is:
------------------------------------------------------------
tmp.test_syntax2:3: syntax error, unexpected ']', expecting ')'
 _buf << '  <li>'; _buf << ( item[:name]] ).to_s; _buf << '</li>
                                         ^
-:4: syntax error, unexpected kEND, expecting ')'
'; end 
      ^
-:7: syntax error, unexpected $end, expecting ')'
------------------------------------------------------------
however Fedora's ruby returns:
------------------------------------------------------------
tmp.test_syntax2:3: syntax error
 _buf << '  <li>'; _buf << ( item[:name]] ).to_s; _buf << '</li>
                                         ^
-:4: syntax error
'; end 
      ^
-:7: syntax error
------------------------------------------------------------

This is because when regenerating parse.c (which is in ruby source code),
on Fedora "$ byacc parse.y" is used while the original source uses
"$ bison -y parse.y". This causes the following difference:
------------------------------------------------------------
$ rm -f parse.c ; make parse.c YACC="byacc "
byacc  parse.y
sed '/^#/s|y\.tab\.c|parse.c|' y.tab.c > parse.c
rm -f y.tab.c
$ grep "syntax error" parse.c
    yyerror("syntax error");
$ 
$ 
$ rm -f parse.c ; make parse.c YACC="bison -y "
bison -y  parse.y
sed '/^#/s|y\.tab\.c|parse.c|' y.tab.c > parse.c
rm -f y.tab.c
$ grep "syntax error" parse.c
   If YYTABLE_NINF, syntax error.  */
      yyerror (YY_("syntax error: cannot back up")); \
   copied.  As a special case, return 0 if an ordinary "syntax error"
      YY_("syntax error, unexpected %s");
      YY_("syntax error, unexpected %s, expecting %s");
      YY_("syntax error, unexpected %s, expecting %s or %s");
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
      static char const yyunexpected[] = "syntax error, unexpected %s";
/* Number of syntax errors so far.  */
      yyerror (YY_("syntax error"));
	    yyerror (YY_("syntax error"));
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
------------------------------------------------------------ 
So the error messages actually change.

What I don't know currently is that whether it is strictly expected
on usual or not that ruby returns error messages in this format.
Do you know some reason that rubygem-erubis strictly expectes this
format?

Comment 5 Mamoru TASAKA 2009-10-28 19:16:50 UTC
Note that adding "BR: bison" to current ruby.spec will fix this issue.

Comment 6 Matthew Kent 2009-10-29 03:45:03 UTC
(In reply to comment #4)

Thanks for looking into this. Interesting issue.

> So the error messages actually change.
> 
> What I don't know currently is that whether it is strictly expected
> on usual or not that ruby returns error messages in this format.
> Do you know some reason that rubygem-erubis strictly expectes this
> format?  

Not sure honestly. Easy cut and paste solution to verify the syntax check is working I guess?

Comment 7 Mamoru TASAKA 2009-10-29 19:14:11 UTC
Well,

* About %check:
  - I decided to add the fix for test_syntax2 on ruby.
    Now for F-13/12/11 the fixed ruby rpms are added into buildroot
    tree (i.e. koji scratch build should success now)
    ( and for F-12 the fixed ruby will be pushed on the next
    rawhide push ). So you can remove test_syntax2 hack.

  - The following may be smarter:
------------------------------------------------------------
export GEM_PATH=$(pwd)/%{gemdir}
export PATH=$(pwd)/%{gemdir}/bin:$PATH

pushd .%{geminstdir}/test
find data/users-guide -type f -name \*.rb | \
	xargs sed -i -e '/require.*erubis/i\require "rubygems"'

mv data/users-guide/Example.ejava data/users-guide/example.ejava
ruby -rrubygems test.rb
------------------------------------------------------------
    By the way the line "mv data/...." should be moved to %build
    section because for this file the filename is definitely
    wrong and it is better that the installed file should also
    be renamed.

Comment 8 Matthew Kent 2009-10-30 05:11:06 UTC
Spec URL: http://magoazul.com/wip/SPECS/rubygem-erubis.spec
SRPM URL: http://magoazul.com/wip/SRPMS/rubygem-erubis-2.6.5-2.fc12.src.rpm

* Thu Oct 29 2009 Matthew Kent <mkent@magoazul.com> - 2.6.5-2
- Move file rename to build stage (#530275).
- Simplify %%check stage (#530275).
- Remove disable of test_syntax2, fixed by new ruby build (#530275).

Comment 9 Mamoru TASAKA 2009-10-30 16:22:13 UTC
-----------------------------------------------------------
    This package (rubygem-erubis) is APPROVED by mtasaka
-----------------------------------------------------------

For F-12, first please request rel-eng team to make
rubygem-abstract-1.0.0-2.fc12 tagged as f12-final (at:
https://fedorahosted.org/rel-eng/ if unsure add me to CC list)
because F-11 rubygem-abstract-1.0.0-2.fc11 is now included in 
F-12 build tree.

[tasaka1@localhost ~]$ koji latest-pkg dist-f12-build rubygem-abstract
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
rubygem-abstract-1.0.0-2.fc11             dist-f11-updates      mkent
[tasaka1@localhost ~]$ koji latest-pkg dist-f12-updates-candidate rubygem-abstract
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
rubygem-abstract-1.0.0-2.fc12             dist-f12-updates-candidate  mkent

Comment 10 Matthew Kent 2009-10-31 05:39:10 UTC
(In reply to comment #9)
> -----------------------------------------------------------
>     This package (rubygem-erubis) is APPROVED by mtasaka
> -----------------------------------------------------------

Thank you for the review.

> 
> For F-12, first please request rel-eng team to make
> rubygem-abstract-1.0.0-2.fc12 tagged as f12-final (at:
> https://fedorahosted.org/rel-eng/ if unsure add me to CC list)
> because F-11 rubygem-abstract-1.0.0-2.fc11 is now included in 
> F-12 build tree.
> 
> [tasaka1@localhost ~]$ koji latest-pkg dist-f12-build rubygem-abstract
> Build                                     Tag                   Built by
> ----------------------------------------  -------------------- 
> ----------------
> rubygem-abstract-1.0.0-2.fc11             dist-f11-updates      mkent
> [tasaka1@localhost ~]$ koji latest-pkg dist-f12-updates-candidate
> rubygem-abstract
> Build                                     Tag                   Built by
> ----------------------------------------  -------------------- 
> ----------------
> rubygem-abstract-1.0.0-2.fc12             dist-f12-updates-candidate  mkent  

Sorry, still learning the release process. Reading https://www.redhat.com/archives/fedora-devel-announce/2009-October/msg00007.html makes no mention of new packages in the criteria. Nor does reading the open rel-eng tickets.

Should I wait on rubygem-abstract/rubygem-erubis until f12 updates are reopened?

Comment 11 Matthew Kent 2009-10-31 05:40:34 UTC
New Package CVS Request
=======================
Package Name: rubygem-erubis
Short Description: A fast and extensible eRuby implementation
Owners: mkent
Branches: F-11 F-12
InitialCC:

Comment 12 Mamoru TASAKA 2009-10-31 06:31:57 UTC
(In reply to comment #10)
> Sorry, still learning the release process. Reading
> https://www.redhat.com/archives/fedora-devel-announce/2009-October/msg00007.html
> makes no mention of new packages in the criteria. Nor does reading the open
> rel-eng tickets.
> 
> Should I wait on rubygem-abstract/rubygem-erubis until f12 updates are
> reopened?  

I guess for now rel-eng team also accepts new package request.
Please contact rel-eng team.

Comment 13 Kevin Fenzi 2009-10-31 23:44:35 UTC
cvs done.

Comment 14 Fedora Update System 2009-11-03 08:39:09 UTC
rubygem-erubis-2.6.5-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/rubygem-erubis-2.6.5-2.fc11

Comment 15 Fedora Update System 2009-11-04 12:20:54 UTC
rubygem-erubis-2.6.5-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2009-11-16 07:31:13 UTC
ruby-1.8.6.383-4.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2010-01-14 06:33:49 UTC
rubygem-erubis-2.6.5-2.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/rubygem-erubis-2.6.5-2.fc12

Comment 18 Fedora Update System 2010-01-15 22:08:03 UTC
rubygem-erubis-2.6.5-2.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Michael Stahnke 2010-09-10 20:14:06 UTC
Package Change Request
======================
Package Name: rubygem-erubis
New Branches: el5 el6
Owners: stahnma


mkent is aware of change.

Comment 20 Kevin Fenzi 2010-09-11 19:44:28 UTC
Git done (by process-git-requests).

Comment 21 Josef Stribny 2015-02-17 12:54:46 UTC
Package Change Request
======================
Package Name: rubygem-erubis
New Branches: epel7
Owners: jstribny humaton

Comment 22 Gwyn Ciesla 2015-02-17 13:43:27 UTC
Git done (by process-git-requests).


Note You need to log in before you can comment on or make changes to this bug.