Running rmadison from strict snap exits non zero

I have a strict snap [1] built and partially working but when rmadison is run I get the following error.

[ERROR] Error querying rmadison: Command '['rmadison', '-a', 'source', '-s', 'artful-proposed', 'linux']' returned non-zero exit status 2
rmadison: you must have the liburi-perl package installed
to use this script

I have confirmed that I do have network access and there is nothing in sudo /snap/bin/snappy-debug.security scanlog ubuntu-watch-packages.

I have added liburi-perl as a stage-package but I get the same error.

When running /snap/bin/ubuntu-watch-packages --help which doesn’t call rmadison it works fine and when built and installed as classic snap it works fine too.

Thanks,

Phil

[1] https://github.com/philroche/ubuntu-watch-packages

perl is a bit ugly to snap, you somehow need to add the path the liburi-perl module is in to the perl search path ( @INC ) …

probably via a wrapper …

Agreed, for get-iplayer (a perl application) I used an environment section under the apps: stanza to achieve this without a wrapper. Like this.

apps:
  get-iplayer:
    environment:
        LC_ALL: "C.UTF-8"
        PERL5LIB:  "$SNAP/usr/lib/x86_64-linux-gnu/perl-base/:$SNAP/usr/lib/x86_64-linux-gnu/perl5/5.22/:$SNAP/usr/share/perl5/:$SNAP/usr/share/perl/5.22.1/:$SNAP/usr/lib/x86_64-linux-gnu/perl/5.22/:$SNAP/usr/lib/x86_64-linux-gnu/perl/5.22.1/"
        LD_LIBRARY_PATH: "$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio/:$LD_LIBRARY_PATH"
        HOME: "$SNAP_USER_COMMON"
    command: get_iplayer
    plugs:
      - network                                                                                                                                                                              
      - removable-media                                                                                                                                                                      
      - home   
1 Like

Not to counteract on the part where people help on resolving how to get things done in perl, but why not call the API directly.

We do it here

It is just an HTTP GET like http://people.canonical.com/~ubuntu-archive/madison.cgi?package=hello&a=&c=&s=&text=on

@popey Thanks. I did get something working by setting the PERL5LIB var but rmadison was requesting access to /etc/wgetrc too.

@sergiusens Excellent, much simpler. Thank you