Skip to content

Conversation

iamjpotts
Copy link
Contributor

Does your PR solve an issue?

Resolves this cargo warning:

warning: ./Cargo.toml: file `./tests/sqlite/macros.rs` found to be present in multiple build targets:
  * `integration-test` target `sqlite-macros`
  * `integration-test` target `sqlite-unbundled-macros`

Merges the two target definitions in Cargo.toml and moves the sqlite vs sqlite-unbundled feature check to the top of the macros.rs module.

Is this a breaking change?

No; only affects test target configuration.

@iamjpotts iamjpotts force-pushed the jp/sqlite-macros-integration-test-targets branch from 93a1dbd to f1ee6df Compare August 22, 2025 03:52
@iamjpotts iamjpotts marked this pull request as ready for review August 22, 2025 04:06
Cargo.toml Outdated
name = "sqlite-unbundled-macros"
path = "tests/sqlite/macros.rs"
required-features = ["sqlite-unbundled", "macros"]
required-features = ["macros"] # Also requires either sqlite or sqlite-unbundled
Copy link
Collaborator

@abonander abonander Aug 25, 2025

Choose a reason for hiding this comment

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

There's a pseudo-feature specifically for this:

Suggested change
required-features = ["macros"] # Also requires either sqlite or sqlite-unbundled
required-features = ["_sqlite", "macros"] # Also requires either sqlite or sqlite-unbundled

I think sometime in the future we could change it to sqlite-bundled and sqlite-unbundled (or maybe sqlite-bindgen), and then the sqlite feature just enables libsqlite3-sys without any linkage features.

The blocker on that is that the pre-generated bindings libsqlite3-sys uses by default are based on SQLite 3.14, but we unconditionally depend on sqlite3_prepare_v3() which wasn't added until 3.20: https://www.sqlite.org/changes.html#version_3_20_0

If they would be amenable to adding a min_sqlite_version_3_20 feature, or a prepare-v3 feature, I think we could make it work out-of-the-box.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines 1 to 2
#![cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))]

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#![cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))]

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
…d of #![cfg(...)] in the module

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
@iamjpotts iamjpotts force-pushed the jp/sqlite-macros-integration-test-targets branch from f1ee6df to 16eb3b6 Compare August 25, 2025 22:08
@iamjpotts
Copy link
Contributor Author

Made both adjustments to use _sqlite feature; warning is still fixed.

@abonander abonander merged commit 99ec419 into launchbadge:main Aug 25, 2025
104 checks passed
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