vitasdk / vdpm

SDK installer and package "manager" for $VITASDK
GNU Lesser General Public License v2.1
221 stars 62 forks source link

Invalid hostname error while running bootstrap-vitasdk.sh #62

Open MaskedFuyu opened 4 years ago

MaskedFuyu commented 4 years ago

Trying to install on macOS 11.0 beta.

The script failed and the output:

sudo ./bootstrap-vitasdk.sh
==> Installing vitasdk to /usr/local/vitasdk
http://: invalid hostname.
Please add the following to the bottom of your .bashrc:
export VITASDK=/usr/local/vitasdk
export PATH=$VITASDK/bin:$PATH
and then restart your terminal

No additional error information output so I'm not sure what had caused this.

yne commented 4 years ago

can you try to execute the following line :

wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | python - $@

and post the output

MaskedFuyu commented 4 years ago

Nothing output. $? is 0.

yne commented 4 years ago

can you try python --version ? also, does wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py output the python code ?

can we replace all those python code + github API + Travis API with a simpler line that only rely on standard UNIX utilities :

URL=https://github.com/vitasdk/autobuilds/releases
wget -qO- $URL | grep -Po "/download/.*.tar.bz2" | sed s,^,$URL, | grep osx
JoseOcasio commented 3 years ago

I have the same issue. This is the output when running that command

`wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | python - $@

Traceback (most recent call last):
  File "<stdin>", line 80, in <module>
  File "<stdin>", line 67, in last_built_toolchain
  File "<stdin>", line 43, in fetch_succeeded_tags
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
    context=self._context)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661)>
`
JoseOcasio commented 3 years ago

And yes, URL=https://github.com/vitasdk/autobuilds/releases wget -qO- $URL | grep -Po "/download/.*.tar.bz2" | sed s,^,$URL, | grep osx returns the python code

MaskedFuyu commented 3 years ago

can you try python --version ? also, does wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py output the python code ?

can we replace all those python code + github API + Travis API with a simpler line that only rely on standard UNIX utilities :

URL=https://github.com/vitasdk/autobuilds/releases
wget -qO- $URL | grep -Po "/download/.*.tar.bz2" | sed s,^,$URL, | grep osx

My python version is 2.7.16.

wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py output the python code

URL=https://github.com/vitasdk/autobuilds/releases
wget -qO- $URL | grep -Po "/download/.*.tar.bz2" | sed s,^,$URL, | grep osx

failed.

JoseOcasio commented 3 years ago

I tried everything. I tried with Python3.8 and 2.7. I ended up just spinning an EC2 and had zero issues with a linux sandbox. Was able able to deploy a hello world. Will develop from there!

d3m3vilurr commented 3 years ago

@MaskedFuyu could you upload output of curl https://github.com/vitasdk/autobuilds/releases?

ndlanier commented 3 years ago

I also have this problem, I also made sure to set up a basic python alias pointing to python3.

==> Installing vitasdk to /usr/local/vitasdk
/usr/bin/curl
/home/ndlanier/vdpm/include/install-vitasdk.sh: line 4: python: command not found
http://: Invalid host name.

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Child returned status 2
tar: Error is not recoverable: exiting now
ndlanier commented 3 years ago

Ok the issue is python3 vs python.

Update include/install-vitasdk.sh to the following on line 4: wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | python3 - $@

JoseOcasio commented 3 years ago

Yes. I ended up literally reseting python and python3 and have no issues. Also tested compiling in an ec2 instance (linux) and no issues.

FibreFoX commented 2 years ago

This issue seems to still persist, this is reproducable (for me) when using this Dockerfile (mostly to build on a windows-machine):

FROM ubuntu:22.04

RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y install --no-install-recommends apt-utils dialog 2>&1
# stuff
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install git npm less iproute2 \
    build-essential \
    gcc g++ libtool cmake curl debconf-utils \
    git-core liblua5.1-0 \
    liblua5.1-0-dev libluabind-dev  \
    minizip make locales \
    nano unzip uuid-dev iputils-ping \
    zlib1g-dev zlib1g wget \
    gdb valgrind

# vita sdk 
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3 sudo autoconf texinfo bison flex

# vita SDK
ENV VITASDK=/usr/local/vitasdk
ENV PATH=$VITASDK/bin:$PATH
RUN cd /tmp \
    && git clone https://github.com/vitasdk/vdpm \
    && cd vdpm \
    && ./bootstrap-vitasdk.sh \
    && ./install-all.sh \
    && rm -rf /tmp/*

Even replacing "python" with "python3" (via sed) does not help.

Screenshot of the error message (mostly like the already reported one): grafik

Edit:

after adding set -ex to the includes/install-vitasdk.sh gives me this:

#19 0.272 Cloning into 'vdpm'...
#19 1.060 + '[' -d /usr/local/vitasdk ']'
#19 1.060 + echo '==> Installing vitasdk to /usr/local/vitasdk'
#19 1.060 + install_vitasdk /usr/local/vitasdk
#19 1.060 ==> Installing vitasdk to /usr/local/vitasdk
#19 1.060 + INSTALLDIR=/usr/local/vitasdk
#19 1.060 + case "$(uname -s)" in
#19 1.061 ++ uname -s
#19 1.062 + '[' -n '' ']'
#19 1.062 + command -v curl
#19 1.062 /usr/bin/curl
#19 1.062 + '[' '!' -d /usr/local/vitasdk ']'
#19 1.062 + sudo mkdir -p /usr/local/vitasdk
#19 1.074 ++ id -gn
#19 1.076 + sudo chown :root /usr/local/vitasdk
#19 1.086 + tar xj -C /usr/local/vitasdk --strip-components=1
#19 1.086 ++ get_download_link master linux
#19 1.087 ++ wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py
#19 1.087 ++ python - master linux
#19 1.087 /tmp/vdpm/include/install-vitasdk.sh: line 6: python: command not found
#19 1.304 + wget -O- ''
#19 1.307 http://: Invalid host name.
#19 1.307
#19 1.307 bzip2: Compressed file ends unexpectedly;
#19 1.307       perhaps it is corrupted?  *Possible* reason follows.
#19 1.307 bzip2: Inappropriate ioctl for device
#19 1.307       Input file = (stdin), output file = (stdout)
#19 1.307
#19 1.307 It is possible that the compressed file(s) have become corrupted.
#19 1.307 You can use the -tvv option to test integrity of such files.
#19 1.307
#19 1.307 You can use the `bzip2recover' program to attempt to recover
#19 1.307 data from undamaged sections of corrupted files.
#19 1.307
#19 1.308 tar: Child returned status 2
#19 1.308 tar: Error is not recoverable: exiting now
FibreFoX commented 2 years ago

In order to fix this, I tried to add some kind of python-detection.

Before:

get_download_link () {
  wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | python - $@
}

After modification:

get_download_link () {
  wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | $(which python||which python3) - $@
}

It seems on some systems the correct path to the python-executable is needed (mostly due to /bin/sh being used internally instead of bash), so this should fix that (even help for python3 being used instead of python2)

Can someone try this?

dgbrewer1989 commented 1 year ago

The solution by @FibreFoX works out for me. Windows 10 here.

Engylizium commented 1 year ago

It works but there's this: /Users/USER/vdpm/include/install-vitasdk.sh: line 6: python: command not found

MacOS 12.6.1

bgbofficial commented 1 year ago

I use anaconda env, I try to solve it

get_download_link () {

wget -qO- https://github.com/vitasdk/vita-headers/raw/master/.travis.d/last_built_toolchain.py | python - $@

}