Blame FAQ.md

Packit Service 311553
# Frequently Asked Questions
Packit Service 311553
Packit Service 311553
__Q: error while loading shared libraries__
Packit Service 311553
Packit Service 311553
__A:__ libyang is installed into the directory detected by CMake's GNUInstallDirs
Packit Service 311553
   function. However, when it is connected with the installation prefix, the
Packit Service 311553
   target directory is not necessary the path used by the system linker. Check
Packit Service 311553
   the linker's paths in `/etc/ld.so.conf.d/`. If the path where libyang is
Packit Service 311553
   installed is already present, just make `ldconfig` to rebuild its cache:
Packit Service 311553
```
Packit Service 311553
# ldconfig
Packit Service 311553
```
Packit Service 311553
   If the path is not present, you can change the libyang installation prefix
Packit Service 311553
   when running cmake, so the complete compilation and installation sequence is:
Packit Service 311553
```
Packit Service 311553
$ mkdir build; cd build
Packit Service 311553
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
Packit Service 311553
$ make
Packit Service 311553
# make install
Packit Service 311553
```
Packit Service 311553
   or add the libyang's location to the linker paths in `/etc/ld.so.conf.d` and
Packit Service 311553
   then run `ldconfig` to rebuild the linker cache.
Packit Service 311553
Packit Service 311553
__Q: yanglint(1) does not start, but prints the following error messages:__
Packit Service 311553
```
Packit Service 311553
./yanglint
Packit Service 311553
libyang[0]: Invalid keyword "type" as a child to "annotation". (path: /)
Packit Service 311553
libyang[0]: Module "yang" parsing failed.
Packit Service 311553
Failed to create context.
Packit Service 311553
```
Packit Service 311553
Packit Service 311553
__A:__ To handle complex YANG extensions, libyang (and therefore yanglint(1))
Packit Service 311553
   needs plugins. By default, the plugins are installed into the system path
Packit Service 311553
   (next to the libyang library into the separate `libyang` subdirectory). If
Packit Service 311553
   libyang was not installed, yanglint cannot find these plugins and it fails.
Packit Service 311553
   If you do not want to install libyang, it is possible to specify path to the
Packit Service 311553
   plugins via environment variable. The plugins can be found in the libyang
Packit Service 311553
   build directory in `src/extensions/` subdirectory. So running yanglint(1)
Packit Service 311553
   then can be made this way:
Packit Service 311553
```
Packit Service 311553
$ LIBYANG_EXTENSIONS_PLUGINS_DIR=`pwd`/src/extensions ./yanglint
Packit Service 311553
```
Packit Service 311553
   The same issue occurs for user types and the solution is the same except they
Packit Service 311553
   are built in `src/user_types/` subdirectory and the path should be set with:
Packit Service 311553
```
Packit Service 311553
$ LIBYANG_USER_TYPES_PLUGINS_DIR=`pwd`/src/user_types
Packit Service 311553
```
Packit Service 311553
   However, user types are not required for yanglint(1) to run properly.
Packit Service 311553
Packit Service 311553
__Q: error (or similar) is printed:__
Packit Service 311553
```
Packit Service 311553
Regular expression "<exp>" is not valid ("<exp>": support for \P, \p, and \X has not been compiled).
Packit Service 311553
```
Packit Service 311553
Packit Service 311553
__A:__ libyang uses *PCRE* library (not *PCRE2*) for regular expression parsing
Packit Service 311553
   and evaluation. This error is printed because the locally installed *PCRE*
Packit Service 311553
   library on your system is missing support for these regex atoms. It must
Packit Service 311553
   be explicitly allowed by compiling *PCRE* with `--enable-unicode-properties`
Packit Service 311553
   (more in its [README](https://www.pcre.org/original/readme.txt)).