-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix musl build (#1164) #1177
Fix musl build (#1164) #1177
Conversation
see #1164 |
Honestly unsure how this isn't urgent to users out there but it saved me. replace github.com/mattn/go-sqlite3 => github.com/leso-kn/go-sqlite3 v0.0.0-20230710125852-03158dc838ed |
03158dc
to
65d6085
Compare
hey @mattn could we get this merged? it's a really small non-breaking change that would fix all musl builds |
Can you add test for the musl build ? |
I had to do some digging here to check whether this change was safe, because on the surface it isn't. However, SQLite itself also sets I do think there is a bug in the C library though, since it doesn't appear SQLite will attempt to constrain itself to 32 bits if LFS is disabled. |
Bugfixes - Fixed a bug involving non-English locales of Windows where machine installs using user-mode networking were rejected due to erroneous version detection (openwrt#20209). - Fixed a regression in --env-file handling (openwrt#19565). - Fixed a bug where podman inspect would fail when stat'ing a device failed. API - The network list compat API endpoint is now much faster (openwrt#20035). Openwrt updates: added patch to allow building with musl-1.2.4 Patch source is from gentoo https://github.com/vimproved/gentoo/blob/c4c349f11a4352be1965726eadfe3a8bd8a6fa9c/app-containers/podman/files/podman-4.5.0-fix-build-with-musl-1.2.4.patch Issue was discussed by @jefferyto at mattn/go-sqlite3#1177 Signed-off-by: Oskari Rauta <[email protected]>
Bugfixes - Fixed a bug involving non-English locales of Windows where machine installs using user-mode networking were rejected due to erroneous version detection (#20209). - Fixed a regression in --env-file handling (#19565). - Fixed a bug where podman inspect would fail when stat'ing a device failed. API - The network list compat API endpoint is now much faster (#20035). Openwrt updates: added patch to allow building with musl-1.2.4 Patch source is from gentoo https://github.com/vimproved/gentoo/blob/c4c349f11a4352be1965726eadfe3a8bd8a6fa9c/app-containers/podman/files/podman-4.5.0-fix-build-with-musl-1.2.4.patch Issue was discussed by @jefferyto at mattn/go-sqlite3#1177 Signed-off-by: Oskari Rauta <[email protected]>
Bugfixes - Fixed a bug involving non-English locales of Windows where machine installs using user-mode networking were rejected due to erroneous version detection (openwrt#20209). - Fixed a regression in --env-file handling (openwrt#19565). - Fixed a bug where podman inspect would fail when stat'ing a device failed. API - The network list compat API endpoint is now much faster (openwrt#20035). Openwrt updates: added patch to allow building with musl-1.2.4 Patch source is from gentoo https://github.com/vimproved/gentoo/blob/c4c349f11a4352be1965726eadfe3a8bd8a6fa9c/app-containers/podman/files/podman-4.5.0-fix-build-with-musl-1.2.4.patch Issue was discussed by @jefferyto at mattn/go-sqlite3#1177 Signed-off-by: Oskari Rauta <[email protected]> (cherry picked from commit e25d417)
Bugfixes - Fixed a bug involving non-English locales of Windows where machine installs using user-mode networking were rejected due to erroneous version detection (openwrt#20209). - Fixed a regression in --env-file handling (openwrt#19565). - Fixed a bug where podman inspect would fail when stat'ing a device failed. API - The network list compat API endpoint is now much faster (openwrt#20035). Openwrt updates: added patch to allow building with musl-1.2.4 Patch source is from gentoo https://github.com/vimproved/gentoo/blob/c4c349f11a4352be1965726eadfe3a8bd8a6fa9c/app-containers/podman/files/podman-4.5.0-fix-build-with-musl-1.2.4.patch Issue was discussed by @jefferyto at mattn/go-sqlite3#1177 remarks: removed musl-1.2.4 patch from commit, since that version of musl is not available with openwrt-23.05 Signed-off-by: Oskari Rauta <[email protected]> (cherry picked from commit e25d417)
Bugfixes - Fixed a bug involving non-English locales of Windows where machine installs using user-mode networking were rejected due to erroneous version detection (#20209). - Fixed a regression in --env-file handling (#19565). - Fixed a bug where podman inspect would fail when stat'ing a device failed. API - The network list compat API endpoint is now much faster (#20035). Openwrt updates: added patch to allow building with musl-1.2.4 Patch source is from gentoo https://github.com/vimproved/gentoo/blob/c4c349f11a4352be1965726eadfe3a8bd8a6fa9c/app-containers/podman/files/podman-4.5.0-fix-build-with-musl-1.2.4.patch Issue was discussed by @jefferyto at mattn/go-sqlite3#1177 remarks: removed musl-1.2.4 patch from commit, since that version of musl is not available with openwrt-23.05 Signed-off-by: Oskari Rauta <[email protected]> (cherry picked from commit e25d417)
Bugfixes - Fixed a bug involving non-English locales of Windows where machine installs using user-mode networking were rejected due to erroneous version detection (openwrt#20209). - Fixed a regression in --env-file handling (openwrt#19565). - Fixed a bug where podman inspect would fail when stat'ing a device failed. API - The network list compat API endpoint is now much faster (openwrt#20035). Openwrt updates: added patch to allow building with musl-1.2.4 Patch source is from gentoo https://github.com/vimproved/gentoo/blob/c4c349f11a4352be1965726eadfe3a8bd8a6fa9c/app-containers/podman/files/podman-4.5.0-fix-build-with-musl-1.2.4.patch Issue was discussed by @jefferyto at mattn/go-sqlite3#1177 Signed-off-by: Oskari Rauta <[email protected]>
any progress update on this? |
src/os_unix.c have this code. so I guess that this change should work well. @rittneje what do you think? /* Use pread() and pwrite() if they are available */
#if defined(HAVE_PREAD64) && defined(HAVE_PWRITE64)
# undef USE_PREAD
# undef USE_PWRITE
# define USE_PREAD64 1
# define USE_PWRITE64 1
#elif defined(HAVE_PREAD) && defined(HAVE_PWRITE)
# undef USE_PREAD
# undef USE_PWRITE
# define USE_PREAD64 1
# define USE_PWRITE64 1
#endif |
65d6085
to
798da2f
Compare
798da2f
to
55b17a8
Compare
Thanks for the feedback @mattn, I've changed the patch to your version! |
Sorry, I made you confused. I just said that we can merge previous version of those changes. |
BTW, now I could reproduce this in https://github.com/mattn/nostr-relay/actions/runs/7151889396/job/19476647857 and confirmed with
|
Or we might be possible to remove this line. (not make sure) |
For reference if anyone is having this issue in their CI/CD pipelines this affects the latest published golang alpine container image Edit: Looks like a |
Temporary fix for mattn/go-sqlite3#1177 which will be reverted in the near future as that's merged. Signed-off-by: James Elliott <[email protected]>
Temporary fix for mattn/go-sqlite3#1177 which will be reverted in the near future as that's merged. Signed-off-by: James Elliott <[email protected]>
Looks good to me. I checked this change in mattn/nostr-relay#2 |
go-sqlite3 does not build with musl 1.2.4+, which is packaged in some distros (e.g. Alpine 3.19+). This update fixes it. More info: mattn/go-sqlite3#1177
The commit 031e41a is a temporary workaround to fix musl build error, and now to remove `CGO_CFLAGS="-D_LARGEFILE64_SOURCE"` for building docker image, because go-sqlite3 library was upgraded to `1.14.19` [^1] and the musl build was fixed in go-sqlite3 version `1.14.19` [^2]. This reverts commit 031e41a (refer PR #234). --- [^1]: commit hash ad6673b [^2]: mattn/go-sqlite3#1177
Revert "Fix build docker with sqlite3 musl error (#234)" commit. The commit 031e41a is a temporary workaround to fix musl build error, and now to remove `CGO_CFLAGS="-D_LARGEFILE64_SOURCE"` for building docker image, because go-sqlite3 library was upgraded to `1.14.19` [^1] and the musl build was fixed in go-sqlite3 version `1.14.19` [^2]. This reverts commit 031e41a (refer PR #234). --- [^1]: commit hash ad6673b [^2]: mattn/go-sqlite3#1177
* build(deps): bump golang from 1.21.3-alpine to 1.21.5-alpine Bumps golang from 1.21.3-alpine to 1.21.5-alpine. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): update go-sqlite3 to resolve pread/pwrite buile issue following mattn/go-sqlite3#1177 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Idan Frimark <[email protected]>
use same workaround as authelia/authelia#6404 before mattn#1177 fixes the build otherwise
use same workaround as authelia/authelia#6404 before mattn#1177 fixes the build otherwise
…pine (#585) * build(deps): bump golang from 1.21.3-alpine to 1.21.5-alpine Bumps golang from 1.21.3-alpine to 1.21.5-alpine. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): update go-sqlite3 to resolve pread/pwrite buile issue following mattn/go-sqlite3#1177 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Idan Frimark <[email protected]>
…pine (#585) * build(deps): bump golang from 1.21.3-alpine to 1.21.5-alpine Bumps golang from 1.21.3-alpine to 1.21.5-alpine. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): update go-sqlite3 to resolve pread/pwrite buile issue following mattn/go-sqlite3#1177 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Idan Frimark <[email protected]>
…pine (#585) * build(deps): bump golang from 1.21.3-alpine to 1.21.5-alpine Bumps golang from 1.21.3-alpine to 1.21.5-alpine. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): update go-sqlite3 to resolve pread/pwrite buile issue following mattn/go-sqlite3#1177 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Idan Frimark <[email protected]>
use same workaround as authelia/authelia#6404 before mattn#1177 fixes the build otherwise
As pointed out by @jefferyto the LFS64 interfaces were marked as deprecated in musl 1.2.4 (release notes, commit), thus go-sqlite3 currently fails to compile on musl.
This PR adjusts CLFAGS to let the C implementation use
pread()
/pwrite()
instead ofpread64()
/pwrite64()
.Note: This change does not affect existing glibc builds as suggested by the pread64 man page: