Errors Resolver provides resolutions or recommendations for standard errors. For example, it analyzes some build errors caused by missing components, searches the missing components in the system environment and provides a location to these missing components.
For example:
echo "undefined reference to `pthread_create'" | ./errors_resolver.py
Output with solution:
LDLIBS+=' -l pthread';
In this example errors_resolver.py searches tags and provides the missing header file.
You can see saved output in file errors_resolver_demo.log
CC=arm-linux-gnueabi-gcc ./errors_resolver_demo
This demo was tested on Ubuntu, where gcc-arm-linux-gnueabi and qemu-user are installed.
Helper /usr/lib/command-not-found resolves the error in interactive shell. To resolve errors in subroutine run:
sudo ./errors_resolver.py /var/log/*log
./errors_resolver.py < errors.log
Compilation and system errors. Output of compilation or execution log with errors can passed to output of resolver.
Fixes or recommendations to solve errors in form of modification of environment variables or shell commands.
Analyzes warnings and errors:
- implicit declaration
- undeclared symbol
- undefined symbol
- library not found or missing
- command not found
- decodes numeric system errno
- catches some disk errors
Demo supports cross compiler
Provides modification of standard environment variables:
- CPATH, CPPFLAGS, LIBRARY_PATH, LDFLAGS, LDLIBS, LD_LIBRARY_PATH
Uses tools for searching of missing components:
- ctags, nm, find
- /usr/lib/command-not-found
- apt-file search
# assure that demo package is not installed
test -e /usr/include/aalib.h && (sudo apt-get -y remove libaa1-dev || sudo yum remove -y aalib-devel)
echo "#include <aalib.h>" | gcc -E - |& ./errors_resolver.py
gcc -l aa |& ./errors_resolver.py
Both examples above give output: install+=' libaa1-dev'
(./errors_resolver_demo && CC=arm-linux-gnueabi-gcc ./errors_resolver_demo && ./command-not-found-demo && ./errors_resolver.py errors.log && echo PASSED) > regression_test.log 2>&1 && echo PASSED || (tail regression_test.log; false)
- Analyze more ./configure errors.
You are welcome to request additional features in the form of erroneous sample source code (see errors_resolver_sample.c), sample errors and solutions.
For further information you are welcome to read sources.
Thanks