cvengler / sysget

One package manager to rule them all
GNU General Public License v3.0
683 stars 35 forks source link

/usr/local/bin/sysget: cannot execute binary file #25

Closed selfagency closed 6 years ago

selfagency commented 6 years ago

Seems to install fine in Mac OS Mojave but when you go to run it, it throws an error saying it's not executable. Tried installing via fish and bash with the same result.

➜ sudo wget -O /usr/local/bin/sysget https://github.com/emilengler/sysget/releases/download/v1.2.1/sysget; sudo mkdir -p /usr/local/share/sysget; sudo chmod a+x /usr/local/bin/sysget
--2018-11-08 14:49:33--  https://github.com/emilengler/sysget/releases/download/v1.2.1/sysget
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/151754303/7c7cd780-d634-11e8-8273-0eca24b2bb91?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20181108%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20181108T194937Z&X-Amz-Expires=300&X-Amz-Signature=85541d69da688b6a25d54918da504ce08e7459471a5cb8a0f7a14b5f5cedadb1&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dsysget&response-content-type=application%2Foctet-stream [following]
--2018-11-08 14:49:37--  https://github-production-release-asset-2e65be.s3.amazonaws.com/151754303/7c7cd780-d634-11e8-8273-0eca24b2bb91?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20181108%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20181108T194937Z&X-Amz-Expires=300&X-Amz-Signature=85541d69da688b6a25d54918da504ce08e7459471a5cb8a0f7a14b5f5cedadb1&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dsysget&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.224.208
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.224.208|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 54232 (53K) [application/octet-stream]
Saving to: ‘/usr/local/bin/sysget’

/usr/local/bin/sysget                                               100%[===================================================================================================================================================================>]  52.96K  --.-KB/s    in 0.04s

2018-11-08 14:49:37 (1.22 MB/s) - ‘/usr/local/bin/sysget’ saved [54232/54232]

➜ sysget
Failed to execute process '/usr/local/bin/sysget'. Reason:
exec: Exec format error
The file '/usr/local/bin/sysget' is marked as an executable but could not be run by the operating system.

➜ bash
bash-3.2$ sysget
bash: /usr/local/bin/sysget: cannot execute binary file
cvengler commented 6 years ago

Did you made the binary executable ? You can do this with sudo chmod a+x /usr/local/bin/sysget Hope it helps Greetings Emil

selfagency commented 6 years ago

as shown in the first line of output above, yes, that command is the third in the sequence. as the error message stipulates: "The file '/usr/local/bin/sysget' is marked as an executable but could not be run by the operating system."

cvengler commented 6 years ago

I think the problem is that the offical provided binary is compiled under Linux and not macOS (I don't have a Mac). Can you try to compile it on your own ? It is not that hard Download the stable source code at the release page Then unzip the zip file Open a terminal in the src/ folder an do: make && make install Then you should be able to use sysget

selfagency commented 6 years ago

that worked, with one caveat. see the warning below:

➜ make; sudo make install
g++ -std=c++11 -c main.cpp
g++ -std=c++11 -c packagemanager.hpp packagemanager.cpp
g++ -std=c++11 -c utils.hpp utils.cpp
utils.cpp:32:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
g++ -std=c++11 -o sysget.o main.o packagemanager.o utils.o
cp sysget.o /usr/local/bin/sysget
cvengler commented 6 years ago

I've just patched this out. Can you try it again but this time do it with the master branch instead of v1.2.1 ? This time it shouldn't give any warnings. Greetings Emil

EDIT: Travis also said that there wasn't any warning so you don't need to re-compile, a little bit embarrassing that I didn't saw this earlier

cvengler commented 6 years ago

Finally let's draw this conclusion:

EDIT: I have also updated the release page