Re: 0Compile Gnu Hello example doesn't work on windows

Thomas Leonard <[email protected]> Sat, 15 Dec 2018 15:53:43 +0000
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <CAG4opy_z7SrRQ6rgOwjJ_6_JqbrfJCeXkm+E779SWFM0U8MFqA@mail.gmail.com>
On Tue, 11 Dec 2018 at 18:12, Bastian Eicher <[email protected]> wrote:
>
> 0compile internally calls "0install fetch" on Windows, to delegate downloading and extracting archives back to the C# implementation, which handles stuff like NTFS ACLs.
>
>  The regular archive extraction code in Zero Install for Windows automatically guesses the MIME type of an archive based on its file ending if it is not specified (like the Linux version does). However, this "guessing code" is not executed on "0install fetch". I've fixed that and will publish a new release of Zero Install for Windows soon.
>
> Running "0compile autocompile http://0install.net/tests/GNU-Hello.xml" on my machine with a pre-release build containing this fix I get the following stack trace:
>
> Traceback (most recent call last):
>   File "(...0install...)\zeroinstall\injector\selections.py", line 443, in download
>     tasks.check(fetch_impls)
>   File "(...0install...)\zeroinstall\support\tasks.py", line 161, in check
>     for b in blockers:
> TypeError: 'NoneType' object is not iterable
>
> @Thomas: Any ideas what could be going wrong here?

Selections.download_missing does:

  fetch_impls = config.fetcher.download_impls(needed_impls, stores)
  yield fetch_impls
  tasks.check(fetch_impls)

It expects download_impls to return a blocker, but Fetcher.download_impls does:

  if self.external_fetcher:
    self._download_with_external_fetcher(implementations)
    return None

It's trying to check None to see if it failed, and crashes. Assuming
_download_with_external_fetcher succeeded, it will probably work if
you try again!

Wrapping that call to check in an "if" should fix it.


-- 
talex5 (GitHub/Twitter)        http://roscidus.com/blog/
GPG: 5DD5 8D70 899C 454A 966D  6A51 7513 3C8F 94F6 E0CC