marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
750 stars 110 forks source link

Static building / compilation failure; many `undefined symbol`s. #164

Closed kminehart closed 9 months ago

kminehart commented 9 months ago

I'm trying a few ways to statically compile the examples package in this repo and I can't seem to get something to work.

  1. With Debian, gcc, glibc:
docker run --rm -e CGO_ENABLED=1 -e GOOS=linux -e GOARCH=amd64 --platform=linux/amd64 -it -v $PWD:/src --workdir=/src golang:buster /bin/sh -c 'apt-get update -yq && apt-get -yq install gcc libc6 && go build -buildvcs=false -o ex ./examples'

Results in:

# github.com/marcboeker/go-duckdb/examples
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(ub_duckdb_catalog_entries.cpp.o): in function `duckdb::TableCatalogEntry::ColumnsToSQL[abi:cxx11](duckdb::ColumnList const&, duckdb::vector<duckdb::unique_ptr<duckdb::Constraint, std::default_delete<duckdb::Constraint>, true>, true> const&)':
ub_duckdb_catalog_entries.cpp:(.text+0xba6e): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(ub_duckdb_func_table.cpp.o): in function `duckdb::CSVSniffFunction(duckdb::ClientContext&, duckdb::TableFunctionInput&, duckdb::DataChunk&)':
ub_duckdb_func_table.cpp:(.text+0xbc5d): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: ub_duckdb_func_table.cpp:(.text+0xc016): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(ub_duckdb_main.cpp.o): in function `duckdb::QueryProfiler::ToJSON[abi:cxx11]() const':
ub_duckdb_main.cpp:(.text+0x24378): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(ub_duckdb_operator_persistent.cpp.o): in function `duckdb::PhysicalExport::GetData(duckdb::ExecutionContext&, duckdb::DataChunk&, duckdb::OperatorSourceInput&) const':
ub_duckdb_operator_persistent.cpp:(.text+0xc422): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: ub_duckdb_operator_persistent.cpp:(.text+0xc54a): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(parquet_metadata.cpp.o): in function `duckdb::ParquetLogicalTypeToString(duckdb_parquet::format::LogicalType const&, bool)':
parquet_metadata.cpp:(.text+0x1568): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: parquet_metadata.cpp:(.text+0x15b5): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(parquet_metadata.cpp.o):parquet_metadata.cpp:(.text+0x1665): more undefined references to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()' follow
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(parquet_types.cpp.o): in function `duckdb_parquet::format::LogicalType::printTo(std::ostream&) const':
parquet_types.cpp:(.text+0x10e16): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: parquet_types.cpp:(.text+0x10f38): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: parquet_types.cpp:(.text+0x1105a): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: parquet_types.cpp:(.text+0x1117c): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: parquet_types.cpp:(.text+0x1129e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(parquet_types.cpp.o):parquet_types.cpp:(.text+0x113c0): more undefined references to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' follow
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(column_reader.cpp.o): in function `duckdb::ColumnReader::DecompressInternal(duckdb_parquet::format::CompressionCodec::type, unsigned char const*, unsigned long, unsigned char*, unsigned long)':
column_reader.cpp:(.text+0xe4c): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(column_reader.cpp.o): in function `void duckdb::BssDecoder::GetBatch<float>(unsigned char*, unsigned int)':
column_reader.cpp:(.text._ZN6duckdb10BssDecoder8GetBatchIfEEvPhj[_ZN6duckdb10BssDecoder8GetBatchIfEEvPhj]+0x4d): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: /src/deps/linux_amd64/libduckdb.a(column_reader.cpp.o): in function `void duckdb::BssDecoder::GetBatch<double>(unsigned char*, unsigned int)':
column_reader.cpp:(.text._ZN6duckdb10BssDecoder8GetBatchIdEEvPhj[_ZN6duckdb10BssDecoder8GetBatchIdEEvPhj]+0x4d): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
collect2: error: ld returned 1 exit status

So far the results have been the same regardless of what I provide to CGO_LDFLAGS, including CGO_LDFLAGS="-L/usr/lib".

I tried also on alpine with zig and the results are a lot different.

docker run --rm -e CC="zig cc -target x86_64-linux-gnu" -e CGO_ENABLED=1 -e CXX="zig c++ -target x86_64-linux-gnu" -e GOOS=linux -e GOARCH=amd64 --platform=linux/amd64 -it -v $PWD:/src --workdir=/src golang:alpine /bin/sh -c 'apk update &&
apk add zig --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing && go build -o ex ./examples'

gives me a whole bunch of undefined symbols:

...

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::sync()
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::showmanyc()
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::xsgetn(char*, long)
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::underflow()
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::uflow()
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::pbackfail(int)
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::basic_streambuf<char, std::char_traits<char>>::overflow(int)
>>> referenced by ub_duckdb_main_extension.cpp
>>>               ub_duckdb_main_extension.cpp.o:(vtable for duckdb_httplib::DataSink::data_sink_streambuf) in archive /src/deps/linux_amd64/libduckdb.a

ld.lld: error: undefined symbol: std::ostream::operator<<(short)
>>> referenced by parquet_types.cpp
>>>               parquet_types.cpp.o:(duckdb_parquet::format::RowGroup::printTo(std::ostream&) const) in archive /src/deps/linux_amd64/libduckdb.a

Any ideas what I'm doing wrong? :thinking:

marcboeker commented 9 months ago

Is there a reason why you are using golang:buster?

It runs with golang:latest pretty fine:

docker run --rm -e CGO_ENABLED=1 -e GOOS=linux -e GOARCH=amd64 --platform=linux/amd64 -it -v $PWD:/src --workdir=/src golang:latest go build -o ex ./examples

And to test the output:

docker run --rm --platform=linux/amd64 -v $(PWD):/app golang:latest /app/ex

BestNathan commented 4 months ago

Is there a reason why you are using golang:buster?

It runs with golang:latest pretty fine:

docker run --rm -e CGO_ENABLED=1 -e GOOS=linux -e GOARCH=amd64 --platform=linux/amd64 -it -v $PWD:/src --workdir=/src golang:latest go build -o ex ./examples

And to test the output:

docker run --rm --platform=linux/amd64 -v $(PWD):/app golang:latest /app/ex

hi,

I try to build my project within docker image golang:1.22.5-alpine, and it fails with lots of undefined references

I have tried golang:1.22.5 following your commands, it does work but on alpine it fails

I want to know if there is any solution solving my problem cause alpine is really smaller than ubuntu

thanks!

here is my dockerfile

FROM golang:1.22.5-alpine as build

WORKDIR /opt/nq
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache --update git make build-base

ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64
ENV GOPROXY=https://goproxy.cn
COPY go.mod go.sum go.work go.work.sum ./
RUN go mod download && go mod verify

COPY .. .

RUN go build -tags="no_duckdb_arrow" -o built/bin/nq ./cmd/nq

FROM golang:1.22.5-alpine
ARG USER_ID=10001

ENV TZ=Asia/Shanghai

WORKDIR /opt/nq

COPY --from=build /opt/nq/built /opt/nq/built
COPY --from=build /opt/nq/assets /opt/nq/assets
COPY --from=build /etc/passwd /etc/passwd

RUN adduser -u ${USER_ID} -D nq
# RUN adduser -uid ${USER_ID} nq
USER nq

RUN mkdir -p ~/.nq

CMD [ "./built/bin/nq", "--help" ]

here is output when run docker build

> [build 8/8] RUN go build -tags="no_duckdb_arrow" -o built/bin/nq ./cmd/nq:
36.80 # nq/cmd/nq
36.80 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_capi.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_main_capi.cpp:(.text+0x327): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_parser.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_parser.cpp:(.text+0x553): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_planner.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_planner.cpp:(.text+0xf2e): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_planner_expression.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_planner_expression.cpp:(.text+0x517): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_progress_bar.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_progress_bar.cpp:(.text+0xd6): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_statistics.cpp.o):ub_duckdb_storage_statistics.cpp:(.text+0x947): more undefined references to `__vsnprintf_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_statistics.cpp.o): in function `duckdb::StringStats::Update(duckdb::BaseStatistics&, duckdb::string_t const&)':
36.80 ub_duckdb_storage_statistics.cpp:(.text+0x2c5a): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: ub_duckdb_storage_statistics.cpp:(.text+0x2db5): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_table.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_storage_table.cpp:(.text+0x8652): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_transformer_statement.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_transformer_statement.cpp:(.text+0x27e): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_bind_expression.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_bind_expression.cpp:(.text+0x8fe): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_bind_query_node.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_bind_query_node.cpp:(.text+0x42e): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_bind_statement.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_bind_statement.cpp:(.text+0x6a7): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_bind_tableref.cpp.o):ub_duckdb_bind_tableref.cpp:(.text+0x337): more undefined references to `__vsnprintf_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_common.cpp.o): in function `duckdb::RemoveDirectoryRecursive(char const*) [clone .localalias]':
36.80 ub_duckdb_common.cpp:(.text+0x6acc): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_common.cpp.o): in function `duckdb::Printer::RawPrint(duckdb::OutputStream, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
36.80 ub_duckdb_common.cpp:(.text+0x74c6): undefined reference to `__fprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_common_types.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_common_types.cpp:(.text+0x1858): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_execution_index_art.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_execution_index_art.cpp:(.text+0x352): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_expression.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_expression.cpp:(.text+0x138e): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_expression_binders.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_expression_binders.cpp:(.text+0x2b7): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_func_table.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_func_table.cpp:(.text+0xaa7): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main.cpp.o):ub_duckdb_main.cpp:(.text+0x982): more undefined references to `__vsnprintf_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::detail::SocketStream::is_writable() const':
36.80 ub_duckdb_main_extension.cpp:(.text._ZNK14duckdb_httplib6detail12SocketStream11is_writableEv[_ZNK14duckdb_httplib6detail12SocketStream11is_writableEv]+0x57): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::detail::SocketStream::write(char const*, unsigned long)':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6detail12SocketStream5writeEPKcm[_ZN14duckdb_httplib6detail12SocketStream5writeEPKcm]+0x7a): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::detail::SocketStream::is_readable() const':
36.80 ub_duckdb_main_extension.cpp:(.text._ZNK14duckdb_httplib6detail12SocketStream11is_readableEv[_ZNK14duckdb_httplib6detail12SocketStream11is_readableEv]+0x57): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::detail::SocketStream::read(char*, unsigned long)':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6detail12SocketStream4readEPcm[_ZN14duckdb_httplib6detail12SocketStream4readEPcm]+0xf5): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `int duckdb_httplib::detail::create_socket<duckdb_httplib::detail::create_client_socket(char const*, char const*, int, int, bool, std::function<void (int)>, long, long, long, long, long, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, duckdb_httplib::Error&)::{lambda(int, addrinfo&)#1}>(char const*, char const*, int, int, int, bool, std::function<void (int)>, duckdb_httplib::detail::create_client_socket(char const*, char const*, int, int, bool, std::function<void (int)>, long, long, long, long, long, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, duckdb_httplib::Error&)::{lambda(int, addrinfo&)#1})':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6detail13create_socketIZNS0_20create_client_socketEPKcS3_iibSt8functionIFviEEllllllRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS_5ErrorEEUliR8addrinfoE_EEiS3_S3_iiibS6_T_[_ZN14duckdb_httplib6detail13create_socketIZNS0_20create_client_socketEPKcS3_iibSt8functionIFviEEllllllRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS_5ErrorEEUliR8addrinfoE_EEiS3_S3_iiibS6_T_]+0x379): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o):ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6detail13create_socketIZNS0_20create_client_socketEPKcS3_iibSt8functionIFviEEllllllRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS_5ErrorEEUliR8addrinfoE_EEiS3_S3_iiibS6_T_[_ZN14duckdb_httplib6detail13create_socketIZNS0_20create_client_socketEPKcS3_iibSt8functionIFviEEllllllRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS_5ErrorEEUliR8addrinfoE_EEiS3_S3_iiibS6_T_]+0x390): more undefined references to `__fdelt_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `int duckdb_httplib::detail::create_socket<duckdb_httplib::detail::create_client_socket(char const*, char const*, int, int, bool, std::function<void (int)>, long, long, long, long, long, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, duckdb_httplib::Error&)::{lambda(int, addrinfo&)#1}>(char const*, char const*, int, int, int, bool, std::function<void (int)>, duckdb_httplib::detail::create_client_socket(char const*, char const*, int, int, bool, std::function<void (int)>, long, long, long, long, long, long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, duckdb_httplib::Error&)::{lambda(int, addrinfo&)#1})':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6detail13create_socketIZNS0_20create_client_socketEPKcS3_iibSt8functionIFviEEllllllRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS_5ErrorEEUliR8addrinfoE_EEiS3_S3_iiibS6_T_[_ZN14duckdb_httplib6detail13create_socketIZNS0_20create_client_socketEPKcS3_iibSt8functionIFviEEllllllRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS_5ErrorEEUliR8addrinfoE_EEiS3_S3_iiibS6_T_]+0x796): undefined reference to `__res_init'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::ClientImpl::send(duckdb_httplib::Request&, duckdb_httplib::Response&, duckdb_httplib::Error&)':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib10ClientImpl4sendERNS_7RequestERNS_8ResponseERNS_5ErrorE[_ZN14duckdb_httplib10ClientImpl4sendERNS_7RequestERNS_8ResponseERNS_5ErrorE]+0xa95): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::ClientImpl::write_request(duckdb_httplib::Stream&, duckdb_httplib::Request&, bool, duckdb_httplib::Error&)':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE[_ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE]+0x31f): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE[_ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE]+0x422): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE[_ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE]+0x5bd): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE[_ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE]+0x7f9): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE[_ZN14duckdb_httplib10ClientImpl13write_requestERNS_6StreamERNS_7RequestEbRNS_5ErrorE]+0x8eb): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o):ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6Server19write_response_coreERNS_6StreamEbRKNS_7RequestERNS_8ResponseEb[_ZN14duckdb_httplib6Server19write_response_coreERNS_6StreamEbRKNS_7RequestERNS_8ResponseEb]+0x309): more undefined references to `__snprintf_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_extension.cpp.o): in function `duckdb_httplib::Server::process_and_close_socket(int)':
36.80 ub_duckdb_main_extension.cpp:(.text._ZN14duckdb_httplib6Server24process_and_close_socketEi[_ZN14duckdb_httplib6Server24process_and_close_socketEi]+0x104): undefined reference to `__fdelt_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_main_relation.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_main_relation.cpp:(.text+0x667): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_operator_helper.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_operator_helper.cpp:(.text+0x68d): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_optimizer_join_order.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_optimizer_join_order.cpp:(.text+0x467): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_storage.cpp:(.text+0x1083): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage.cpp.o): in function `duckdb::SerializeVersionNumber(duckdb::WriteStream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
36.80 ub_duckdb_storage.cpp:(.text+0x5cd7): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_storage_compression.cpp:(.text+0x1d87): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o): in function `duckdb::DictionaryCompressionStorage::FinalizeCompress(duckdb::CompressionState&)':
36.80 ub_duckdb_storage_compression.cpp:(.text+0x8882): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o): in function `duckdb::unique_ptr<duckdb::SegmentScanState, std::default_delete<duckdb::SegmentScanState>, true> duckdb::AlpRDInitScan<double>(duckdb::ColumnSegment&)':
36.80 ub_duckdb_storage_compression.cpp:(.text._ZN6duckdb13AlpRDInitScanIdEENS_10unique_ptrINS_16SegmentScanStateESt14default_deleteIS2_ELb1EEERNS_13ColumnSegmentE[_ZN6duckdb13AlpRDInitScanIdEENS_10unique_ptrINS_16SegmentScanStateESt14default_deleteIS2_ELb1EEERNS_13ColumnSegmentE]+0xe5): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o): in function `duckdb::unique_ptr<duckdb::SegmentScanState, std::default_delete<duckdb::SegmentScanState>, true> duckdb::AlpRDInitScan<float>(duckdb::ColumnSegment&)':
36.80 ub_duckdb_storage_compression.cpp:(.text._ZN6duckdb13AlpRDInitScanIfEENS_10unique_ptrINS_16SegmentScanStateESt14default_deleteIS2_ELb1EEERNS_13ColumnSegmentE[_ZN6duckdb13AlpRDInitScanIfEENS_10unique_ptrINS_16SegmentScanStateESt14default_deleteIS2_ELb1EEERNS_13ColumnSegmentE]+0xe5): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o): in function `void duckdb::BitpackingPrimitives::PackBuffer<unsigned int, false>(unsigned char*, unsigned int*, unsigned long, unsigned char)':
36.80 ub_duckdb_storage_compression.cpp:(.text._ZN6duckdb20BitpackingPrimitives10PackBufferIjLb0EEEvPhPT_mh[_ZN6duckdb20BitpackingPrimitives10PackBufferIjLb0EEEvPhPT_mh]+0xe1): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o): in function `duckdb::unique_ptr<duckdb::CompressionState, std::default_delete<duckdb::CompressionState>, true> duckdb::AlpRDInitCompression<float>(duckdb::ColumnDataCheckpointer&, duckdb::unique_ptr<duckdb::AnalyzeState, std::default_delete<duckdb::AnalyzeState>, true>)':
36.80 ub_duckdb_storage_compression.cpp:(.text._ZN6duckdb20AlpRDInitCompressionIfEENS_10unique_ptrINS_16CompressionStateESt14default_deleteIS2_ELb1EEERNS_22ColumnDataCheckpointerENS1_INS_12AnalyzeStateES3_IS8_ELb1EEE[_ZN6duckdb20AlpRDInitCompressionIfEENS_10unique_ptrINS_16CompressionStateESt14default_deleteIS2_ELb1EEERNS_22ColumnDataCheckpointerENS1_INS_12AnalyzeStateES3_IS8_ELb1EEE]+0x1a8): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_storage_compression.cpp.o):ub_duckdb_storage_compression.cpp:(.text._ZN6duckdb20AlpRDInitCompressionIdEENS_10unique_ptrINS_16CompressionStateESt14default_deleteIS2_ELb1EEERNS_22ColumnDataCheckpointerENS1_INS_12AnalyzeStateES3_IS8_ELb1EEE[_ZN6duckdb20AlpRDInitCompressionIdEENS_10unique_ptrINS_16CompressionStateESt14default_deleteIS2_ELb1EEERNS_22ColumnDataCheckpointerENS1_INS_12AnalyzeStateES3_IS8_ELb1EEE]+0x1a8): more undefined references to `__memcpy_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_table_func_system.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.80 ub_duckdb_table_func_system.cpp:(.text+0x1582): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(format.cc.o): in function `char* duckdb_fmt::v6::internal::sprintf_format<double>(double, duckdb_fmt::v6::internal::buffer<char>&, duckdb_fmt::v6::internal::sprintf_specs)':
36.80 format.cc:(.text._ZN10duckdb_fmt2v68internal14sprintf_formatIdEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE[_ZN10duckdb_fmt2v68internal14sprintf_formatIdEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE]+0xc7): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: format.cc:(.text._ZN10duckdb_fmt2v68internal14sprintf_formatIdEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE[_ZN10duckdb_fmt2v68internal14sprintf_formatIdEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE]+0x13a): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(format.cc.o): in function `char* duckdb_fmt::v6::internal::sprintf_format<long double>(long double, duckdb_fmt::v6::internal::buffer<char>&, duckdb_fmt::v6::internal::sprintf_specs)':
36.80 format.cc:(.text._ZN10duckdb_fmt2v68internal14sprintf_formatIeEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE[_ZN10duckdb_fmt2v68internal14sprintf_formatIeEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE]+0xc6): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: format.cc:(.text._ZN10duckdb_fmt2v68internal14sprintf_formatIeEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE[_ZN10duckdb_fmt2v68internal14sprintf_formatIeEEPcT_RNS1_6bufferIcEENS1_13sprintf_specsE]+0x141): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(format.cc.o): in function `int duckdb_fmt::v6::internal::snprintf_float<double>(double, int, duckdb_fmt::v6::internal::float_specs, duckdb_fmt::v6::internal::buffer<char>&)':
36.80 format.cc:(.text._ZN10duckdb_fmt2v68internal14snprintf_floatIdEEiT_iNS1_11float_specsERNS1_6bufferIcEE[_ZN10duckdb_fmt2v68internal14snprintf_floatIdEEiT_iNS1_11float_specsERNS1_6bufferIcEE]+0xe5): undefined reference to `__snprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(format.cc.o):format.cc:(.text._ZN10duckdb_fmt2v68internal14snprintf_floatIdEEiT_iNS1_11float_specsERNS1_6bufferIcEE[_ZN10duckdb_fmt2v68internal14snprintf_floatIdEEiT_iNS1_11float_specsERNS1_6bufferIcEE]+0x14b): more undefined references to `__snprintf_chk' follow
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(libfsst.cpp.o): in function `compressBulk(SymbolTable&, unsigned long, unsigned long*, unsigned char**, unsigned long, unsigned char*, unsigned long*, unsigned char**, bool, bool)':
36.80 libfsst.cpp:(.text+0x33a): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(libfsst.cpp.o): in function `buildSymbolTable(Counters&, std::vector<unsigned char*, std::allocator<unsigned char*> >, unsigned long*, bool)':
36.80 libfsst.cpp:(.text+0x2b19): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: libfsst.cpp:(.text+0x2bd5): undefined reference to `__memcpy_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(pg_functions.cpp.o): in function `duckdb_libpgquery::errmsg(char const*, ...)':
36.80 pg_functions.cpp:(.text+0x636): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(pg_functions.cpp.o): in function `duckdb_libpgquery::psprintf(char const*, ...)':
36.80 pg_functions.cpp:(.text+0x77c): undefined reference to `__vsnprintf_chk'
36.80 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: pg_functions.cpp:(.text+0x9af): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(re2.cc.o): in function `bool duckdb_re2::re2_internal::Parse<float>(char const*, unsigned long, float*)':
36.81 re2.cc:(.text+0x1349): undefined reference to `__memmove_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: re2.cc:(.text+0x1398): undefined reference to `__memmove_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(re2.cc.o): in function `bool duckdb_re2::re2_internal::Parse<double>(char const*, unsigned long, double*)':
36.81 re2.cc:(.text+0x1549): undefined reference to `__memmove_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: re2.cc:(.text+0x1598): undefined reference to `__memmove_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(re2.cc.o): in function `bool duckdb_re2::re2_internal::Parse<long>(char const*, unsigned long, long*, int)':
36.81 re2.cc:(.text+0x1744): undefined reference to `__memmove_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(re2.cc.o):re2.cc:(.text+0x1771): more undefined references to `__memmove_chk' follow
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(sds.cpp.o): in function `duckdb_hll::sdscatvprintf(char*, char const*, __va_list_tag*)':
36.81 sds.cpp:(.text+0x1142): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(strutil.cc.o): in function `duckdb_re2::StringAppendV(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, char const*, __va_list_tag*)':
36.81 strutil.cc:(.text+0x69): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: strutil.cc:(.text+0xcd): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(strutil.cc.o): in function `duckdb_re2::CEscape[abi:cxx11](duckdb_re2::StringPiece const&)':
36.81 strutil.cc:(.text+0x3a7): undefined reference to `__snprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_csv_scanner.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.81 ub_duckdb_csv_scanner.cpp:(.text+0x6ce): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_csv_sniffer.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.81 ub_duckdb_csv_sniffer.cpp:(.text+0x8fe): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_csv_util.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.81 ub_duckdb_csv_util.cpp:(.text+0x297): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_func_compressed_materialization.cpp.o): in function `duckdb::hugeint_t duckdb::StringCompress<duckdb::hugeint_t>(duckdb::string_t const&)':
36.81 ub_duckdb_func_compressed_materialization.cpp:(.text+0x1ca): undefined reference to `__memset_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(ub_duckdb_operator_order.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) [clone .constprop.0]':
36.81 ub_duckdb_operator_order.cpp:(.text+0x2ae): undefined reference to `__vsnprintf_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(miniz.cpp.o): in function `duckdb_miniz::mz_zip_writer_write_zeros(duckdb_miniz::mz_zip_archive*, unsigned long, unsigned int)':
36.81 miniz.cpp:(.text+0x3f2): undefined reference to `__memset_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(miniz.cpp.o): in function `duckdb_miniz::tdefl_start_dynamic_block(duckdb_miniz::tdefl_compressor*)':
36.81 miniz.cpp:(.text+0x1d70): undefined reference to `__memcpy_chk'
36.81 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.0/deps/linux_amd64/libduckdb.a(entropy_common.cpp.o): in function `duckdb_zstd::FSE_readNCount(short*, unsigned int*, unsigned int*, void const*, unsigned long) [clone .localalias]':
36.81 entropy_common.cpp:(.text+0xd6): undefined reference to `__memcpy_chk'
36.81 collect2: error: ld returned 1 exit status
36.81 
------
Dockerfile:16
--------------------
  14 |     COPY .. .
  15 |     
  16 | >>> RUN go build -tags="no_duckdb_arrow" -o built/bin/nq ./cmd/nq
  17 |     
  18 |     FROM golang:1.22.5-alpine
marcboeker commented 4 months ago

@BestNathan

Maybe this helps? It works on my Mac and I'ma able to cross compile to linux/amd64. You need to adjust it back to your settings, but the idea with FROM --platform=linux/amd64 golang:1.22 as build should do the trick.

FROM --platform=linux/amd64 golang:1.22 as build

WORKDIR /opt/nq

ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY .. .

RUN go build -tags="no_duckdb_arrow" -o /opt/nq/built ./main.go

FROM alpine:3.20.1
ARG USER_ID=10001

ENV TZ=Asia/Shanghai

WORKDIR /opt/nq

COPY --from=build /opt/nq/built /opt/nq/built
COPY --from=build /etc/passwd /etc/passwd

RUN adduser -u ${USER_ID} -D nq
RUN adduser -uid ${USER_ID} nq
USER nq

RUN mkdir -p ~/.nq

CMD [ "/opt/nq/built" ]
BestNathan commented 4 months ago

@BestNathan

Maybe this helps? It works on my Mac and I'ma able to cross compile to linux/amd64. You need to adjust it back to your settings, but the idea with FROM --platform=linux/amd64 golang:1.22 as build should do the trick.

FROM --platform=linux/amd64 golang:1.22 as build

WORKDIR /opt/nq

ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY .. .

RUN go build -tags="no_duckdb_arrow" -o /opt/nq/built ./main.go

FROM alpine:3.20.1
ARG USER_ID=10001

ENV TZ=Asia/Shanghai

WORKDIR /opt/nq

COPY --from=build /opt/nq/built /opt/nq/built
COPY --from=build /etc/passwd /etc/passwd

RUN adduser -u ${USER_ID} -D nq
RUN adduser -uid ${USER_ID} nq
USER nq

RUN mkdir -p ~/.nq

CMD [ "/opt/nq/built" ]

thanks a lot!

Still not work for me. It reported an error with "no such file or directory", and I ran sh within the image and found shared libs not found. but when these missing libs installed done, it still say "not found __res_init symbol balabala"

I found that dynamic link could build and run within alpine image, and I decided to use this solution for now.

I have learned a lot of knowledge about building with cgo these days, it is really hard for me but fun.

I will go througth this problem when I am free. If I hava any progress on this I will let you know, also I will follow this project for more information.

Thanks again for your help.