Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project fails to build with latest CGO_ENABLED=1 #310

Open
kranurag7 opened this issue Nov 22, 2024 · 1 comment
Open

project fails to build with latest CGO_ENABLED=1 #310

kranurag7 opened this issue Nov 22, 2024 · 1 comment

Comments

@kranurag7
Copy link

I'm attempting to build the project from source and running into few issues.

steps to reproduce are following:

docker run --name wolfi --rm -it cgr.dev/chainguard/wolfi-base:latest sh

Once we have the shell available, we can run the following command:

apk add git go
git clone https://github.com/containers/prometheus-podman-exporter -b v1.13.3
apk add gpgme-dev btrfs-progs-dev # build-time deps
cd prometheus-podman-exporter
go build .

I run into the following issue:

/prometheus-podman-exporter # go build .
# github.com/mattn/go-sqlite3
In function 'sqlite3Strlen30',
    inlined from 'sqlite3ParseUri' at sqlite3-binding.c:181224:18:
sqlite3-binding.c:34654:28: warning: 'strlen' reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
34654 |   return 0x3fffffff & (int)strlen(z);
      |                            ^~~~~~~~~
In function 'sqlite3ParseUri':
cc1: note: source object is likely at address zero

tracking the issue, I ended up here where somebody faced an exact issue and opened an issue in upstream sqlite project (https://www.sqlite.org/forum/forumpost/f68e85b2c9)

Reading this, it was mentioned that it's a gcc issue which is being tracked on this bugzilla thread (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115274#c15)

Please note that when I'm using CGO_ENABLED=0 then the project is building fine but not with CGO_ENABLED set to 1.

Copy link

A friendly reminder that this issue had no activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant