Comments (6)
I'm happy to hear that. We'd be happy to submit a PR for you to test and will try to prioritise it within a few weeks.
from go-duckdb.
Hi @begelundmuller,
thank you for reaching out and thanks for you kind words. Go DuckDB is made possible by many different contributors.
The idea sounds great to me. Especially if we can drop an external dependency. I think we have to test this and see if it works on all major the platforms (macOS, Linux and Windows).
Would it be OK for you, if you submit a PR and we test drive it?
Thanks in advance!
from go-duckdb.
This has now been merged: #40
The PR also includes pre-compiled static libraries inspired by https://github.com/rogchap/v8go. This means that on supported platforms, you get static binaries without having to wait for DuckDB to compile from source.
from go-duckdb.
@begelundmuller could you explain why having a single source file makes it easier to statically link? I thought this would not matter since in both cases (single vs multiple source files) you end up with a single archive file (.a)? But indeed I am unable to statically link the libduckdb_static.a
file duckdb produces when I build it from source, while the archive file produced from the single file links statically without a problem.
I would like to understand why this is the case.
from go-duckdb.
Hey @LasseJacobs, you're right that simply having one source file instead of multiple source files does not itself make a difference to our ability to compile from source or statically link an archive.
The DuckDB amalgamation is convenient because DuckDB is an extensive project with many source files and dependencies. Their build process requires CMake and might change at any time. The point of the amalgamation is to reduce this complexity to a single file with no dependencies that can be compiled using just a C++ compiler.
So by using the amalgamation, we both reduce build complexity and get a "contract" with the DuckDB project that's less likely to break. In fact, the amalgamation is published as part of every release, so we just pull it from their release artifacts.
Now about the static library, you're right that DuckDB outputs a libduckdb_static.a
file when you compile it from source. I actually investigated using that instead of building the static libraries from the amalgamation. However, it turns out that libduckdb_static.a
doesn't include DuckDB's dependencies, which are compiled as separate archive files (you can find them in the build output if you search for .a
files). You have to statically link all of them (in the right order) to make it work – which would tie us into DuckDB's current build setup, which is likely to change.
Therefore, it felt safer to just compile the amalgamation to a static library ourselves (it's not that complicated). If DuckDB ever decides to publish static libraries as part of their release artifacts (currently they only publish shared libraries), I would probably reconsider this.
from go-duckdb.
@begelundmuller very clear now! Thanks.
from go-duckdb.
Related Issues (20)
- Exposing filesystem interface HOT 1
- Make Apache Arrow Optional HOT 2
- Add support for the DATE type in the appender
- Does `go-duckdb` has a glibc version dependency? HOT 4
- Silent primary key violation in the appender HOT 2
- Appending a NULL in UUID[] column panics HOT 1
- found architecture 'arm64', required architecture 'x86_64' on mac os HOT 3
- libduckdb.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 HOT 2
- Info: Deploying go-duckdb In A Distroless Docker Container
- DuckDB version mismatch in v1.6.5 release HOT 1
- Auto-load / auto-install in go-duckdb? And packaging JSON? HOT 1
- Cannot run duckdb v1.6.6 . Apache arrow lib broken HOT 1
- macos `go run` works but unable to execute the output of `go build` HOT 3
- Proposal: Support better error messages HOT 2
- How to cross-compile an application which uses DuckDB? HOT 2
- how to use duckdb_vss? HOT 2
- Appender performance hangs (> 10 minutes) when flushing HOT 4
- Upgrade arrow from v14 to v15?
- How to solve concurrent read and write without affecting each other,This is a big problem for me, please help me HOT 2
- Appender Not working. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-duckdb.