Re: Old 0install can't run an alias created by a newer version
Tim Cuthbertson <[email protected]>
| Newsgroups | gmane.comp.file-systems.zero-install.devel |
|---|---|
| Message-ID | <CAC-LLDg66+KOL+x9-v8F4jQd=P1_eSwG9P19qDqHeyDPE0tHsA@mail.gmail.com> |
On Sat, May 23, 2015 at 7:41 PM, Thomas Leonard <[email protected]> wrote: > 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 > > Cool, I've extended this to make the the may_compile attribute optional as well. PR is here: https://github.com/0install/0install/pull/38 Cheers, - Tim. ------------------------------------------------------------------------------ _______________________________________________ Zero-install-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/zero-install-devel