Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlx-cli: Divergence between versions: cargo binstall vs cargo install #259

Open
s373r opened this issue Aug 5, 2024 · 5 comments
Open

Comments

@s373r
Copy link

s373r commented Aug 5, 2024

While recently investigating the error, I concluded that something was wrong with the compiled version of sqlx-cli.

In brief:

### binstall
cargo binstall sqlx-cli -y --force

sqlx database create --database-url sqlite://test.sqlite.db
# error: error returned from database: (code: 14) unable to open database file

################################################################################

### install
cargo install sqlx-cli --force

sqlx database create --database-url sqlite://test.sqlite.db
# no errors

I'd be happy to help with testing, research if needed

@NobodyXu
Copy link
Member

NobodyXu commented Aug 6, 2024

I think it might be related to the features enabled?

https://docs.rs/crate/sqlx-cli/latest/features

@s373r
Copy link
Author

s373r commented Aug 6, 2024

I thought so too at first, but sqlite is the default enabled feature -- and if features are not explicitly specified in cargo install (which is our case), the default features will be used by default.

@NobodyXu
Copy link
Member

NobodyXu commented Aug 6, 2024

I think it's related to rusqlite

If --features=bundled is enabled, the vendored source of SQLite will be compiled and linked in. SQLite is in the public domain, as described here.

AFAIK the bundled isn't enabled, so sqlx just linked to our system-wide libsqlite3.

That might be the reason for it.

I checked its doc, I didn't find any environment for forcing vendor, only found SQLITE3_STATIC

So it'd be great if sqlx can have a vendored feature to vendor everything, I could enable it in quickinstall.

@s373r
Copy link
Author

s373r commented Aug 7, 2024

[dependencies.libsqlite3-sys]
version = "0.30.1"
default-features = false
features = [
    "pkg-config",
    "vcpkg",
    "bundled",
    "unlock_notify"
]

(c) source

it looks like a bundled version is being used...

--

Also of note is this ticket (discussion): launchbadge/sqlx#191 , which asks for sqlx to be able to build with system-wide libsqlite.

@s373r
Copy link
Author

s373r commented Oct 16, 2024

Update: the issue mentioned above has been finished, but there has been no sqlx release yet

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

No branches or pull requests

2 participants