Extensions check for Perl dependencies

Bug #479944 reported by Martin Schmettow
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Medium
Unassigned
inkscape (Ubuntu)
Won't Fix
Low
Unassigned

Bug Description

Binary package hint: inkscape

Importing a text file into inkscape fails with the following error message:
Can't locate SVG.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/share/inkscape/extensions/txt2svg.pl line 6.
BEGIN failed--compilation aborted at /usr/share/inkscape/extensions/txt2svg.pl line 6.

Maybe a dependency problem?

ProblemType: Bug
Architecture: i386
Date: Tue Nov 10 12:06:00 2009
DistroRelease: Ubuntu 9.10
Package: inkscape 0.47~pre4-0ubuntu1
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: inkscape
Uname: Linux 2.6.31-14-generic i686

Revision history for this message
Martin Schmettow (schmettow) wrote :
Erik Kronberg (eakron)
Changed in inkscape (Ubuntu):
status: New → Confirmed
su_v (suv-lp)
tags: added: extensions-plugins
Revision history for this message
su_v (suv-lp) wrote :

reproduced with Inkscape 0.46 and Inkscape 0.47+devel r8898 on OS X 10.5.8

The perl script 'extensions/txt2svg.pl' depends on the SVG module which is not included in the default Perl installation on OS X.

SVG - Perl extension for generating Scalable Vector Graphics (SVG) documents
<http://search.cpan.org/search%3fmodule=SVG>

tags: added: packaging
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Wolf (drechsel) wrote :

me too on Mac OS X 10.4.11

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

Sorry if I'm being stupid, but I'm not aware of how to import *.txt files. The file type is not listed in the "File->Import..." or "File->Open..>" dialogs.

Attempting to open/import a txt file by using "All Files" from either of these dialogs just gives me a dialog with the message: "Failed to load the requested file /home/alex/Documents/Text/text.txt"

On a separate note, Ubuntu already Suggests libsvg-perl, which adds SVG.pm and fixes the problem in comment #2. The ideal solution would be to bump this up to "Recommends" status so that it is automatically installed along with Inkscape. However, this is not possible because Inkscape is a "main" package (i.e. officially supported) while libsvg-perl is a "universe" package (i.e. community supported).

Changed in inkscape (Ubuntu):
importance: Undecided → Low
Changed in inkscape:
importance: Undecided → Medium
Changed in inkscape (Ubuntu):
status: Confirmed → Incomplete
Changed in inkscape:
status: Confirmed → Incomplete
Revision history for this message
su_v (suv-lp) wrote :

> I'm not aware of how to import *.txt files. The file type is not listed in
> the "File->Import..." or "File->Open..>" dialogs.

If the file type is not listed, one of the dependencies in 'txt2svg.inx' is not fulfilled:

    <dependency type="executable" location="extensions">txt2svg.pl</dependency>
    <dependency type="executable" location="path">perl</dependency>

i.e. either the extension script is missing (incomplete installation?), or Inkscape cannot find 'perl' in your $PATH?

related files in the 0.48.x branch:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_48_BRANCH/annotate/head%3A/share/extensions/txt2svg.inx>
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_48_BRANCH/annotate/head%3A/share/extensions/txt2svg.pl>

Please check the contents of '~/.config/inkscape/extension-errors.log' if it gives any clues why the extension fails to load.
Is the perl script set as 'executable' in your installation (/usr/share/inkscape/extensions/txt2svg.pl)?

Changed in inkscape:
status: Incomplete → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

> The file type is not listed in the "File->Import..."
> or "File->Open..>" dialogs.

The file type is listed as "Text File (*.txt)" (quite far down in the list) if the extension is loaded; see line 10 in the extension definition file (txt2svg.inx):

        <_filetypename>Text File (*.txt)</_filetypename>

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

Curious (see below). Maybe I should open this as a new bug.

* perl is installed in /usr/bin (which is in my $PATH)
ls -l /usr/bin/perl
-rwxr-xr-x 2 root root 1240796 2010-07-12 12:42 /usr/bin/perl

* txt2svg.pl is executable
ls -l /usr/share/inkscape/extensions/txt2svg.pl
-rwxr-xr-x 1 root root 649 2010-10-19 02:25 /usr/share/inkscape/extensions/txt2svg.pl

* extension-errors.log does not mention anything about the extension
Extension "XFIG Input" failed to load because a dependency was not met.
Dependency:
  type: executable
  location: path
  string: fig2dev

Extension "Sketch Input" failed to load because a dependency was not met.
Dependency:
  type: executable
  location: path
  string: skconvert

Extension "Dia Input" failed to load because a dependency was not met.
Dependency:
  type: executable
  location: path
  string: dia
  description: In order to import Dia files, Dia itself must be installed. You can get Dia at http://live.gnome.org/Dia

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

(emailed inkscape-devel for debugging assistance)

Revision history for this message
Alvin Penner (apenner) wrote :

confirmed on Windows XP, Inkscape .48. I have Perl installed, but no .txt file extension available as an import. The workaround is to delete the following line from the file txt2svg.inx:

<check reldir="extensions">txt2svg.pl</check>

With the new inx file the .txt extension appears just below the sk1 extension. When I now try to load a .txt file I get the message:

