Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home cannot be used as project folder #401

Open
kuisathaverat opened this issue Apr 12, 2024 · 2 comments
Open

Home cannot be used as project folder #401

kuisathaverat opened this issue Apr 12, 2024 · 2 comments

Comments

@kuisathaverat
Copy link

I recently used Hermit in a Docker container to make it easy to install the tools I need for that container. I use a python:3.11 Docker container as a base, and I need to install some cloud tools. I found (in the hard way) that you can not use the user's HOME as a project directory; there is some issue with the hermit command.

If you execute the following command you can replicate the issue:

docker run -it --rm --entrypoint=/bin/bash python:3.11

curl -fsSL https://github.com/cashapp/hermit/releases/download/stable/install.sh | /bin/bash
export PATH=$HOME/bin:$PATH
hermit init $HOME
. /root/bin/activate-hermit

You will hit the following error

fatal:hermit: binary is not a Hermit symlink: /root/bin/hermit

Solution, do not use HOME for init hermit:

docker run -it --rm --entrypoint=/bin/bash python:3.11

curl -fsSL https://github.com/cashapp/hermit/releases/download/stable/install.sh | /bin/bash
export PATH=$HOME/bin:$PATH

TOOLS_DIR=$HOME/tools
PATH=$TOOLS_DIR/bin:$PATH
mkdir -p $TOOLS_DIR
hermit init $TOOLS_DIR
. $TOOLS_DIR/bin/activate-hermit

I just opened an issue to make a record of it for people who hit the same issue. Feel free to close it if it is not relevant.

@alecthomas
Copy link
Collaborator

There's nothing in Hermit that would prevent this, I have done it myself in the past, so it's likely something strange with how the machine is configured.

fatal:hermit: binary is not a Hermit symlink: /root/bin/hermit

What does ls -l /root/bin/hermit show?

@kuisathaverat
Copy link
Author

kuisathaverat commented Apr 12, 2024

What does ls -l /root/bin/hermit show?

root@e3d3cd13d5a7:/# ls -l /root/bin/hermit
lrwxrwxrwx 1 root root 13 Apr 12 11:33 /root/bin/hermit -> hermit-stable

Full sequence of command with output

> docker run -it --rm --entrypoint=/bin/bash python:3.11
root@6a182124564d:/# curl -fsSL https://github.com/cashapp/hermit/releases/download/stable/install.sh | /bin/bash
Creating /root/.cache/hermit/pkg/hermit@stable
Downloading https://github.com/cashapp/hermit/releases/download/stable/hermit-linux-amd64.gz to /root/.cache/hermit/pkg/hermit@stable/hermit
Hermit installed as /root/.cache/hermit/pkg/hermit@stable/hermit
NOTE: /root/bin should be added to your $PATH if it is not already
Hermit is installed as /root/bin/hermit

See https://cashapp.github.io/hermit/usage/get-started/ for more information.

root@6a182124564d:/# 
root@6a182124564d:/# 
root@6a182124564d:/# export PATH=$HOME/bin:$PATH
root@6a182124564d:/# hermit init $HOME
info: Creating new Hermit environment in /root
info:   -> /root/bin/README.hermit.md
info:   -> /root/bin/activate-hermit
info:   -> /root/bin/hermit
info:   -> /root/bin/hermit.hcl
info: 

Hermit environment initialised in /root

To activate the environment run:

  . /root/bin/activate-hermit

Then run the following to list available commands:

  hermit --help

To deactivate the environment run:

  deactivate-hermit

For more information please refer to https://github.com/cashapp/hermit

root@6a182124564d:/# 
root@6a182124564d:/# 
root@6a182124564d:/# . /root/bin/activate-hermit
fatal:hermit: binary is not a Hermit symlink: /root/bin/hermit

spicykay pushed a commit to spicykay/hermit that referenced this issue Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants