Skip to content

Conversation

Kayrnt
Copy link
Contributor

@Kayrnt Kayrnt commented Jul 29, 2023

This is required to build the extension against latest DuckDB version (v0.8.2-dev2278)
Don't forget to do a make pull to retrieve the updated git submodule of DuckDB

@@ -36,13 +38,13 @@ clean:

# Main build
debug:
mkdir -p build/debug && \
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DEXTENSION_STATIC_BUILD=1 -DCMAKE_BUILD_TYPE=Debug ${BUILD_FLAGS} -S ./duckdb/ -B build/debug && \
mkdir -p build/debug && \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-DEXTENSION_STATIC_BUILD=1 is already in the ${BUILD_FLAGS} so it's just a clean up

Comment on lines +26 to +28
EXT_NAME="odbc_scanner"
EXT_NAME_UPPERCASE=$(shell echo $(EXT_NAME) | tr '[:lower:]' '[:upper:]')
EXTENSION_FLAGS=-DDUCKDB_EXTENSION_NAMES=${EXT_NAME} -DDUCKDB_EXTENSION_${EXT_NAME_UPPERCASE}_PATH="$(PROJ_DIR)" -DDUCKDB_EXTENSION_${EXT_NAME_UPPERCASE}_SHOULD_LINK="TRUE" -DDUCKDB_EXTENSION_${EXT_NAME_UPPERCASE}_LOAD_TESTS="FALSE" -DDUCKDB_EXTENSION_${EXT_NAME_UPPERCASE}_INCLUDE_PATH="$(PROJ_DIR)src/include"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I extracted the odbc_scanner string to reuse it the way DuckDB parse it in its CMake
The actual changes are:

  • DDUCKDB_OOT_EXTENSION -> DDUCKDB_EXTENSION
  • new required flag -DDUCKDB_EXTENSION_${EXT_NAME_UPPERCASE}_LOAD_TESTS="FALSE" (I don't know we want it false or not, but at least it works)

@@ -75,7 +75,7 @@ to the correct version of `unixodbc`.

```shell
nix run .#build
./build/release/duckdb
./build/release/duckdb -unsigned
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not required but I thought it was relevant as we are going to load the unsigned extension later on

@rupurt
Copy link
Owner

rupurt commented Jul 30, 2023

Looking good. I'm getting this error when building on Linux.

error: cannot coerce a set to a string

       at /nix/store/caa9n4b3za154sl4lajq870lv7cfcrbq-nixpkgs-with-glibc-2.35-224/lib/strings.nix:160:38:

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.

2 participants