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

build: upgrade rusqlite 0.31 → 0.33 #6566

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ErichDonGubler
Copy link
Contributor

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Branch builds: add [firefox-android: branch-name] to the PR title.

@ErichDonGubler
Copy link
Contributor Author

Context: This is part of landing an upgrade to hashbrown that affects a lot of crates in mozilla-central. I'm hoping the migration isn't too bad. 😅

@mhammond
Copy link
Member

This will require bumping libsqlite3-sys to the matching version, which appears to be "0.31.0"

@ErichDonGubler ErichDonGubler force-pushed the rusqlite-0.33 branch 2 times, most recently from 8f9d20e to 28562d4 Compare January 24, 2025 02:56
@ErichDonGubler
Copy link
Contributor Author

ErichDonGubler commented Jan 24, 2025

Hmm, this PR might not be able to land for a while. I see that bindgen is using unsafe extern "C" blocks now, and that requires Rust 1.82 or later, but mozilla-central permits a minimum Rust version of 1.78 1.76.

I also see that cc is failing when I attempt to compile upstream, because some compile flags for swgl are being rejected. So, we might have to figure out regressions there, too, before this could ever land.

CC @glandium for his thoughts here; unless we can bump the MSRV in mozilla-central sometime soon, perhaps I should save this PR for later, and focus my efforts on pushing back the tide of new dependencies showing up in WGPU (which is what is motivating my effort here).

CC @cwfitzgerald, @jimblandy, just for 👀.

@ErichDonGubler
Copy link
Contributor Author

@mhammond: I've gotten dependencies to resolve now! Now I just need to figure out how to please CI:

  • I'm regenerating license statements for check-dependencies now, so I expect to resolve that soon.
  • ios-test is not a failure I understand immediately how to investigate or resolve. Help please? 🥺
  • run-tests-min-supported, as hinted at earlier, is failing because the MSRV is now at least Rust 1.82 (unless I'm missing something). We can't reasonably update this until mozilla-central accommodates it.

@glandium
Copy link
Contributor

permits a minimum Rust version of 1.78.

Correction, it's 1.76 currently. It's bumpable, but I would also argue that bindgen should not force a MSRV onto people.

@glandium
Copy link
Contributor

I don't see a bindgen change in your patch, though, so why would it start relying on 1.82 features out of the blue?

@glandium
Copy link
Contributor

This comes down to rust-lang/rust-bindgen#3052

@glandium
Copy link
Contributor

Note that if you don't touch bindgen on central, you won't be affected.

@glandium
Copy link
Contributor

Ah, it's the pre-generated bindings for libsqlite3-sys that cause problems.

@glandium
Copy link
Contributor

Opened rusqlite/rusqlite#1625.

@ErichDonGubler
Copy link
Contributor Author

ErichDonGubler commented Jan 24, 2025

I'm able to re-compile mozilla-central after consuming this PR and a re-vendor of WGPU, but not finish linking, because I'm getting this error:

 5:00.95 ld64.lld: error: undefined symbol: sqlite3_errstr
 5:00.95 >>> referenced by error.rs:437 (src/error.rs:437)
 5:00.95 >>>               ../../../aarch64-apple-darwin/debug/libgkrust.a(rusqlite-fa600251d69def8f.rusqlite.bd85c6928a5dc42e-cgu.01.rcgu.o):(symbol rusqlite::error::error_from_handle::h50c200c37b7525f5+0x40)
 5:00.95 >>> referenced by error.rs:437 (src/error.rs:437)
 5:00.95 >>>               ../../../aarch64-apple-darwin/debug/libgkrust.a(rusqlite-fa600251d69def8f.rusqlite.bd85c6928a5dc42e-cgu.01.rcgu.o):(symbol rusqlite::error::error_with_offset::h29158ae33ad0622d+0x194)
 5:00.98 clang++: error: linker command failed with exit code 1 (use -v to see invocation)
 5:00.98 make[4]: *** [../../../dist/bin/XUL] Error 1
 5:00.98 make[3]: *** [toolkit/library/build/target] Error 2

Unfortunately, I'm unfamiliar enough with how libsqlite3-sys and its bundled feature should work that I'm not sure where to start debugging yet.

@ErichDonGubler
Copy link
Contributor Author

ErichDonGubler commented Jan 24, 2025

@glandium: Unfortunately, the maintainer of cc has marked that bug with an invalid tag. It seems unlikely that we will persuade them to revert that change. 🫤

Opened rusqlite/rusqlite#1625.

Given this and that rusqlite is starting to use #[expect(…) (like WGPU has been hoping to), perhaps this is a strong enough reason to bump mozilla-central?

@glandium
Copy link
Contributor

Add the missing symbol to third_party/sqlite3/src/sqlite.symbols

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