ugexe / zef

Raku Module Management
Artistic License 2.0
206 stars 44 forks source link

Use of uninitialized value @short-names-to-index in Zef::Repository::Ecosystems line 250 #551

Closed rcmlz closed 5 months ago

rcmlz commented 5 months ago

When using zef/Raku from NixOS I get the following warning when installing a new module

Use of uninitialized value @short-names-to-index of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in block  at /nix/store/wwjsk0c7id1wjg72kh3mhiqf2bjsnb1m-zef-0.21.0/sources/7B8C4765AC0B50F3E076BE3378DD767C55081947 
(Zef::Repository::Ecosystems) line 250

This can be reproduced by running

nix-shell --pure raku.nix

assuming that raku.nix is a file containing this minimal configuration: (use something else for testing than Jupyter::Chatbook if that is already installed)

with (import <nixpkgs> {});

let
    envShellHooks = ''
        export ZEF_FETCH_DEGREE=4
        export ZEF_TEST_DEGREE=4
        ''
    ;

    runShellHooks = ''
        raku -v
        zef list --installed
        zef --debug install Jupyter::Chatbook
        ''
    ;

    allShellHooks = envShellHooks + runShellHooks;

    basePackages = [
        rakudo
        zef

        stdenv
        openssl
        cacert
        git
        curl
        wget
    ];

in mkShell {
  buildInputs = basePackages;
  shellHook = allShellHooks;
}

I get the output

[rcmlz@nixos:~/Documents/jupyter-chatbook]$ nix-shell --pure resources/raku.nix 
Welcome to Rakudo™ v2023.08.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2023.09.
===> Found via inst#/nix/store/ihk8brpm5p564kfb0yhivsjrqhri3mcp-rakudo-2023.08/share/perl6/core
rakudo:ver<2023.08>:auth<Yet Another Society>
===> Found via inst#/nix/store/wwjsk0c7id1wjg72kh3mhiqf2bjsnb1m-zef-0.21.0
zef:ver<0.21.0>:auth<github:ugexe>:api<0>
===> Found via inst#/home/rcmlz/.raku
File::Find:ver<0.2.1>:auth<zef:raku-community-modules>
JSON::Fast:ver<0.19>:auth<cpan:TIMOTIMO>
JSON::Marshal:ver<0.0.25>:auth<zef:jonathanstowe>:api<1.0>
JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
===> Searching for: Jupyter::Chatbook
Use of uninitialized value @short-names-to-index of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in block  at /nix/store/wwjsk0c7id1wjg72kh3mhiqf2bjsnb1m-zef-0.21.0/sources/7B8C4765AC0B50F3E076BE3378DD767C55081947 (Zef::Repository::Ecosystems) line 250
Use of uninitialized value @short-names-to-index of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in block  at /nix/store/wwjsk0c7id1wjg72kh3mhiqf2bjsnb1m-zef-0.21.0/sources/7B8C4765AC0B50F3E076BE3378DD767C55081947 (Zef::Repository::Ecosystems) line 250
===> Found: Jupyter::Chatbook:ver<0.2.5>:auth<zef:antononcube>:api<1> [via Zef::Repository::Ecosystems<rea>]
...
etc.
ugexe commented 5 months ago

I think you just need to update zef to v0.20.1 -- see: https://github.com/ugexe/zef/pull/544

rcmlz commented 5 months ago

Indeed, using the most recent version did the trick.

NixOS currently has zef:ver<0.21.0>:auth<github:ugexe>:api<0>, when manually installing from github the latest version zef:ver<0.21.4>:auth<github:ugexe>:api<0> warnings disappear.