-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix build problem of non-root user using script #9898
Conversation
…eosio_build.sh. So, non root building will have problem to install dependency. Add "sudo" to solve the problem.
scripts/helpers/eosio.sh
Outdated
echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ | ||
curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ | ||
apt-get update && apt-get -y install libpq-dev | ||
sudo echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > sudo /etc/apt/sources.list.d/pgdg.list && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work properly? The redirection w/ sudo usually requires more care.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Per my test it can pass the build, however, the line 'echo "deb http://apt... ' more like did nothing after run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't
sudo echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > sudo /etc/apt/sources.list.d/pgdg.list
create a file named sudo
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, create nothing. just like no echo called. but if no sudo there, error will pops says no permission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudo echo "deb http://apt.postgresql.org/pub/repos/apt -pgdg main" > sudo hello
Creates file sudo
with contents:
bash-3.2$ cat sudo
deb http://apt.postgresql.org/pub/repos/apt -pgdg main hello
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny it actual includes "hello", did not expect that. But pretty clear this is not what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, it didn't check carefully in currently directory, I checked /etc/apt/sources.list.d nothing changed, even no pgdg.list there.
Please use standard PR template for your PR description providing a nice description that will be helpful when viewed at time of release. |
… using sudo apt update and apt install works(per test on cloud instance).
This question is out or this PR, maybe you should ask Huangming(the author of ensure-libpq-and-libpqxx), I guess the things required more than 'standard way' can do. (I guess the reason is libpq and libpqxx are not a tool like make or git, it is a compile dependent libarary, so the things more than 'standard way' install it) In this PR we would like to fix the problem of non-root user building by script. |
…an required (10).
Change Description
Start 9898 description ......
On a clean cloud instance, add a non-root user and then use this user to try to build eos using script, error will happen because libpqxx is not installed because there is no root permission.
The epe560 says the same problem, it is on 2.1 branch.
End 9898 description ......
Change Type
Select ONE
Consensus Changes
API Changes
Documentation Additions