'Where does the $*REPO dynamic variable obtain its values, and how to change/alter them?

This question is complementary to figuring out why this error (which started as a zef error) occurs.

Apparently, in certain circumstances the repository chain accessible from $*REPO may vary. Namely, in a GitHub action such as this one, where raku is part of a Docker image, all of a sudden the repository chain becomes:

(inst#/github/home/.raku inst#/usr/share/perl6/site inst#/usr/share/perl6/vendor inst#/usr/share/perl6/core ap# nqp# perl5#)

The first directory does not actually exist; this should be /home/raku/.raku instead. So a couple of questions

  1. Why does rakudo install that unexisting directory as part of the repository chain
  2. Is there any workaround that allows to simply change that value to the right one?

I don't really understand what's the cause for this happening. Initializing the container involves a long command line like this one:

/usr/bin/docker create --name d043d929507d4885927ac95002160d52_jjmereloalpinerakugha202110_1e6e32 --label 6a6825 --workdir /__w/p6-pod-load/p6-pod-load --network github_network_da048828784a46c3b413990beeaed866  -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/runners/2.285.1/externals":"/__e":ro -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" jjmerelo/alpine-raku:gha-2021.10 "-f" "/dev/null"

Where, effectively there seems to be an environment variable set to that value. So it might be that the environment variable HOME is the one that determines that, instead of whatever happened in the installation. But I don't know if that's a feature, or a bug.



Solution 1:[1]

Why does rakudo install that unexisting directory as part of the repository chain

Because you set $HOME to that directory. Unsurprisingly the home repository references $HOME.

Is there any workaround that allows to simply change that value to the right one?

This doesn't need to be worked around, rather your environment needs to be setup properly. It appears you change $HOME to a non-existent directory, try to get zef to install to this new directory implicitly (which even if it did exist it probably wouldn't have permissions without you having done so), and when that failed you installed to /home/raku explicitly and wonder why your raku environment with a /github/home home directory/repo doesn't look in /home/raku (and how could it?). My suggestion is to figure out your file permission issues when you setup the new $HOME directory.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1