Re: Old 0install can't run an alias created by a newer version

Thomas Leonard <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <CAG4opy-61qKx9zV_dzEX=BG7w=B2AuHqs-3EfMCtXjD-uPGm2Q@mail.gmail.com>
On 20 May 2015 at 01:06, Tim Cuthbertson <[email protected]> wrote:
> I'm mostly using the development ocaml version on my own machine. But
> sometimes I end up running a released python (or even ocaml) version.
> Unfortunately, this means I can't run any of my newer aliases, as I get:
>
> Traceback (most recent call last):
>   File "/home/tim/dev/0install/zi-stable/0install", line 14, in <module>
>     main(sys.argv[1:])
>   File "/home/tim/dev/0install/zi-stable/zeroinstall/cmd/__init__.py", line
> 381, in main
>     cmd.handle(config, options, args)
>   File "/home/tim/dev/0install/zi-stable/zeroinstall/cmd/run.py", line 39,
> in handle
>     r = app.get_requirements()
>   File "/home/tim/dev/0install/zi-stable/zeroinstall/apps.py", line 389, in
> get_requirements
>     setattr(r, k, v)
> AttributeError: 'Requirements' object has no attribute 'may_compile'
>
>
> I guess this is my fault for running multiple versions of 0install, but
> that's actually difficult to avoid sometimes. In some cases I end up inside
> a shell (e.g 0env) which is making use of the old python ZeroInstall.xml
> feed, so the python 0install ends up on my path. In other cases, I run the
> released version of 0install (e.g on my mac laptop) but I have a single
> ~/.config/0install/ that I share between machines via a git repo.
>
>
> I'm not sure what should be done about this. Some options:
>
> 1) only save requirement flags which are explicitly specified at creation
> time, and rely on the defaults for other flags
>
> 2) ignore requirement keys which we don't understand, for forwards
> compatibility.
>
> (1) is probably harder, but (2) opens us up to silently ignoring important
> requirements. So I'd vote for (1).

(1) sounds right to me too. Looks like we already do it for some of
the options (e.g. --os):

https://github.com/0install/0install/blob/d9c8219d603176a77d2650322f7054463b1c58c6/ocaml/zeroinstall/requirements.ml#L102


-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
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.