Repository navigation
Conversation
libyang-dev no longer depends on libpcre2-dev, but libyang.pc kept libpcre2-8 and libxxhash in Requires.private. pkg-config resolves Requires.private even for --cflags, so pkg-config --cflags libyang failed on a system without those -dev packages. The private dependencies are now listed only in Libs.private, which needs no .pc files and is used only for static linking. The file also lists libcbor, libm, libdl and threads, which were missing, works with absolute CMAKE_INSTALL_INCLUDEDIR/LIBDIR and is generated always, the pkg-config binary is not needed for that. The warning about PKG_CONFIG_PATH needed the binary and is dropped.
The apkg tests were never run, CI only builds and installs the packages, and they still expected version 2 of libyang. They only checked that pkg-config and yanglint print a version, so they are removed instead of fixed.
The declared minimum 2.8.12 no longer worked. The new minimum is the one of the dependent projects: sysrepo and netopeer2 link OBJECT libraries through target_link_libraries() and netopeer2 uses CURL::libcurl, both new in CMake 3.12. libyang itself builds with CMake 3.5, but the whole family keeps one minimum. Two places did not work with older CMake. use_compat() removed an empty CMAKE_THREAD_LIBS_INIT from a list, which fails up to CMake 3.19. yang_update linked yangobj objects as a library, which CMake before 3.21 does without a dependency on yangobj, and it failed in a static build, where there is no yangobj. The 32-bit CI job ran in i386/ubuntu, which is Ubuntu 18.04 with CMake 3.10. It runs in the i386 Debian 13 image now.
Without keywords every dependency of the yang target was transitive and an exported target would carry absolute paths of all the private libraries. All the dependencies are private now except ws2_32 on Windows, because ly_config.h includes winsock2.h. The target also carries its include directory so that a linked target finds <libyang/libyang.h> both in the build tree and after installation, and the DLL is installed into bin on Windows.
The public headers were copied into the build tree by file(COPY) only when CMake ran, so after editing a header the build used its stale copy until the next manual reconfiguration. configure_file() makes the build rerun CMake and refresh the copy whenever the header changes.
lcbor.h is a private header of the CBOR parser and printer. Its functions are not exported and no public header includes it, but as an installed header it made <cbor.h> part of the public interface. It is now documented with the other internal headers.
michalvasko
requested changes
Nov 23, 2026
A shared build installs the LibYANG CMake package into lib/cmake/LibYANG and exports it from the build tree, so that find_package(LibYANG CONFIG) works without a Find module, pkg-config or hand-set include and library paths. It provides the imported target LibYANG::yang and the variables LibYANG_PROJECT_VERSION and LibYANG_HAVE_CBOR. The package version is the SO version with SameMajorVersion compatibility, the version the Find modules of the dependent projects compare. A static build installs no package, it would need imported targets for all the private dependencies.
The Find module was never installed, projects copied it into their own trees, and the LibYANG CMake package replaces it. The copies keep working, releases without the package are found by pkg-config. README describes the package instead.
The CMake package belongs to libyang-dev and libyang-devel. dh_missing now fails on installed files missing from all the packages, with debhelper compat 10 it did not even list them, so a new installed file silently fell out of the deb packages. pkg-config is no longer needed for the build.
The package jobs cloned the target branch from GitHub, so a pull request was built without its own changes. They now build the checked out sources and no longer install pkg-config, which the build does not need anymore.
michalvasko
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Installs a LibYANG CMake package so that dependent projects can use
find_package(LibYANG CONFIG)and link the imported targetLibYANG::yanginstead of a copied Find module or pkg-config. The package version is the SO version withSameMajorVersioncompatibility.It contains these related changes:
FindLibYANG.cmakeis removed and the README describes the package instead (copies kept in other projects still work),yangno longer leak to linking targets, and the DLL is installed intobinon Windows,lcbor.his no longer installed, so<cbor.h>is not part of the public interface,pkg-config --cflags libyangworks without the PCRE2 and xxHash development packages, because private dependencies are listed only inLibs.private, which now also includes the ones that were missing,-devpackages ship the CMake package, the unused apkg tests are removed, and the CI package jobs build the PR's own sources instead of cloning the target branch.