REDasm icon indicating copy to clipboard operation
REDasm copied to clipboard

REDasm wants to overwrite system - installed Capstone on Gentoo

Open Petross404 opened this issue 5 years ago • 7 comments

Hi,

I wrote an ebuild for REDasm so that gentoo users can install it on their systems. REDasm though bundles it's own copy of capstone and creates the following conflict :

>>> Installing (1 of 1) dev-util/redasm-9999::testing
 * checking 16 files for package collisions
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at https://bugs.gentoo.org/ unless you report exactly
 * which two packages install the same file(s). See
 * https://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how
 * to solve the problem. And once again, please do NOT file a bug report
 * unless you have completely understood the above message.
 * 
 * Detected file collision(s):
 * 
 *      /usr/include/capstone/arm64.h
 *      /usr/include/capstone/arm.h
 *      /usr/include/capstone/capstone.h
 *      /usr/include/capstone/evm.h
 *      /usr/include/capstone/mips.h
 *      /usr/include/capstone/ppc.h
 *      /usr/include/capstone/x86.h
 *      /usr/include/capstone/sparc.h
 *      /usr/include/capstone/systemz.h
 *      /usr/include/capstone/xcore.h
 *      /usr/include/capstone/m68k.h
 *      /usr/include/capstone/tms320c64x.h
 *      /usr/include/capstone/m680x.h
 *      /usr/include/capstone/platform.h
 *      /usr/lib64/libcapstone.a
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * dev-libs/capstone-4.0.1:0::gentoo
 *      /usr/include/capstone/arm.h
 *      /usr/include/capstone/arm64.h
 *      /usr/include/capstone/capstone.h
 *      /usr/include/capstone/evm.h
 *      /usr/include/capstone/m680x.h
 *      /usr/include/capstone/m68k.h
 *      /usr/include/capstone/mips.h
 *      /usr/include/capstone/platform.h
 *      /usr/include/capstone/ppc.h
 *      /usr/include/capstone/sparc.h
 *      /usr/include/capstone/systemz.h
 *      /usr/include/capstone/tms320c64x.h
 *      /usr/include/capstone/x86.h
 *      /usr/include/capstone/xcore.h
 *      /usr/lib64/libcapstone.a
 * 
 * Package 'dev-util/redasm-9999' NOT merged due to file collisions. If
 * necessary, refer to your elog messages for the whole content of the
 * above message.

Can capstone be excluded optionally so that system capstone is used as it should on Gentoo?

Petross404 avatar Jul 23 '19 19:07 Petross404

Duplicate of https://github.com/REDasmOrg/REDasm/issues/28 ?

However I will make Capstone optional (dynamically linked with the system's one, if any) soon after I finish the plugin implementation and update the build system in order to support them :+1:

Dax89 avatar Jul 23 '19 19:07 Dax89

I found this issue first, sorry if I shouldn't have opened this. Anyway, cmake could use find to search for installed capstone and inform the user that the bundled one will be used if none is found.

Thank you, we will be in touch.

Petross404 avatar Jul 24 '19 08:07 Petross404

@Petross404 Try our ebuild from Pentoo overlay. REDasm is not the cleanest written software in terms of system integration and I came up with few workarounds which you can find in our ebuild.

blshkv avatar Jan 10 '21 01:01 blshkv

I have done some improvements about this in "3.0.0-beta1".

If workarounds are still needed, plase let me know so I can fix it :)

Dax89 avatar Jan 10 '21 09:01 Dax89

There are few issues are still not fixed, we need to run the following:

        sed -i '/set(CMAKE_INSTALL_RPATH ".")/d' CMakeLists.txt || die "sed failed"
        #fix database path
        sed -i 's|QDir::currentPath().toStdString()|"/usr/share/redasm/"|g' mainwindow.cpp || die "sed 2 failed"
        sed -i 's|QDir::currentPath().toStdString()|"/usr/share/redasm/"|g' unittest/disassemblertest.cpp || die "sed 3 failed"

It helps us to compile in a sandbox env

blshkv avatar Jan 11 '21 02:01 blshkv

The first and second sed statements are still needed in 3.0-beta1 ?

Btw, I will remove the code referenced by this line in beta2:

sed -i 's|QDir::currentPath().toStdString()|"/usr/share/redasm/"|g' unittest/disassemblertest.cpp || die "sed 3 failed"

Dax89 avatar Jan 11 '21 17:01 Dax89

you are right it is no longer required, I wonder why || die didn't work.

blshkv avatar Jan 12 '21 06:01 blshkv