Failed to compile vyconf from source code

I met an error when I compile vyconf from source code. Error message are as follows.

File “src/vyconfd.ml”, line 149, characters 17-41:
149 | with Protobuf.Decoder.Failure e -> Lwt.return (Error (Protobuf.Decoder.error_to_string e))
^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Protobuf
Command exited with code 2.

I guess I need to install protobuf package. But I fail to install protobuf package. I report an issue on github. https://github.com/ocaml/opam-repository/issues/15979

I also fail to compile ocaml-protobuf from souce code. Error messages are as follows.

ocamlfind: Package `bitstring.syntax’ not found

Thanks for pointing this out!
The correct module name is Pbrt. The one named “protobuf” is a different project, maybe that’s why maintainers of ocaml-protoc renamed their modules—to avoid possible confusion.
I’ve pushed a fix and it should build now.

The vyconf codebase sure needs some love. The problem is that working on the still missing parts like commit algorithm will remain an academic exercise until the last script that relies on the old Perl API behaviour is gone. That point is much closer now than even a year ago, but it’s still at least a year ahead, by the most optimistic estimate.

https://github.com/vyos/libvyosconfig/ that powers the vyos.configtree Python module already powers all new migration script and make writing them easy, so the already working parts of vyconf already had a positive impact.

If you want to work on the still missing parts, that’s much apprecited, but getting that even to a rolling release will take time. If your motivation is to make your own appliance based on it, that’s even better because it will faciliate testing vyconf algorithms in a way VyOS codebase can’t, yet.

I still fail to compile it. But I met a new error.

ocamlfind: [WARNING] Package `threads’: Linking problems may arise because of the missing -thread or -vmthread switch
File “none”, line 1:
Error: No implementations provided for the following modules:
Mutex referenced from /home/zi/.opam/4.07.0/lib/lwt/unix/lwt_unix.cmxa(Lwt_main)
Command exited with code 2.

So you mean I can switch to libvyosconfig? I love vyconf for it can generate node.def automatical and It provides http api.

vyconf doesn’t generate node.def’s. It doesn’t know what node.def’s are—it’s meant to replace the old config backend completely when the codebase is ready for it.

What generates node.def’s is a script in github.com/vyos/vyos-1x Those XML command definition files in vyos-1x use the same format as vyconf will use in the future, so when the last handwritten node.def and last Perl script from Vyatta times is gone, we can start using vyconf in VyOS. Until that point, vyconf is useless because it doesn’t know anything about the old formats!

You cannot switch to libvyosconfig. That library provides ability to parse, VyOS configs, manipulate them in memory, and write back to disk. However, it doesn’t know what a “commit” is. All functionality still relies on the old code, except the migration scripts that convert old config option syntax to new after upgrade.

Could you tell us what you actually want to do?

I want to integrate the packages of vyos into my system (based on Linux) , so I can use vyos CLI and router features. I also want to develop a web GUI for it. That’s why I choose vyconf.

One more question, if I only use vyconf as CLI and http bridge for remote api calls, no other packages of vyos, is that possible?