Extensions with <check> tags fail to load

Bug #668895 reported by Alex Valavanis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
jazzynico
inkscape (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: inkscape

Extensions with <check> tags in their *.inx files fail to load in inkscape_0.48.0-1ubuntu1. The same behaviour has also been observed in Inkscape 0.48 in Windows XP, but not in OS X.

This applies to the extensions txt2svg.inx and outline2svg.inx

To reproduce:

* Ensure all dependencies for the extensions are installed
* Start Inkscape
* Go to "File->Open..."
>> "Text File (*.txt)" does not appear in the list of available file types. (i.e. txt2svg.inx does not load)

[ follow-up report to bug #479944 ]

Related branches

Changed in inkscape:
importance: Undecided → Medium
status: New → Triaged
Changed in inkscape (Ubuntu):
importance: Undecided → Low
status: New → Triaged
su_v (suv-lp)
tags: added: extensions-plugins
description: updated
Revision history for this message
Alvin Penner (apenner) wrote :

just writing to confirm that this is a regression, on Windows. (This is a followup to the comment by Chris Mohler on Ubuntu at http://old.nabble.com/Text-import-extension-does-not-load-in-Ubuntu-td30084894.html

I have a machine with no Perl installed, so the extension won't work in any event; but, if I take a file, rename it to be Perl.exe and put it in the path, then on Inkscape 0.47 the file import type for Text Files shows up as it should. On 0.48 this trick does not work, so this is a regression.

Revision history for this message
su_v (suv-lp) wrote :

Oddly, not reproduced with Inkscape 0.48 and current trunk on Mac OS X 10.5.8:

The <check> command seems to be ignored, the extension is loaded whether the file to be checked exists or not. Normal dependency checking works as expected (see bug #479944, comment #11 and #12).

tags: added: regression
Revision history for this message
su_v (suv-lp) wrote :

Addendum to my previous comment: reproduced with a command line version build of trunk (r10014) on OS X 10.5.8 - apparently the '<check>' directive is ignored in the bundled version for osx.

Revision history for this message
jazzynico (jazzynico) wrote :

Fixed in the trunk, revision 10020.

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
milestone: none → 0.49
status: Triaged → In Progress
status: In Progress → Fix Committed
jazzynico (jazzynico)
tags: added: backport-proposed
Revision history for this message
su_v (suv-lp) wrote :

You patch now breaks it for osx-app bundled packages: the "Text file (*.txt)" is no longer listed in the 'File > Open…' dialog. A variant of the extension (with the <check> directive removed) is loaded from ~/.config/inkscape/extensions and listed as available file format.

Note that building inkscape with '--enable-osxapp' uses relative paths, see 'src/path-prefix.h'.

Tested and compared with r10017 and r10021 from <http://inkscape.modevia.com/macosx-snap/?C=M;O=D>

Revision history for this message
su_v (suv-lp) wrote :

> tags: added: backport-proposed

Not agreed - with the changes in r10020 the <check> directive now is simply ignored (tested by referring to a non-existent script), the same way as it was in earlier revisions in osxapp-enabled builds (see comment #2).

IMHO either this directive is removed from the extensions that have it (and remove related the related code), or <check> must be properly fixed. Possibly, since this is a regression in 0.48, the decision to address bug #505107 (win32-only) by cd'ing into the user extension directory (on all platforms) before launching the external process for a script file [1] broke parts of 'Script::check()' [2] in 'src/extension/impementation/script.cpp'.

[1] <https://bugs.launchpad.net/inkscape/+bug/551433/comments/7>
[2] <http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/annotate/head:/src/extension/implementation/script.cpp#L377>

Revision history for this message
su_v (suv-lp) wrote :

Addendum to previous comment:
tested with normal 'command line' (i.e. not osxapp-enabled) build (r10022) on OS X 10.5.8.

jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

The last patch was needed because the absolute path test was inverted [1]. It just removed the ! in the first test so that absolute paths pass the test as expected, and not relative ones. It was tested successfully on Windows XP and Ubuntu 10.10.
IMHO, removing the <check> in the INX files is a valid workaround. But I wonder what this <check> element is meant for. The extensions already have a <dependency> element that do almost exactly the same (but doesn't fail).

[1] Original script.cpp file, line 238:
    //Don't search when it is an absolute path. */
    if (!Glib::path_is_absolute(command)) {
        if (Glib::file_test(command, Glib::FILE_TEST_EXISTS)) {
            return true;
        } else {
            return false;
        }
    }

Revision history for this message
su_v (suv-lp) wrote :

> IMHO, removing the <check> in the INX files is a valid workaround.

Just tested with Inkscape 0.47 (osxapp-bundled version): while the presence of a <check> directive doesn't prevent an extension to be listed as available file format, it is ignored nevertheless - i.e. the extension is loaded and executed even if <check> refers to a not-existent script file (e.g. txt2foo.pl).

The <check> directive seems to have been 'broken' earlier. Still - I don't feel comfortable leaving broken code in the sources and removing code that exposes it.

> The last patch was needed because the absolute path test was inverted

To me, the current regression is that in 0.48 (possibly like the underlying cause for the regression in bug #551433), the code does not take into consideration that internally paths are not necessarily absolute - depending on configure options for the build (as defined in 'src/path-prefix.h' [1]) - maybe any tests in the 'src/extension/' code relying on this criteria might have to be reconsidered?

If you prefer, I can file a separate report about the regression in osxapp-enabled builds. I do think however that osxapp-enabled builds only expose issues that have been introduced elsewhere to fix the extension system on win32, and are not specific to the way extensions are executed when called from the bundled, self-contained and relocatable osx application.

[1] <http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/path-prefix.h>

Revision history for this message
jazzynico (jazzynico) wrote :

> maybe any tests in the 'src/extension/' code relying on this criteria might have to be reconsidered?

Thanks for your suggestions!

Some tests with a fake relative value confirm that the issue is due to the fact that the script checks the PATH environment variable only. Adding INKSCAPE_EXTENSIONDIR (from path-prefix.h) to the checked paths seems to solve the bug.

Commit planned later today.

Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 10023.
Please test and comment!

Changed in inkscape:
status: In Progress → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

Testing r10035 with bundled osxapp version (local build):

Extensions from the shared extension folder:
- if <check> points to an existing script file in the shared extensions folder (txt2svg.inx -> txt2svg.pl), the extension is not loaded and not listed in the 'File > Open…' dialog
- if <check> points to a non-existing script file in the shared extension folder (txt2foo.pl), the extension is loaded, listed, and the script referenced in the <command> directive is executed
- if the <check> directive is removed from the INX file, the extension is loaded, listed and the script referenced in the <command> directive is executed.

Extensions from the user extensions folder:
- if <check> points to an existing script file in the user extensions folder, the extension is loaded, listed in the 'File > Open…' dialog and the script referenced in the <command> directive is executed
- if <check> points to a non-existing script file in the shared extension folder (txt2foo.pl), the extension is loaded, listed, and the script referenced in the <command> directive is executed
- if the <check> directive is removed from the INX file, the extension is loaded, listed and the script referenced in the <command> directive is executed.

-> it seems that your last change does not work for current extensions using the 'check>' directive that are distributed and installed with Inkscape in the shared extension folder, if inkscape was configured, built and packaged as osxapp.

AFAICT '<check>' is still broken, but I'll wait to confirm the tests with an official development snapshot build for osx as soon as it is available from <http://inkscape.modevia.com/macosx-snap/?C=M;O=D>

Revision history for this message
jazzynico (jazzynico) wrote :

New fix committed in the trunk, revision 10038.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Backported to lp:inkscape/0.48.x r9858

Changed in inkscape:
milestone: 0.49 → 0.48.3
tags: removed: backport-proposed
Ted Gould (ted)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package inkscape - 0.48.3-0ubuntu1

---------------
inkscape (0.48.3-0ubuntu1) precise; urgency=low

  * New upstream release (LP: #933188). Fixes several Ubuntu bugs:
    - inkscape fails to build with glib 2.31 (LP: #898538)
    - ctrl c ctrl v of text in edit mode crashes inkscape (LP: #496793)
    - Completely replace lcms1 by lcms2 in Ubuntu (LP: #885324)
    - parameters ending with '\' causes python to bomb (LP: #168417)
    - Extensions with <check> tags fail to load (LP: #668895)
    - ESC doesn't cancel move when using the Node Tool (LP: #788560)
    - unable to edit attributes in Inkscape XML Editor (LP: #884368)
    - Some layers should be visible by default in Layers dialog (LP: #902054)
    - Path Effect List is hidden (LP: #909958)
    - Input Devices > Hardware > Tree of devices is hidden (LP: #910467)
    - Glyphs Font styles are hidden (LP: #911079)
    - Error messages from Extensions hidden (LP: #911079)
    - Messages dialog doesn't work (LP: #911123)
  * Drop 02-add-shebangs-and-fix-permissions.dpatch: Applied upstream.
  * Drop build-dependency on specific libwpd/libwpg version.
 -- Alex Valavanis <email address hidden> Thu, 16 Feb 2012 14:33:40 +0000

Changed in inkscape (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.