panda-re / lava

LAVA: Large-scale Automated Vulnerability Addition
Other
371 stars 60 forks source link

Fix check and install for python-colorama in setup.py #1

Closed MahmoudDolah closed 6 years ago

MahmoudDolah commented 6 years ago

Tried building this on Ubuntu 18.04 and got an import error for python-colorama

Uses try statement to check if import fails, then will install python-colorama package using apt-get Implementation ref here

(lava-JXlVmfNN) mahmoud@megatron:~/Documents/git-repos/lava(fix-setup-script⚡) » python setup.py 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-colorama
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.6 kB of archives.
After this operation, 87.0 kB of additional disk space will be used.
Selecting previously unselected package python-colorama.
(Reading database ... 498433 files and directories currently installed.)
Preparing to unpack .../python-colorama_0.3.7-1_all.deb ...
Unpacking python-colorama (0.3.7-1) ...
Setting up python-colorama (0.3.7-1) ...
Installed python-colorama package, please rerun this script

Side question: Is there a reason colorama isn't installed with pip?

moyix commented 6 years ago

Colorama isn't installed via pip because on Debian/Ubuntu systems we prefer to use the system's package manager rather than Python's; particularly since we're installing things systemwide this makes it easier to uninstall things later and helps prevent package conflicts.

I guess the situation you're trying to address is that you already had a version installed via pip and you want it to use that rather than trying to install one via apt?

Also as a side note: I think you will have further trouble with 18.04 because we depend on versions of LLVM/clang that are no longer available in 18.04...

MahmoudDolah commented 6 years ago

Colorama isn't installed via pip because on Debian/Ubuntu systems we prefer to use the system's package manager rather than Python's; particularly since we're installing things systemwide this makes it easier to uninstall things later and helps prevent package conflicts

Ah, okay. I understand now, I'll close this PR

Also as a side note: I think you will have further trouble with 18.04 because we depend on versions of LLVM/clang that are no longer available in 18.04...

Yeah, I came across this, as well