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

sudo make install installs Eerie to /root/.eerie #32

Open
zephyrtronium opened this issue Nov 8, 2018 · 5 comments
Open

sudo make install installs Eerie to /root/.eerie #32

zephyrtronium opened this issue Nov 8, 2018 · 5 comments

Comments

@zephyrtronium
Copy link

ChromeOS Version 70.0.3538.76 (Official Build) (64-bit)
uname -a: Linux penguin 4.14.67-07156-gc116f2c8c400 #1 SMP PREEMPT Sun Sep 9 14:28:13 PDT 2018 x86_64 GNU/Linux

Following the installation instructions in the Io readme, I performed the following steps:

~$ git clone --recursive https://github.com/IoLanguage/io.git
~$ mkdir io/build
~$ cd io/build
~/io/build$ cmake ..
~/io/build$ make -j 4
~/io/build$ sudo make install

This installed Io to /usr/local/bin, as expected, but it installed Eerie to /root/.eerie, leaving me unable to access it without sudo. I tried moving it to my home directory, but there are a lot of links to update.

@ales-tsurko
Copy link
Member

ales-tsurko commented Nov 8, 2018

Thanks for the report. Unfortunately, I can't test configuration on any possible Linux distributive. It tested on Ubuntu and there it works. I'll look into it when I'll have some free time, but I'm not sure that I will in the near future... If you interested, you can debug it yourself.
If you get this error, it means that Io returns /root/.eerie for:

"~/.eerie" stringByExpandingTilde

Looks like a bug in stringByExpandingTilde on your platform. This what you can start with. Also if you can confirm that this is related to Sequence, please provide a report on the tracker of the main repo.

@zephyrtronium
Copy link
Author

I confirmed that "~/.eerie" stringByExpandingTilde returns /root/.eerie when launching Io via sudo. On my platform, sudo is changing my env to be exactly that of root; not sure if this is the default behavior elsewhere. A simple workaround is to use sudo -E make install.

It would be nice to check $SUDO_USER to get a better guess at the user's home directory, but since "~user/.eerie" stringByExpandingTilde doesn't get user's home, that seems like a lot of work to implement, and it might not be the right call in all cases, e.g. for a multi-user installation.

@ales-tsurko
Copy link
Member

On a unix platform stringByExpandingTilde relates only on the value of $HOME, so the expanded part is just the value of $HOME for the current user. Usually, the value of $HOME is the same if you use a command with sudo. But it changes to something like /root or /var/root if you switch to root user with sudo -i though.

@ales-tsurko
Copy link
Member

ok, it looks like it depends whether you are ubuntu (and macos) or debian: https://unix.stackexchange.com/questions/91384/how-is-sudo-set-to-not-change-home-in-ubuntu-and-how-to-disable-this-behavior

@ales-tsurko
Copy link
Member

As a workaround you can try to install Eerie separately.

  1. Install Io:
git clone --recursive https://github.com/IoLanguage/io.git
cd io/
mkdir build
cd build/
cmake -DCMAKE_BUILD_TYPE=release -DWITHOUT_EERIE=1 ..
make
sudo make install
  1. Install Eerie:
git clone https://github.com/IoLanguage/eerie.git
cd eerie
io setup.io ~/.path_to_your_shell_startup_script
source ~/.path_to_your_shell_startup_script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants