Skip to content

Try and replace the vortex submodule with a staticlib - #91

Merged
myrrc merged 5 commits into
mainfrom
adamg/replace-submodule-with-staticlib
Jun 19, 2026
Merged

Try and replace the vortex submodule with a staticlib#91
myrrc merged 5 commits into
mainfrom
adamg/replace-submodule-with-staticlib

Conversation

@AdamGS

@AdamGS AdamGS commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This is the other size of vortex-data/vortex#8494. Bumps the build to the last Vortex commit as of this PR.

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
@AdamGS
AdamGS requested review from 0ax1 and myrrc June 18, 2026 15:00
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Comment thread rust-toolchain.toml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mirror the linked Vortex toolchain file, in case its load bearing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this should never matter, as we don't rely linking Rust code from diff repos on an ABI level, but only ever the C ABI.

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
AdamGS added a commit to vortex-data/vortex that referenced this pull request Jun 18, 2026
#8494)

## Summary

Turns out, if you mark a crate as "staticlib", it will always build the
static library, even if you try and pull it as a rust dependency (Like
we do for `vortex-duckdb` in `vortex-sqllogictest` and benchmarks).
This PR splits the `vortex-duckdb` crate into two:
1. The core stays in `vortex-duckdb`, which is now a plain old "rlib".
2. A new `vortex-extension` crate that is a "staticlib", which is in the
`duckdb-vortex` repo
(vortex-data/duckdb-vortex#91).
3. 
This saves about **1GB* per build of `vortex-duckdb`.

---------

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>

@myrrc myrrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the typing here? Also, please update the README with description how we depend on Vortex, and what to change if you want a local checkout (link to Cargo.toml)?

Comment thread src/vortex_extension.cpp

extern "C" {
DUCKDB_EXTENSION_API void vortex_init(duckdb::DatabaseInstance &db) {
vortex_init_rust(reinterpret_cast<duckdb_database>(&db));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have access to duckdb C API here, let's use duckdb_database.

crate-type = ["staticlib", "cdylib"]

[dependencies]
vortex-duckdb = { git = "https://github.com/vortex-data/vortex.git", rev = "b68abbb68427ed545dbd18ee3b383f78d9c34d43" }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a commented vortex-duckdb entry pointing to local directory with comment "This is how you can use local vortex checkout"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a cargo thing but you can point to a local path with path = ...

Comment thread CMakeLists.txt
CRATES vortex-duckdb
MANIFEST_PATH vortex-extension/Cargo.toml
CRATES vortex-extension
CRATE_TYPES ${VORTEX_LIB_TYPE}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this still work with shared vortex build?

crate-type = ["staticlib", "cdylib"]

[dependencies]
vortex-duckdb = { git = "https://github.com/vortex-data/vortex.git", rev = "b68abbb68427ed545dbd18ee3b383f78d9c34d43" }

@0ax1 0ax1 Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally revs are only ever tagged commits. tag = "v0.47.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course, just need to wait for a release.

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
@AdamGS
AdamGS requested review from 0ax1 and myrrc June 18, 2026 16:36
[lib]
name = "vortex_duckdb"
path = "src/lib.rs"
crate-type = ["staticlib", "cdylib"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the commit title kinda suggests we only build a staticlib? Might fine tune the PR/commit title here.

@myrrc myrrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you verified it works with USE_SHARED_VORTEX=1, LGTM

@AdamGS

AdamGS commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

One thing left here, we will merge this tomorrow.

@myrrc
myrrc merged commit f22fc51 into main Jun 19, 2026
14 checks passed
@myrrc
myrrc deleted the adamg/replace-submodule-with-staticlib branch June 19, 2026 14:12
github-actions Bot pushed a commit that referenced this pull request Jun 19, 2026
* Try and replace the vortex submodule with a staticlib

Signed-off-by: Adam Gutglick <adam@spiraldb.com>

* toolchain

Signed-off-by: Adam Gutglick <adam@spiraldb.com>

* fastlanes debug symbols

Signed-off-by: Adam Gutglick <adam@spiraldb.com>

* cargo fix

Signed-off-by: Adam Gutglick <adam@spiraldb.com>

* CR

Signed-off-by: Adam Gutglick <adam@spiraldb.com>

---------

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
(cherry picked from commit f22fc51)
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

Successfully merging this pull request may close these issues.

3 participants