Re: Weird errors when playing with 0compile
"Bastian Eicher" <[email protected]> Mon, 13 Jun 2022 15:55:01 +0200
| Newsgroups | gmane.comp.file-systems.zero-install.devel |
|---|---|
| Message-ID | <[email protected]> |
@Thomas: Thanks for the hint! @Mateusz: I've released a new version of the 0install Python library to fix this. You can get it by running "0install update 0compile". You'll also need to replace sha1=1d53a96ee896dfae8d84a2e02fceae2dfac54aaa with sha1new=9f9a18b1b73435001e2351664c98e528b532ce2c in pikchr.xml because Zero Install for Windows does not support the old sha1 digest format anymore. After making these changes "0compile autocompile pikchr.xml" ran successfully on my machine. Regards Bastian -----Original Message----- From: Thomas Leonard <[email protected]> Sent: Samstag, 11. Juni 2022 16:51 To: The Zero Install system <[email protected]> Subject: Re: [Zero-install-devel] Weird errors when playing with 0compile On Mon, 6 Jun 2022 at 12:06, Bastian Eicher <[email protected]> wrote: > > Hi Mateusz, > > I just gave it a try and can reproduce the same error on my machine. > > On Windows tools like 0compile and 0template internally call "0install fetch" and pass via stdin a partial feed containing implementations to be downloaded. > The relevant code is here: > https://github.com/0install/0install/blob/b2.3/zeroinstall/injector/fe > tch.py#L697-L715 > In this case the feed XML being passed looks like this:> <interface > xmlns="http://zero-install.sourceforge.net/2004/injector/interface"> [...] > <ns0:implementation arch="Windows-x86_64"> > <command name="run" path="pikchr.exe"/> > </ns0:implementation> > </command> > > <ns0:implementation> seems to be the problem here. This is the implementation that 0compile wants to build, so there is nothing to download. Also, the "ns0" XML prefix is undeclared, causing "0install fetch" to reject the feed. > > @Thomas Can we prevent 0compile from including the implementation being built in the list of fetched implementations? It's not asking for it to be fetched - that's why it's in a different namespace. > I don't quite understand where the "ns0" XML prefix is coming from. _download_with_external_fetcher is using Prefixes to collect a list of prefixes it needs to define, but then it never adds them to the document! See Selections.toDOM for how to do that. From the command-line it works. With the old Python version, I get: $ ./0install select --xml --os=Windows --source ./pikchr.xml <?xml version="1.0"?> <selections xmlns="http://zero-install.sourceforge.net/2004/injector/interface" xmlns:ns0="http://zero-install.sourceforge.net/2006/namespaces/0compile" interface="/tmp/pikchr.xml" command="compile"> [...] <ns0:implementation arch="Windows-x86_64"> <command name="run" path="pikchr.exe"/> </ns0:implementation> (i.e. it uses ns0, but defines it at the start) With the current OCaml version, I get: $ 0install select --xml --os=Windows --source ./pikchr.xml <?xml version="1.0" encoding="UTF-8"?> <selections command="compile" interface="/tmp/pikchr.xml" source="true" xmlns:compile="http://zero-install.sourceforge.net/2006/namespaces/0compile" xmlns="http://zero-install.sourceforge.net/2004/injector/interface"> [...] <compile:implementation arch="Windows-x86_64"> <command name="run" path="pikchr.exe"/> </compile:implementation>