Bindings not picked up from dependency <command>

Tim Cuthbertson <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <CAC-LLDjXLn2PCB0HXH1JGFrgcbR13SGHMGCk_D5Xg6HQN7UFsw@mail.gmail.com>
0install doesn't seem to be picking up bindings from <command>
dependencies. This seems like a bug, although it's possible commands
aren't intended to be used for what I'm trying to do.

Specifically, I provide <command>s which aren't really commands, but
are more just extra bindings. As an example:

http://gfxmonk.net/dist/0install/edit-server.xml

contains (right down the bottom):

    <command name="systemd-unit" path="edit-server">
      <environment insert="xdg/config" mode="prepend" name="XDG_CONFIG_DIRS"/>
      <runner interface="http://repo.roscidus.com/python/python"/>
    </command>

The intent is not to run this directly, but to depend on it as
<requires command="systemd-unit" .... />, and you'll inherit the
appropriate environment variables to make this service available in a
user systemd session.

While the XDG_CONFIG_DIRS binding is applied when running a command
directly, running a feed which depends on this command causes the
command-specific binding to be ignored:

$ 0install run --wrapper='env #' --command systemd-unit
http://gfxmonk.net/dist/0install/edit-server.xml | grep XDG_CONFIG
XDG_CONFIG_DIRS=/home/tim/.cache/0install.net/implementations/sha256new_XVAFKEINOAZS2BZN3CL2G2AMWZ3LO5CGG2FY2FTMH7HHSNEOWAOA/xdg/config:/etc/xdg

$ touch intentionally_blank
$ cat tmp.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='interface.xsl'?>
<interface xmlns="http://zero-install.sourceforge.net/2004/injector/interface">
    <name>test</name>
    <summary>test</summary>
    <description>
    </description>

    <group>
        <requires
interface="http://gfxmonk.net/dist/0install/edit-server.xml"
command="systemd-unit"/>
        <command name="run" path="intentionally_blank"/>
    <implementation id="." version="1"/></group>

</interface>

$ 0install run --wrapper='env #' tmp.xml | grep XDG_CONFIG
(no output)



If this is a feature (rather than a bug), is there some way to provide
a set of opt-in bindings by name, rather than requiring the user write
these themselves? I've always been a little uncomfortable with
requiring users to write bindings which depend on the directory
structure of my implementation, but I can also see this being very
important for opt-in feature sets which export a handful of
environment variables (which becomes very fragile if you need to
duplicate multiple bundings in every feed which requires the given
feature).

Cheers,
 - Tim.

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.