Suddenly, the Go language Google Cloud API to speech-to-text is not working! /lib64/libc.so.6: version `GLIBC_2.32' not found

huangapple go评论69阅读模式
英文:

Suddenly, the Go language Google Cloud API to speech-to-text is not working! /lib64/libc.so.6: version `GLIBC_2.32' not found

问题

我已经编写了一个Go程序,它接受一个录音文件,并将其中的前59秒提交给Google语音转文字API(为了完全避免使用Google Cloud存储,因为出于多种原因,在大量服务器上使用它是不切实际的)。在Ubuntu、CentOS6和CentOS7上一直运行得很好,直到这个周末。我刚刚升级到运行Ubuntu 22.04的系统。我不得不进行代码更改。go build运行正常。但是当我在CentOS6或7上运行它时:

[murf@0b06ac9134ab stt3]$ ./stt3
./stt3: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./stt3)
./stt3: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./stt3)
[murf@0b06ac9134ab stt3]$ 

在CentOS6和7上安装了golang,在这些机器上本地构建了可执行文件,结果相同。

我进行了一些研究,发现glibc对于golang是一个问题,但只有在需要其中几个功能的代码中才会出现问题。重新编译以强制使用较旧版本的glibc的新用法似乎是一个可行的选择。

看起来,Google更新了Go API库,并使其依赖于一个更新的glibc版本... 而摆脱这种依赖的唯一方法就是在CentOS6(最旧的glibc版本)上重新编译所有Google Cloud API Go库的源代码。可能还需要在CentOS7上重新编译,谁知道呢。Go的可移植性就这样打了水漂。

所以,问题是:

  • Google Cloud API Go库的源代码到底在哪里?
  • 为什么它们这么难找到?它们是专有的吗?
  • 我应该放弃Google的东西,转而使用Nuance或其他任何东西吗?
  • 我该如何报告他们代码中的错误?
英文:

I have written a Go program that takes a recording file and submits the first 59 seconds of it (to totally avoid the using the Google Cloud Storage stuff, which for multiple reasons is impractical to use on a large number of servers) to the google speech-to-text API. It's been running fine on Ubuntu, CentOS6, and CentOS7, until this weekend. I have just moved up a system running Ubuntu 22.04. I had to make a code change. go build runs fine. But when I run it on CentOS6 or 7:

[murf@0b06ac9134ab stt3]$ ./stt3
./stt3: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./stt3)
./stt3: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./stt3)
[murf@0b06ac9134ab stt3]$ 

Installed golang on both centOS6 and 7, built the exec locally on those boxes, and same result.

I did some research and see that glibc is a problem for golang, but only in code that needs a few of its features. Recompiling to force a new usage of an older version of glibc seems a viable option here.

Seems to me, that google updated the Go API libraries, and made them depend on a much newer version of glibc.... and the only way to get rid of this dependency would be to recompile all the Google Cloud API Go library sources on CentOS6 (oldest glibc). May have to also recompile on centOS7, who knows. So much for the portability of Go.

So, the questions are:

  • Where in the heck are the sources for the Google Cloud API Go libraries?
  • Why are they so hard to find? Are they proprietary?
  • Should I give up on Google's stuff, and move to Nuance or any of the others?
  • How do I even report a bug in their code?

答案1

得分: 4

由于与glibc的动态链接,尝试构建静态链接版本:

go build -tags netgo,osusergo .

使用-tags osusergo,netgo强制进行静态构建,无需依赖库。

英文:

because of dynamic link with glibc, try to build static link version :

go build -tags netgo,osusergo .

use -tags osusergo,netgo to force static build without dependency library.

huangapple
  • 本文由 发表于 2022年6月14日 23:53:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/72619990.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定