Git Product home page Git Product logo

clade's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

clade's Issues

Rewrite high-level interface

Right now it is quite confusing, difficult to use and it lacks some features available in the low-level interface. docstrings are also must be added.

Allow calculating check sums for stored sources

To easily distinguish different stored sources using check sums calculated in advance seem to be the best solution. Other solutions like providing attributes for stored sources, calculating check sums on the fly or archiving sources and comparing archive sizes are worse by different reasons.

Build indexes for cross referencing

Recently we discussed that cross referencing is a very valuable feature for users. Clade should perform additional code querying for gathering necessary data and generate indexes for source files.

Find a way to get rid of duplicate commands.

Some commands are in fact just wrappers for other commands. For example, on macOS calling gcc can result in the following command stack:

- /usr/bin/gcc ...
- /Library/Developer/CommandLineTools/usr/bin/gcc ...
- /usr/bin/xcrun clang ...
- /Library/Developer/CommandLineTools/usr/bin/clang ...
- /Library/Developer/CommandLineTools/usr/bin/clang -cc1 ...

Generally we are interested only in the first command in such stack, but currently there is no way to know that these commands are connected to each other, so corresponding extensions (CC, in case of this example) process all of them as independent commands. The result is several duplicate commands.

CIF still doesn't work on macOS

The reason is Linux-specific command line tools used in cif.c file.

CIF is an optional dependency of Clade used for getting information about source code.

LD extension parses options incorrectly

Example:

 {
        "command":"ld",
        "cwd":"/work/git/linux",
        "id":29309,
        "in":[
            "max-page-size=0x200000",
            "drivers/acpi/.tmp_scan.o"
        ],
        "opts":[
            "-m",
            "elf_x86_64",
            "-z",
            "-r",
            "-T",
            "drivers/acpi/.tmp_scan.ver"
        ],
        "out":"drivers/acpi/scan.o"
}

max-page-size is definitely not an input file.

Unparsed command:

    {
        "command":[
            "ld",
            "-m",
            "elf_x86_64",
            "-z",
            "max-page-size=0x200000",
            "-r",
            "-o",
            "drivers/acpi/scan.o",
            "drivers/acpi/.tmp_scan.o",
            "-T",
            "drivers/acpi/.tmp_scan.ver"
        ],
        "cwd":"/work/git/linux",
        "id":29309,
        "which":"/usr/bin/ld"
    },

Implement proper API for extensions

There are already some API functions inside extensions classes (for example, methods load_cmd_by_id() and load_all_cmds()). We need to add more such methods.

There are another problem: to use these interface methods it is required to manually create extension object beforehand. Perhaps interface functions should be independent from extensions classes.

Evaluate and output progress

I think that for some long operations of Clade, e.g. querying source code, you can evaluate and output a progress quite easily.

The issue is not very important since Clade does not work very much time first and it is not intended to be invoked often.

Implement "load_all_compilation_cmds" method

load_all_cmds() method of the CC extension can contain linker or assembler commands. This is expected and right, but sometimes user want to receive only proper compilation commands, so an additional method is required.

clade fails to install on Fedora 28

Installation log:

$ sudo pip3 install -e .
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Obtaining file:///home/work/tmp/clade
Requirement already satisfied: ujson in /usr/local/lib64/python3.6/site-packages (from clade==1.0)
Requirement already satisfied: graphviz in /usr/local/lib/python3.6/site-packages (from clade==1.0)
Requirement already satisfied: jinja2 in /usr/local/lib64/python3.6/site-packages (from clade==1.0)
Requirement already satisfied: ply in /usr/lib/python3.6/site-packages (from clade==1.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib64/python3.6/site-packages (from jinja2->clade==1.0)
Installing collected packages: clade
  Found existing installation: clade 1.0
    Can't uninstall 'clade'. No files were found to uninstall.
  Running setup.py develop for clade
Successfully installed clade

Run:

$ clade
Traceback (most recent call last):
  File "/usr/local/bin/clade", line 11, in <module>
    load_entry_point('clade', 'console_scripts', 'clade')()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2699, in load_entry_point
    raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'clade') not found

Failed building wheel for clade

pip3 install clade (Ubuntu):
Failed building wheel for clade
error: can't copy 'clade/libinterceptor/lib': doesn't exist or not a regular file
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-0cttqg1y/clade/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-1b0ttqqp/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-0cttqg1y/clade/

Cannot install Clade into any specific directory

Installing Clade with a command
sudo pip3 install -t ../install .

I do not have bin directory with required scripts. Without sudo it does not work at all because pip prevents installation at all (Ubuntu bug as far as I know):
raise DistutilsOptionError("can't combine user with prefix, " distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base

Problem with temporary directories

As Eugeny explained os.path.join() does not work with absolute paths. Thus, in info.py:148 cif_out is usually assigned to origin "cmd_in" + ".o"

Test compatibility with Python 3.4

Currently only compatibility with Python 3.5, 3.6 and 3.7 is tested. Adding 3.4 to the list is a little bit tricky due to issues in Travis.

Change the format of cmds.txt file

At the moment, the commands arguments are separated by the "||" characters. These characters can also occur in the arguments themselves, so it would be better if we structure this file a little bit differently.

Update readme

Updated readme should include:

  • Build prerequisites
  • Installation instructions (both PYPI and source code)
  • How to use: command line utilities, importing as Python module
  • Troubleshooting

Do not hide stack traces

I catch the following exception:
clade Callgraph: Processing calls
'NoneType' object is not iterable

It is hard to understand what went wrong.

Do not blame CIF when it was not run

If Clade does not run CIF at all (e.g. this is the case when there aren't input files), it still blames it that it fails on every command. Instead, I expect that there should be errors, e.g. that input files are missed.

Removing duplicate lines is too slow

Sometimes CIF outputs really large files: for example, for macros expansions for the whole Linux kernel the size of the output file is approximately 34GB. It consists almost entirely from duplicate lines which must be removed from the file. Currently this process takes almost an hour of time, which is unacceptable.

CIF logs are not complete

By some unknown reason Clade does not print all CIF logs both when errors happen and without that.

Replace multiprocessing.Pool

It is unbalanced: if processed data is uneven then in the end there is only one worker left with a bunch data to process.

Consider to use concurrent.futures or multiprocessing.Queue().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.