Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

v1.8.0 - Build script on Ubuntu failed: /bin/su: invalid option -- 'y' #7571

Closed
datnv-ibl opened this issue Jul 1, 2019 · 5 comments
Closed
Assignees
Labels

Comments

@datnv-ibl
Copy link

datnv-ibl commented Jul 1, 2019

root@iblcore-sta-fn-eos3:/home/isysadmin/eos# ./scripts/eosio_build.sh -s EOS
EOSIO Version: 1.8.0
Mon Jul  1 03:45:56 UTC 2019
User: root
Current branch: HEAD
No installation location was specified. Please provide the location where EOSIO is installed.
Do you wish to use the default location? /root/eosio/1.8? (y/n) y

EOSIO will be installed to: /root/eosio/1.8
EOSIO has already been installed into /root/eosio/1.8... It's suggested that you eosio_uninstall.sh before re-running this script.
Do you wish to proceed anyway? (y/n) y

=====================================================================================
======================= Starting EOSIO Dependency Install ===========================
Architecture: Linux
OS name: Ubuntu
OS Version: 18.04
CPU cores: 16
Physical Memory: 65G
Disk space total: 1259G
Disk space available: 506G
[Ensuring package dependencies]
 - git found!
 - make found!
 - bzip2 found!
 - automake found!
 - libbz2-dev found!
 - libssl-dev found!
 - doxygen found!
 - graphviz found!
 - libgmp3-dev found!
 - autotools-dev found!
 - libicu-dev found!
 - python2.7 found!
 - python2.7-dev found!
 - python3 found!
 - python3-dev found!
 - autoconf found!
 - libtool found!
 - curl found!
 - zlib1g-dev found!
 - sudo found!
 - ruby found!
 - libusb-1.0-0-dev found!
 - libcurl4-gnutls-dev found!
 - pkg-config found!
 - patch found!
 - clang NOT found.
 - llvm-4.0 found!

Do you wish to install missing dependencies? (y/n)? y

/bin/su: invalid option -- 'y'
Usage: su [options] [LOGIN]

Options:
  -c, --command COMMAND         pass COMMAND to the invoked shell
  -h, --help                    display this help message and exit
  -, -l, --login                make the shell a login shell
  -m, -p,
  --preserve-environment        do not reset environment variables, and
                                keep the same shell
  -s, --shell SHELL             use SHELL instead of the default in passwd

@NorseGaud NorseGaud self-assigned this Jul 1, 2019
@NorseGaud
Copy link
Contributor

NorseGaud commented Jul 1, 2019

Can you run with VERBOSE=true set for me, then provide the output?
VERBOSE=true /scripts/eosio_build.sh -s EOS

@tboydston
Copy link

tboydston commented Jul 2, 2019

I ran into this issue as well. Here is what I get with VERBOSE=true

` Do you wish to install missing dependencies? (y/n)? y

--- Executing: /bin/su /usr/bin/apt-get install -y libusb-1.0-0-dev
/bin/su: invalid option -- 'y'
Usage: su [options] [LOGIN] `

To get around this I just installed the missing dependencies before running the script.

@taokayan
Copy link
Contributor

taokayan commented Jul 2, 2019

looks like the script uses a wrong sudo command, it should be "sudo" not "su",

would you try to change eos/scripts/helpers/general.sh as follows and run it again?

replace this line

( [[ $NAME =~ "Ubuntu" ]] ) && eval $EXECUTION_FUNCTION $SUDO_COMMAND $APTGET $OPTIONS install -y $1

into

( [[ $NAME =~ "Ubuntu" ]] ) && eval $EXECUTION_FUNCTION sudo $APTGET $OPTIONS install -y $1

@NorseGaud
Copy link
Contributor

NorseGaud commented Jul 2, 2019

I'm curious why $SUDO_COMMAND is returning /bin/su. @tboydston @datnv-ibl, is that ENV already set on your machine to /bin/su? Can you echo $SUDO_COMMAND from your cli?

I am unable to replicate this on Ubuntu 18 and 16 fresh installs

@NorseGaud
Copy link
Contributor

I had done research before using SUDO_COMMAND as the name for Ubuntu, but I guess I missed this: https://askubuntu.com/questions/953485/where-do-i-find-the-sudo-command-environment-variable

We will get a fix for the next version to use a different variable name to prevent collision.

NorseGaud added a commit that referenced this issue Jul 2, 2019
[develop] SUDO_COMMAND -> NEW_SUDO_COMMAND (base fixed)
NorseGaud added a commit that referenced this issue Jul 2, 2019
[1.8.x] SUDO_COMMAND -> NEW_SUDO_COMMAND
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants