Yes, Arthur you right
Executing go get git.fd.io/govpp.git@master, solves this problem.
Looks like there was older library.
Thanks once more. ))

________________________________
От: Arthur de Kerhor <arthurdeker...@gmail.com>
Отправлено: 25 марта 2021 г. 18:49
Кому: Юрий Иванов <format_...@outlook.com>
Копия: vpp-dev <vpp-dev@lists.fd.io>
Тема: Re: [vpp-dev] GoVpp different behaviour when compiling outside GoVpp 
project

Hi,

The reason is that inside your govpp directory, you point to the latest version 
of GoVPP master branch, which supports the latest version of the VPP stats 
segment.

On the other hand, in your gst directory, I suspect that you have added govpp 
as a dependency (in go.mod) with a command like `go get 
git.fd.io/govpp.git<http://git.fd.io/govpp.git>`, which uses the latest 
released version. I think that this release does not support the stats segment 
evolution.
To use the latest version of govpp as a dependency, you should use the command  
`go get 
git.fd.io/govpp.git@master<http://git.fd.io/govpp.git@master%60>`<http://git.fd.io/govpp.git@master%60>.
 In general, if you want to use a specific commit, you can add @<commit-id> at 
the end of the get command.

Hope that helps.

Best regards,
Arthur

Le 25 mars 2021 à 17:13, Юрий Иванов 
<format_...@outlook.com<mailto:format_...@outlook.com>> a écrit :

Hi, first of all sorry for such noob question.
I'm need to write go based program utilizing govpp stats-api.
There is official example in library which I've trunk to minimal usable which 
only opens socket:
~/GoVpp/govpp$ cat examples/stats-client/stats_api.go
package main

import (
        "log"
        
"git.fd.io/govpp.git/adapter/statsclient<http://git.fd.io/govpp.git/adapter/statsclient>"
        "git.fd.io/govpp.git/core<http://git.fd.io/govpp.git/core>"
)

func main() {
        var (
                client *statsclient.StatsClient
                c      *core.StatsConnection
                err    error
        )

        client = statsclient.NewStatsClient("/run/vpp/stats.sock") 
//(*statsSocket)
        c, err = core.ConnectStats(client)
        if err != nil {
                log.Fatalln("Connecting failed:", err)
        }
        defer c.Disconnect()
}

In case I build it from govpp package with the help of make examples it works, 
but when I've created separete my own project execution fails with error:
$ sudo ./stats
2021/03/25 15:43:01 Connecting failed: stat segment version is not supported: 2 
(minimal version: 1)

What the difference when building the same file from govpp library folder from 
separate project?

You may look all my steps to reproduce problem here 
https://pastebin.com/Lv89BrVk



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19024): https://lists.fd.io/g/vpp-dev/message/19024
Mute This Topic: https://lists.fd.io/mt/81606546/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to