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

Rye doesn't install from curl command when /tmp is mounted NOEXEC #392

Closed
bschonec opened this issue Jul 27, 2023 · 4 comments
Closed

Rye doesn't install from curl command when /tmp is mounted NOEXEC #392

bschonec opened this issue Jul 27, 2023 · 4 comments

Comments

@bschonec
Copy link

Steps to Reproduce

curl -sSf https://rye-up.com/get | bash

curl -sSf https://rye-up.com/get | bash
This script will automatically download and install rye (latest) for you.
######################################################################## 100.0%
bash: line 71: /tmp/.ryeinstall.KIbkIc8X: Permission denied

/tmp is mounted NOEXEC

Changing /tmp to EXEC fixes the issue.

nobody@dev-01d:~/$ sudo mount -o remount,exec /tmp
nobody@dev-01d:~/$ curl -sSf https://rye-up.com/get | bash
nobody@dev-01d:~/$ RUST_BACKTRACE=1  curl -sSf https://rye-up.com/get | bash
nobody@dev-01d:~/$ curl -sSf https://rye-up.com/get | bash
This script will automatically download and install rye (latest) for you.
######################################################################## 100.0%
Welcome to Rye!

This installer will install rye to /home/nobody/.rye
This path can be changed by exporting the RYE_HOME environment variable.

Details:
  Rye Version: 0.11.0
  Platform: linux (x86_64)

Continue? [y/n] 

Expected Result

Rye installs

Actual Result

Rye install fails because /tmp is mounted NOEXEC.

There should be an option to change TMP location or the installer should extract to $PWD.

Version Info

None yet -- -won't install.

Stacktrace

No response

@cnpryer
Copy link
Contributor

cnpryer commented Jul 27, 2023

Reproducing this with rustup I get

Cannot execute /tmp/tmp.hlCBMVBvRR/rustup-init (likely because of mounting /tmp as noexec).
Please copy the file to a location where you can execute binaries and run ./rustup-init.

https://github.com/rust-lang/rustup/blob/87fa15d13e3778733d5d66058e5de4309c27317b/rustup-init.sh#L158-L159

So first thought is I can probably submit a PR with a similar helpful message. Second thought is I'm curious if we can't just provide a way to configure what TMPDIR is used.

@cnpryer
Copy link
Contributor

cnpryer commented Jul 27, 2023

I have to play with the install script more (not too experienced with this stuff), but a workaround for now is just manually installing using

curl -L -o rye-x86_64-linux.gz https://github.com/mitsuhiko/rye/releases/latest/download/rye-x86_64-linux.gz
gunzip rye-x86_64-linux.gz
chmod -x ./rye-x86_64-linux
./rye-x86_64-linux

@mitsuhiko
Copy link
Collaborator

I am a bit afraid that this problem does not just exist with the installer but also with rye itself. I think at the very least a better error message should be provided for now.

@mitsuhiko
Copy link
Collaborator

Closing this. The improved error message is I think good enough.

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

3 participants