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

Remove sqlcipher linkage hack to appease Rust 1.50 (fixes SYNC-1999) #3903

Merged
merged 1 commit into from
Mar 8, 2021

Conversation

dmose
Copy link
Member

@dmose dmose commented Mar 4, 2021

So, the root cause of this problem is a regression between rustc 1.49 and 1.50 (changelog). I think it's quite likely that rust-lang/cargo#8969 was the breaking PR. There was a subsequent fix for some piece of the problem in rust-lang/cargo#9065, but that didn't fix the issue that we're seeing, which is still in rustc 1.52 nightly. (BTW, I (heart) how trivial cargo makes it to test whether a given problem still exists in the nightly version of the compiler).

I haven't tried to nail down exactly what this piece is and filed a bug in rustlang because I don't have a sense of how long that's likely to take. Furthermore, I think the cheapest way to fix this is simply to unconditionally link NSS in all cases. It will slow down our build process a bit, but I'd be surprised if it were by an interesting amount. My assumption is that doing this won't make any difference to the executable produced, since I wouldn't expect anything to be pulled in from NSS unless there are symbols missing at link to.

This is particularly compelling, because, as I understand it, we're considering getting rid of sqlcipher entirely in #960, which would just make the root issue go away. Is this correct?

Note that I'm forcing everything to 1.50 in this PR to make sure that we're sure we solve the problem we're trying to.

My plan is to remove that commit before we land, just to keep things separate. I could land them all at once, though...

I have yet to test how this fix affects build in m-c, if at all...

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • automation/all_tests.sh runs to completion and produces no failures
    • Note: For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
  • Tests: This PR includes thorough tests or an explanation of why it does not.
    • This is really just to fix stuff busted with the Rust 1.50 compiler.
  • Changelog: This PR includes a changelog entry in CHANGES_UNRELEASED.md or an explanation of why it does not need one
    • There are no user-facing changes.
    • 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 dilligence applied in selecting them.
    • No dependency changes

@dmose dmose marked this pull request as draft March 4, 2021 00:10
@dmose dmose force-pushed the sqlcipher-linkage-rust-1.50 branch 4 times, most recently from 10d0067 to 0be4338 Compare March 4, 2021 15:45
@dmose
Copy link
Member Author

dmose commented Mar 4, 2021

I assume that the reason these cargo fmt changes are required is because cargo fmt must have changed something in 1.50, otherwise, I'd expect these changes to be required on main as well. Perhaps I should split them out into a separate commit...

@dmose dmose force-pushed the sqlcipher-linkage-rust-1.50 branch from 0be4338 to 1ca7a0b Compare March 4, 2021 20:33
@dmose dmose force-pushed the sqlcipher-linkage-rust-1.50 branch 2 times, most recently from 5c4144e to afff4a2 Compare March 4, 2021 22:35
@dmose
Copy link
Member Author

dmose commented Mar 4, 2021

I can't actually tell whether it's a problem on beta or nightly. The reason is that because we seeming to be doing the builds that we use for tests and benchmarking with hard-errors on clippy warnings, the builds on those channels abort before they finish. Any idea how hard this would be to fix?

@dmose dmose requested review from mhammond and rfk March 5, 2021 00:52
@dmose
Copy link
Member Author

dmose commented Mar 5, 2021

@mhammond @rfk would love your thoughts on my proposed approach here...

@rfk
Copy link
Contributor

rfk commented Mar 5, 2021

The reason is that because we seeming to be doing the builds that we use for tests and benchmarking with
hard-errors on clippy warnings, the builds on those channels abort before they finish. Any idea how hard this would be to fix?

By "fix this" do you mean "stop the warnings from failing the build"? The magic sauce there the -D warnings in all_clippy_checks.sh.

@rfk
Copy link
Contributor

rfk commented Mar 5, 2021

I think the cheapest way to fix this is simply to unconditionally link NSS in all cases

This seems reasonable to me; if "slightly longer builds" is the only downside then it's not worth investing in any fancier, especially given longer-term plans to move away from sqlcipher.

Copy link
Contributor

@rfk rfk left a comment

Choose a reason for hiding this comment

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

r+ for the approach here; I would also support going ahead and changing 1.43 to 1.50 in the version pinning, on the understand that mozilla-central is also pinned to that version.

Copy link
Member

@mhammond mhammond left a comment

Choose a reason for hiding this comment

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

rs=me!

@dmose dmose force-pushed the sqlcipher-linkage-rust-1.50 branch from afff4a2 to d789b75 Compare March 8, 2021 19:28
@dmose dmose marked this pull request as ready for review March 8, 2021 19:32
@dmose dmose merged commit 6d1a358 into main Mar 8, 2021
@dmose dmose deleted the sqlcipher-linkage-rust-1.50 branch March 8, 2021 21:29
@dmose
Copy link
Member Author

dmose commented Mar 8, 2021

The failing sync tests are just because a live server they depend upon is down.

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