Blame FAQ.md

Packit 8fb591
# Frequently Asked Questions
Packit 8fb591
Packit 8fb591
__Q: error while loading shared libraries__
Packit 8fb591
Packit 8fb591
__A:__ libyang is installed into the directory detected by CMake's GNUInstallDirs
Packit 8fb591
   function. However, when it is connected with the installation prefix, the
Packit 8fb591
   target directory is not necessary the path used by the system linker. Check
Packit 8fb591
   the linker's paths in `/etc/ld.so.conf.d/`. If the path where libyang is
Packit 8fb591
   installed is already present, just make `ldconfig` to rebuild its cache:
Packit 8fb591
```
Packit 8fb591
# ldconfig
Packit 8fb591
```
Packit 8fb591
   If the path is not present, you can change the libyang installation prefix
Packit 8fb591
   when running cmake, so the complete compilation and installation sequence is:
Packit 8fb591
```
Packit 8fb591
$ mkdir build; cd build
Packit 8fb591
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
Packit 8fb591
$ make
Packit 8fb591
# make install
Packit 8fb591
```
Packit 8fb591
   or add the libyang's location to the linker paths in `/etc/ld.so.conf.d` and
Packit 8fb591
   then run `ldconfig` to rebuild the linker cache.
Packit 8fb591
Packit 8fb591
__Q: yanglint(1) does not start and, but prints the following error messages:__
Packit 8fb591
```
Packit 8fb591
./yanglint
Packit 8fb591
libyang[0]: Invalid keyword "type" as a child to "annotation". (path: /)
Packit 8fb591
libyang[0]: Module "yang" parsing failed.
Packit 8fb591
Failed to create context.
Packit 8fb591
```
Packit 8fb591
Packit 8fb591
__A:__ To handle complex YANG extensions, libyang (and therefore yanglint(1))
Packit 8fb591
   needs plugins. By default, the plugins are installed into the system path
Packit 8fb591
   (next to the libyang library into the separate `libyang` subdirectory). If
Packit 8fb591
   libyang was not installed, yanglint cannot find these plugins and it fails.
Packit 8fb591
   If you do not want to install libyang, it is possible to specify path to the
Packit 8fb591
   plugins via environment variable. The plugins can be found in the libyang
Packit 8fb591
   build directory in `src/extensions/` subdirectory. So running yanglint(1)
Packit 8fb591
   then can be made this way:
Packit 8fb591
```
Packit 8fb591
$ LIBYANG_EXTENSIONS_PLUGINS_DIR=`pwd`/src/extensions ./yanglint
Packit 8fb591
```
Packit 8fb591
   The same issue occurs for user types and the solution is the same except they
Packit 8fb591
   are built in `src/user_types/` subdirectory and the path should be set with:
Packit 8fb591
```
Packit 8fb591
$ LIBYANG_USER_TYPES_PLUGINS_DIR=`pwd`/src/user_types
Packit 8fb591
```
Packit 8fb591
   However, user types are not required for yanglint(1) to run properly.