Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#44546 closed defect (fixed)

appstream-glib fails to upgrade to Version 0.2.3_0 (Mac OSX Lion 10.7.5 , Macports : 2.3.1) due to gtk-doc issue

Reported by: creativecommon@… Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cooljeanius (Eric Gallager)
Port: appstream-glib gtk-doc

Description (last modified by dbevans (David B. Evans))

I am unable to upgrade to appstream-glib ( Version 0.2.3_0)

Version installed (Current): appstream-glib (0.1.7_0)


$sudo port upgrade outdated                                                                                                                                 16:12:52
Password:
--->  Computing dependencies for appstream-glib
--->  Building appstream-glib
Error: org.macports.build for port appstream-glib returned: command execution failed
Please see the log file for port appstream-glib for details:
    /macports/var/macports/logs/_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_appstream-glib/appstream-glib/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

Attachments (1)

appstream-glib_main.log (330.5 KB) - added by creativecommon@… 10 years ago.
appstream-glib main.log

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by creativecommon@…

Attachment: appstream-glib_main.log added

appstream-glib main.log

comment:1 Changed 10 years ago by creativecommon@…

Cc: creativecommon@… added

Apologies, as I forgot code formatting.

Last edited 10 years ago by creativecommon@… (previous) (diff)

comment:2 in reply to:  1 Changed 10 years ago by dbevans (David B. Evans)

Cc: creativecommon@… removed
Keywords: error upgrade fails appstream-glib removed
Owner: changed from macports-tickets@… to devans@…
Status: newassigned
Version: 2.3.1

Replying to creativecommon@…:

Apologies, as I forgot code formatting.

Also should CC the maintainer (me) for faster response but no need to CC yourself as the ticket reporter is automatically copied.

comment:3 Changed 10 years ago by dbevans (David B. Evans)

Description: modified (diff)

comment:4 Changed 10 years ago by dbevans (David B. Evans)

From your log file, gtkdoc-fixxref (a perl script provided by gtk-doc) is failing as follows:

:info:build gtkdoc-fixxref --module=appstream-glib --module-dir=html --html-dir=/macports/share/gtk-doc/html
:info:build readline() on closed filehandle NEWFILE at /macports/bin/gtkdoc-fixxref line 481.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 484.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 485.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 489.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 490.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 491.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 492.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 493.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 494.
:info:build Use of uninitialized value $highlighted_source in substitution (s///) at /macports/bin/gtkdoc-fixxref line 495.
:info:build Can't delete html/_temp_src.2792.h.html: No such file or directory at /macports/bin/gtkdoc-fixxref line 500.
:info:build make[3]: *** [html-build.stamp] Error 2
:info:build make[3]: Leaving directory `/macports/var/macports/build/_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_appstream-glib/appstream-glib/work/appstream-glib-0_2_3/docs/api'

The pertinent lines in gtkdoc-fixxref are as follows:

    # write source to a temp file
    my $temp_source_file="$MODULE_DIR/_temp_src.$$.h";
    open (NEWFILE, ">$temp_source_file") || die "Can't open $temp_source_file: $!";
    print NEWFILE $source;
    close (NEWFILE);

    # format source
    system "echo 'let html_number_lines=0|let html_use_css=1|let html_use_xhtml=1|syn on|e $temp_source_file|run! syntax/2html.vim|w! $temp_source_file.html|qa!' | /usr/bin/vim -n -e -u NONE -T xterm >/dev/null";

    my $highlighted_source;
    {
        local $/;
        open (NEWFILE, "<$temp_source_file.html");
        $highlighted_source = <NEWFILE>;
        close (NEWFILE);
    }
    $highlighted_source =~ s#.*<pre\b[^>]*>\n##s;
    $highlighted_source =~ s#</pre>.*##s;

    # need to rewrite the stylesheet classes
    # FIXME: Vim has somewhat different syntax groups
    $highlighted_source =~ s%<span class="Comment">%<span class="comment">%gs;
    $highlighted_source =~ s%<span class="PreProc">%<span class="preproc">%gs;
    $highlighted_source =~ s%<span class="Statement">%<span class="keyword">%gs;
    $highlighted_source =~ s%<span class="Identifier">%<span class="function">%gs;
    $highlighted_source =~ s%<span class="Constant">%<span class="number">%gs;
    $highlighted_source =~ s%<span class="Special">%<span class="symbol">%gs;
    $highlighted_source =~ s%<span class="Type">%<span class="type">%gs;

    # remove temp files
    unlink ($temp_source_file)
        || die "Can't delete $temp_source_file: $!";
    unlink ("$temp_source_file.html")
        || die "Can't delete $temp_source_file.html: $!";

Comparing the two, it looks like the current source being processed is copied to a temp file (html/_temp_src.2792.h) and then a system command is executed that uses /usr/bin/vim to format it and save the result in html/_temp_src.2792.h.html. From the error messages, it looks like the first file is being created but the second is not.

Does /usr/bin/vim exist on your system? Is there an error in system.log at the failure point that might shed more light on the what's happening?

comment:5 Changed 10 years ago by dbevans (David B. Evans)

On the hunch that /usr/bin/vim as provided by 10.7 is not up to the task, please try installing MacPorts vim and then rebuild gtk-doc before attempting a clean build of appstream-glib.

sudo port install vim
sudo port -n upgrade --force gtk-doc
sudo port clean appstream-glib
sudo port upgrade appstream-glib

Thanks

comment:6 in reply to:  5 Changed 10 years ago by creativecommon@…

Replying to devans@…:

On the hunch that /usr/bin/vim as provided by 10.7 is not up to the task, please try installing MacPorts vim and then rebuild gtk-doc before attempting a clean build of appstream-glib.

sudo port install vim
sudo port -n upgrade --force gtk-doc
sudo port clean appstream-glib
sudo port upgrade appstream-glib

Thanks

Yep! That was the issue, I followed the steps you provided above. And I was able to upgrade flawlessly.

So shouldn't the port have a dependency on latest Vim, to prevent such issues?.

devans, thanks for your help and instructions.

comment:7 Changed 10 years ago by dbevans (David B. Evans)

Port: gtk-doc added
Summary: appstream-glib fails to upgrade to Version 0.2.3_0 (Mac OSX Lion 10.7.5 , Macports : 2.3.1)appstream-glib fails to upgrade to Version 0.2.3_0 (Mac OSX Lion 10.7.5 , Macports : 2.3.1) due to gtk-doc issue

Great. The problem is not really specific to appstream-glib but to gtk-doc. I'll make the necessary changes there. Thanks for the report and your help.

comment:8 Changed 10 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

Fix committed in r123123, gtk-doc now depends on MacPorts vim.

comment:9 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.