Can't locate SVG.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at txt2svg.pl line 6.
BEGIN failed--compilation aborted at txt2svg.pl line 6.

This could be fixed by installing the SVG module, which I don't feel like doing.

Revision history for this message
Alvin Penner (apenner) wrote :

fwiw, there appear to be only 2 extensions that use the command <check reldir .
They are both perl extensions. The other one is called outline2svg.pl

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

> The workaround is to delete the following line from the file txt2svg.inx:
  <check reldir="extensions">txt2svg.pl</check>
> With the new inx file the .txt extension appears just below the sk1 extension.

In Inkscape 0.48 and 0.48+devel r9862 on OS X 10.5.8 I do see both file types listed in the 'File open' dialog _without_ changing any line of the extension definition files (outline2svg.inx, txt2svg.inx). (Yes, I removed the user extensions directory before testing, and checked the shared extensions directory for duplicate file types).

Possibly the <check reldir="…></check> fails on Windows?

The extensions fail with the same error message as initially reported because SVG.pm is not installed on the system.

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

> Possibly the <check reldir="…></check> fails on Windows?

Maybe it is the other way round and the command <check …></check> "fails" on OS X?
Changing it to (non-existent)
        <check reldir="extensions">txt2foo.pl</check>
doesn't prevent the extension from being loaded on OS X -- i.e. the <check> command seems completely ignored and the input file format for *.txt listed anyway in the 'File open' dialog.

Changing the dependency check (to non-existent)
    <dependency type="executable" location="extensions">txt2foo.pl</dependency>
prevents the extension from loading though (file type not listed).

Revision history for this message
Alvin Penner (apenner) wrote :

I think my inclination would be to permanently remove the line
<check reldir="extensions">txt2svg.pl</check>
from both of these extensions, unless someone has a specific reason for it to be there. I have a machine with no perl installed on it, and in this case the dependence on perl is caught properly by the line
<command reldir="extensions" interpreter="perl">txt2svg.pl</command>
which is the "normal" check that essentially all .inx files have. (I deleted the line <check reldir> and confirmed that the extensions-log file still showed that the perl dependency was not met.)

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

> I think my inclination would be to permanently remove the line
> <check reldir="extensions">txt2svg.pl</check>

As a workaround maybe, once it is confirmed that the same line prevents the extension from being loaded not only on Windows, but on Linux too. However - if so, it means there is broken code in the extension system and just removing what calls it doesn't really address the issue imho.

I'd rather see it investigated code-wise what broke that <check> feature (and why the result differs across platforms), have it fixed or removed in the source and after that all inx files updated correspondingly.

Revision history for this message
Chris Mohler (cr33dog) wrote :

Commenting out that line (<check> tag) allows the extension to load on linux (Ubuntu 10.04).

As noted above a quick search only turns up 2 extensions using that tag:

/opt/inkscape-0.48/share/inkscape/extensions$ grep -RHin "<check" .
./txt2svg.inx:15: <check reldir="extensions">txt2svg.pl</check>
./outline2svg.inx:15: <check reldir="extensions">outline2svg.pl</check>

The second extension - outline2svg - also does not load unless the <check> tag is commented out. Again nothing in the extension-errors log for that one either.

So - there are two issues: 1. the ubuntu package needs a dependency on libsvg-perl, and 2. something is not working correctly in Inkscape's handling of the <check> tag.

IMO this bug would be fixed by addressing #1 and a separate bug should be opened against Inkscape for #2.

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

Thanks to everyone for your work on this. While the upstream work is being carried out, I'll prepare a new package for Ubuntu with the "<check>" tags removed.

We already have the relationship "inkscape suggests libsvg-perl" in Ubuntu. Unfortunately, we can't change it to "inkscape recommends libsvg-perl" which would automatically install libsvg-perl. This is because inkscape is in the main repository (i.e. officially supported by Canonical) but libsvg-perl is in the universe repository (i.e. community supported).

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

To avoid confusion, I will open a separate report to deal with the failure to load extensions with <check> tags.

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

New report opened as bug #668895 to deal with the <check> tags issue

Changed in inkscape (Ubuntu):
status: Incomplete → Triaged
Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Marking this as "Won't Fix" in Ubuntu, for the reasons previously discussed. Unfortunately, the required perl module is community-supported and cannot be installed automatically.

Changed in inkscape (Ubuntu):
status: Triaged → Won't Fix
Revision history for this message
jazzynico (jazzynico) wrote :

Bug #668895 fixed in the trunk, revision 10020.

But the extension still doesn't work if the required Perl modules (strict, etc.) are not installed.

Revision history for this message
jazzynico (jazzynico) wrote :

Closely related: Bug #174992 "Extensions check for Python dependencies"
<https://bugs.launchpad.net/inkscape/+bug/174992>

summary: - import of text file fails
+ Extensions check for Perl dependencies
tags: removed: packaging
Revision history for this message
Jonathan Hofinger (jhofinger) wrote :

Closing because there are no perl extensions shipped with Inkscape anymore, starting with Inkscape 1.0.

Closed by: https://gitlab.com/jhofinger

Changed in inkscape:
status: Triaged → Invalid
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.