Permission denied

Hi,

I installed Rust on EndeavourOS using the rustup-method (rather than an Arch package). Everything seems to go well but when I later try to run cargo (or rather anything pointing to rustup) I get "Permission denied".

All binaries are installed in ./cargo/bin in my home directory. I am the owner of all files under .cargo and all dotfiles in the my home directory.

Check $PATH I find that /home/me/.cargo/bin is in there.
Checking the zsh-config files I notice that the line . "$HOME/.cargo/env" is there, e.g. in the file .zshenv.

So to me everything looks fine, what am I missing?

Are you sure you are executing the correct cargo binary? You can check it using which or command -v. Also check if the binaries have the executable bit set.

If I do "which cargo" I get an empty reply, while cargo -v also gives "Permission denied".
And yes they all have the x-bit set.

Have you installed it with the user's privileges (aka without sudo)? Check also the file's owner.

Yes, everything is my user.

Checking again running it under sudo I get

╰─ sudo cargo -v
[sudo] lösenord för me:
sudo: cargo: kommandot hittades inte (command not found)

You shouldn't use sudo for this. Also, an empty which cargo output is weird. Can you show the output of type -a cargo ?

echo $PATH
/home/me/.atuin/bin:/home/me/.cargo/bin: [etc]

type -a cargo
cargo not found

type -a .cargo/bin/cargo
.cargo/bin/cargo not found

type -a .cargo/bin/rustup
.cargo/bin/rustup not found

Very strange ...

I expect you have home mounted noexec or some other security block.

Show your console log, otherwise it's difficult to tell.

Yes!! That must be it ... It's new-ish. My home directory is noexec, with a few exceptions. I'll make one for .cargo and see if that helps ...

Well, .cargo was set exec. But .rustup wasn't - setting it exec solved the issue.

Thank you for following up.