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

Issue with vjul directory #71

Closed
vnikoofard opened this issue Aug 19, 2022 · 11 comments
Closed

Issue with vjul directory #71

vnikoofard opened this issue Aug 19, 2022 · 11 comments

Comments

@vnikoofard
Copy link
Contributor

Hi,

I'm trying to update my Julia 1.7.3 installation using the following command
sudo ./jill.sh -u julia-1.7.3 But I get the following error
cp: cannot stat '/root/.julia/environments/vjul': No such file or directory
I also had installed the version 1.7.3 using jill.

Any help is appreciated.

@abelsiqueira
Copy link
Owner

Hi @vnikoofard, can you try -u 1.7 instead.

@abelsiqueira
Copy link
Owner

PS. Let me know if that works so I can update the documentation with something clearer.

@vnikoofard
Copy link
Contributor Author

Now it gives the following error

cp: cannot stat '/root/.julia/environments/v1.7': No such file or directory

But it's strange! I have this directory in my Home
/home/vahid/.julia/environments/v1.7

@abelsiqueira
Copy link
Owner

I think this is a corner case that we missed before. We use ~ for the -u option, so with sudo is default to /root/.
I think a workaround is

  • run without sudo to copy the environment
  • then run again with sudo to actually install in the correct place.

@vnikoofard
Copy link
Contributor Author

I'm confused, as you said ~/.julia/environments/v1.7 is pointing to /home/vahid/.julia/environments/v1.7 in command line.

@abelsiqueira
Copy link
Owner

I think I got it now. Try sudo -E ./jill.sh -u 1.7.

The explanation is from https://unix.stackexchange.com/questions/684395/tilde-expansion-vs-variables-in-bash.

It looks like sudo does not preserve your $HOME information, so it uses the roots $HOME, which is /root.
If you run with -E, it will use your $HOME, which is /home/vahid.

To test this, create a tmp.sh file with the contents echo ~, and run

bash tmp.sh
sudo bash tmp.sh
sudo -E bash tmp.sh

In my case it returned

/home/abel
/root
/home/abel

@vnikoofard
Copy link
Contributor Author

Excellent solution! Thanks Abel! Now the upgrading works fine.
Muito obrigado!

@abelsiqueira
Copy link
Owner

Ah, great news. I will try to improve the documentation for this case. Thanks for reporting this.
Also, could you leave your opinion on

@vnikoofard
Copy link
Contributor Author

Ah, just one more comment. After upgrading to 1.8 and copying the environments using jill, to update the package using Pkg it throws an error
ERROR: SystemError: opening file "/home/vahid/.julia/environments/v1.8/Manifest.toml": Permission denied
The workaround is run the Julia using sudo.

@abelsiqueira
Copy link
Owner

Thanks for the report.

@abelsiqueira
Copy link
Owner

To fix this you can change the ownership of the files in your environments like this:

sudo chown -R vahid:users ~/.julia/environments/v1.8

Check with ls -l in that folder.

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