Skip to content

Conversation

krlmlr
Copy link
Collaborator

@krlmlr krlmlr commented Feb 24, 2024

I tried building an extension for both v0.9.2 and v0.10.0. It seems that this requires a different Makefile for each version. My solution was to provide a patch file to restore the v0.9.2 state before building it.

Example: https://github.com/hannes/duckdb-rfuns/blob/main/.github/0.9.2.patch, used in https://github.com/hannes/duckdb-rfuns/blob/87184f8b2ed13f99c3a102dd27f587adc4367cec/.github/workflows/MainDistributionPipeline-0.9.2.yml#L29

@krlmlr krlmlr changed the title ci: Add patch argument to patch the extension's sources before building [CI] Add patch argument to patch the extension's sources before building Feb 24, 2024
@carlopi
Copy link
Contributor

carlopi commented Feb 24, 2024

Thanks!

I will check with @samansmink what's the path forward for extensions, in general more complex ones are sort of assumed to be hard to be maintainable for both v0.10.0 and v0.9.2, but that might not be true for all relevant extensions and going forward we need anyway a path for supporting multiple duckdb versions.

duckdb_spatial has an experiment running where 2 different branches of the extension (each tied to a different duckdb version), and binaries are built for either duckdb_spatial on branch main + duckdb on branch main OR duckdb_spatial on branch v0.10.0 with duckdb on tag v0.10.0. (with branch v0.10.0 being basically main + the diff)

Also somehow connected, it would be cool to have an explicit policy on what duckdb versions are expected to be supported (or we are going to support), and for the moment I guess it's only v0.10.0 (without putting effort in updating for v0.9.2) but that will need to adapt moving forward.

Minor feedback is that elsewhere we use git apply instead of patch, so maybe for uniformity that could be considered.

Copy link
Contributor

@samansmink samansmink left a comment

Choose a reason for hiding this comment

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

TLDR; i'm fine with adding patching to the reusable workflow, but I think it should probably be used sparingly

The reason we have patching in other places is to basically have a "poor man's monorepo" where breaking changes can be pushed to DuckDB along with the required changes to extension or duckdb-wasm. Patching by itself should only be used sparingly I feel because the patches are kind of annoying to read and handle.

Also, I feel we should not push extension developers into supporting multiple stable duckdb versions at the same time at all. We do not strive to support that with our current extension API. I think duckdb's extension API should strive to have 2 ways of building extensions:

  • Unstable C++ extension API where you can hook into duckdb wherever you want, however you want. (this is the current extension template).
  • Stable C extension API which allows using a duckdb extension across multiple duckdb releases.

As part of implementing an extension against the C++ API, I think developers should strive to avoid the combinatorial explosion of trying to maintain the extension for the latest x stable duckdb versions.

Finally, I think this can also be achieved by creating separate branches in the extension repo, although admittedly that could be more work to maintain.

@carlopi
Copy link
Contributor

carlopi commented Feb 27, 2024

Agree with @samansmink, this is not ideal / recommended, but on the other side provide a clean way out. I think this can go in

@Mytherin
Copy link
Collaborator

Thanks - could you just resolve the merge conflict?

@github-actions github-actions bot marked this pull request as draft March 3, 2024 19:09
@krlmlr
Copy link
Collaborator Author

krlmlr commented Mar 3, 2024

Done. I have a slight preference for patch because it will also accept non-Git patches. Even if I'm not sure when this ever will be an issue.

@krlmlr krlmlr marked this pull request as ready for review March 3, 2024 19:22
@carlopi
Copy link
Contributor

carlopi commented Mar 3, 2024

In the meantime, this files have been mirrored to https://github.com/duckdb/extension-ci-tools/tree/main/.github/workflows, and will be eventually discontinued from here. Plan is to move it there, so when this go in we should remember to port the changes also there.

@Mytherin Mytherin merged commit c34047c into duckdb:main Mar 10, 2024
@Mytherin
Copy link
Collaborator

Thanks

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Mar 17, 2024
Merge pull request duckdb/duckdb#11072 from Mytherin/parquetprogress
Merge pull request duckdb/duckdb#10707 from Mause/bugfix/jdbc-get-time
Merge pull request duckdb/duckdb#10831 from krlmlr/f-ext-patch
Merge pull request duckdb/duckdb#11070 from mariotaddeucci/code-quality-pep8-compliant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants