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

podman-compose (docker-compose) fails on sqlite3-binding error #364

Open
sle-fevre opened this issue Sep 29, 2024 · 3 comments
Open

podman-compose (docker-compose) fails on sqlite3-binding error #364

sle-fevre opened this issue Sep 29, 2024 · 3 comments

Comments

@sle-fevre
Copy link

I'm trying to build using podman-compose but it fails on a sqlite3-binding library error (see below). I found a similar issue with the library and the author provided a work around (using v1.14.22 of the library). I've looked a few different ways to specify the version to get this to building cleaning but I don't have the background to resolve this.

I've also tried tried podman build . with the same results.

I'm hoping someone can provide guidance on how to build this cleanly.

~/code/acme-dns$ podman-compose build 
[1/2] STEP 1/7: FROM golang:alpine AS builder
[1/2] STEP 2/7: LABEL maintainer="[email protected]"
--> Using cache 2defa82204eca14e59a971ce7859bc8f412469c3ea065b2bc83407679d9485a3
--> 2defa82204ec
[1/2] STEP 3/7: RUN apk add --update gcc musl-dev git
--> Using cache ddeb87d120ee3001b19007c1a3f27135606d0771e1cba54a05742d2a77ff8bb7
--> ddeb87d120ee
[1/2] STEP 4/7: ENV GOPATH /tmp/buildcache
--> Using cache c340309f649c2e18b688f5ed9f34973ceacd41d788566d99fe170d3a17da489d
--> c340309f649c
[1/2] STEP 5/7: RUN git clone https://github.com/joohoi/acme-dns /tmp/acme-dns
--> Using cache a8a1758e63528337b25ab9d908176420cc1d03f235b4aa13d5bb9a98602400b2
--> a8a1758e6352
[1/2] STEP 6/7: WORKDIR /tmp/acme-dns
--> Using cache f4b4d1b6f707c26a83c8a3f4fcee7d4e4e49685b263a891f90a9ec72f6db6515
--> f4b4d1b6f707
[1/2] STEP 7/7: RUN CGO_ENABLED=1 go build
go: downloading github.com/BurntSushi/toml v1.2.1
go: downloading github.com/caddyserver/certmagic v0.17.2
go: downloading github.com/go-acme/lego/v3 v3.9.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/julienschmidt/httprouter v1.3.0
go: downloading github.com/lib/pq v1.10.7
go: downloading github.com/mattn/go-sqlite3 v1.14.16
go: downloading github.com/mholt/acmez v1.1.0
go: downloading github.com/miekg/dns v1.1.51
go: downloading github.com/rs/cors v1.8.3
go: downloading github.com/sirupsen/logrus v1.9.0
go: downloading golang.org/x/crypto v0.7.0
go: downloading github.com/klauspost/cpuid/v2 v2.2.4
go: downloading github.com/libdns/libdns v0.2.1
go: downloading go.uber.org/zap v1.24.0
go: downloading golang.org/x/net v0.8.0
go: downloading golang.org/x/sys v0.6.0
go: downloading go.uber.org/atomic v1.10.0
go: downloading go.uber.org/multierr v1.9.0
go: downloading golang.org/x/text v0.8.0
# github.com/mattn/go-sqlite3
sqlite3-binding.c:35911:42: error: 'pread64' undeclared here (not in a function); did you mean 'pread'?
35911 |   { "pread64",      (sqlite3_syscall_ptr)pread64,    0  },
      |                                          ^~~~~~~
      |                                          pread
sqlite3-binding.c:35929:42: error: 'pwrite64' undeclared here (not in a function); did you mean 'pwrite'?
35929 |   { "pwrite64",     (sqlite3_syscall_ptr)pwrite64,   0  },
      |                                          ^~~~~~~~
      |                                          pwrite
sqlite3-binding.c: In function 'seekAndRead':
sqlite3-binding.c:35915:49: error: unknown type name 'off64_t'; did you mean 'off_t'?
35915 | #define osPread64 ((ssize_t(*)(int,void*,size_t,off64_t))aSyscall[10].pCurrent)
      |                                                 ^~~~~~~
sqlite3-binding.c:38777:11: note: in expansion of macro 'osPread64'
38777 |     got = osPread64(id->h, pBuf, cnt, offset);
      |           ^~~~~~~~~
sqlite3-binding.c:35915:58: error: expected ')' before 'aSyscall'
35915 | #define osPread64 ((ssize_t(*)(int,void*,size_t,off64_t))aSyscall[10].pCurrent)
      |                   ~                                      ^~~~~~~~
sqlite3-binding.c:38777:11: note: in expansion of macro 'osPread64'
38777 |     got = osPread64(id->h, pBuf, cnt, offset);
      |           ^~~~~~~~~
sqlite3-binding.c: In function 'seekAndWriteFd':
sqlite3-binding.c:35933:57: error: unknown type name 'off64_t'; did you mean 'off_t'?
35933 | #define osPwrite64  ((ssize_t(*)(int,const void*,size_t,off64_t))\
      |                                                         ^~~~~~~
sqlite3-binding.c:38906:17: note: in expansion of macro 'osPwrite64'
38906 |   do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
      |                 ^~~~~~~~~~
sqlite3-binding.c:35934:21: error: expected ')' before 'aSyscall'
35934 |                     aSyscall[13].pCurrent)
      |                     ^~~~~~~~
sqlite3-binding.c:38906:17: note: in expansion of macro 'osPwrite64'
38906 |   do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
      |                 ^~~~~~~~~~
sqlite3-binding.c:35933:21: note: to match this '('
35933 | #define osPwrite64  ((ssize_t(*)(int,const void*,size_t,off64_t))\
      |                     ^
sqlite3-binding.c:38906:17: note: in expansion of macro 'osPwrite64'
38906 |   do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
      |                 ^~~~~~~~~~
Error: building at STEP "RUN CGO_ENABLED=1 go build": while running runtime: exit status 1
@kawaii-wolf
Copy link

RUN sed -i 's/go-sqlite3 v1[.]14[.]16/go-sqlite3 v1.14.22/g' /tmp/acme-dns/go.mod
RUN sed -i 's/go-sqlite3 v1[.]14[.]16/go-sqlite3 v1.14.22/g' /tmp/acme-dns/go.sum
RUN sed -i 's/h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=/h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=/g' /tmp/acme-dns/go.sum
RUN sed -i 's/h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=/h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=/g' /tmp/acme-dns/go.sum

Here's what I added to the Dockerfile to update go.mod/go.sum to use the newer version you linked.

@sle-fevre
Copy link
Author

sle-fevre commented Sep 30, 2024

Thanks for the help as the build now runs cleanly and to completion. I had to modify what you provided as the last sed substitution didn't work since there were forward slashes in the hash value. For anyone else that hits this, add the following lines in the Docker file before the RUN CGO_ENABLED=1 go build statement.

RUN sed -i 's/go-sqlite3 v1[.]14[.]16/go-sqlite3 v1.14.22/g' /tmp/acme-dns/go.mod
RUN sed -i 's/go-sqlite3 v1[.]14[.]16/go-sqlite3 v1.14.22/g' /tmp/acme-dns/go.sum
RUN sed -i 's|h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=|h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=|g' /tmp/acme-dns/go.sum
RUN sed -i 's|h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=|h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=|g' /tmp/acme-dns/go.sum

@kawaii-wolf
Copy link

Looks like github did the same thing again when pasting, just escape your forward slashes with backslashes.

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

No branches or pull requests

2 participants