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

[ci full] Trying to untangle rusqlite feature flags #5944

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion automation/emit_coverage_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ cargo +nightly run -p sync-test || true
cargo +nightly run -p protobuf-gen -- tools/protobuf_files.toml || true
cargo +nightly run -p systest || true

env RUSTFLAGS="--cfg __appsvc_ci_hack $RUSTFLAGS" cargo +nightly test --all --all-features --no-fail-fast || true
env RUSTFLAGS="--cfg __appsvc_ci_sqlite_hack $RUSTFLAGS" cargo +nightly test --all --all-features --no-fail-fast || true
7 changes: 4 additions & 3 deletions automation/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,12 @@ def print_rust_environment():

def calc_rust_env(package, features):
if features == RustFeatures.ALL:
# nss-sys's --features handling is broken. Workaround it by using a
# custom --cfg. This shouldn't be this way!
# Anything needing special support for sqlite might fail to link it.
# `--all-features` in CI (notably nss-sys via rc_crypto) hits this.
# This shouldn't be this way!
return {
**os.environ,
'RUSTFLAGS' : "--cfg __appsvc_ci_hack"
'RUSTFLAGS' : "--cfg __appsvc_ci_sqlite_hack"
}
else:
return None
Expand Down
5 changes: 4 additions & 1 deletion components/as-ohttp-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ uniffi = "0.24.1"
thiserror = "1.0"
bhttp = "0.3"
parking_lot = "0.12"
rusqlite = { version = "0.29.0", features = ["bundled"] }
rusqlite = "0.29.0"

[dependencies.ohttp]
version = "0.4"
Expand All @@ -23,5 +23,8 @@ git = "https://github.com/martinthomson/ohttp.git"
rev = "fc3f4c787d1f6a6a87bf5194f7152cc906b02973"
features = ["client", "server", "app-svc", "external-sqlite"]

[dev-dependencies]
rusqlite = { version = "0.29.0", features = ["bundled"] }

[build-dependencies]
uniffi = { version = "0.24.1", features=["build"]}
7 changes: 2 additions & 5 deletions components/autofill/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ thiserror = "1.0"
types = { path = "../support/types" }
uniffi = "0.24.1"
url = { version = "2.2", features = ["serde"] }

[dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "bundled", "serde_json", "unlock_notify"]
rusqlite = { version = "0.29.0", features = ["functions"] }

[dev-dependencies]
env_logger = { version = "0.7", default-features = false }
libsqlite3-sys = "0.26.0"
rusqlite = { version = "0.29.0", features = ["bundled"] }

[build-dependencies]
nss_build_common = { path = "../support/rc_crypto/nss/nss_build_common" }
Expand Down
6 changes: 2 additions & 4 deletions components/logins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"
thiserror = "1.0"
anyhow = "1.0"
uniffi = "0.24.1"

[dependencies.rusqlite]
version = "0.29.0"
features = ["limits", "unlock_notify"]
rusqlite = "0.29.0"

[build-dependencies]
uniffi = { version = "0.24.1", features = ["build"] }
rusqlite = { version = "0.29.0", features = ["bundled"] }

[dev-dependencies]
more-asserts = "0.2"
Expand Down
6 changes: 2 additions & 4 deletions components/places/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"
thiserror = "1.0"
anyhow = "1.0"
uniffi = "0.24.1"

[dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "window", "bundled", "unlock_notify"]
rusqlite = { version = "0.29.0", features = ["functions", "window"] }

[dev-dependencies]
pretty_assertions = "0.6"
tempfile = "3.1"
env_logger = {version = "0.7", default-features = false}
rusqlite = { version = "0.29.0", features = ["bundled"] }
sql-support = { path = "../support/sql" }

[build-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion components/push/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bincode = "1.2"
lazy_static = "1.4"
base64 = "0.21"
log = "0.4"
rusqlite = { version = "0.29.0", features = ["bundled", "unlock_notify"] }
rusqlite = "0.29.0"
url = "2.2"
viaduct = { path = "../viaduct" }
error-support = { path = "../support/error" }
Expand All @@ -24,6 +24,7 @@ uniffi = "0.24.1"
types = { path = "../support/types" }

[build-dependencies]
rusqlite = { version = "0.29.0", features = ["bundled"] }
uniffi = { version = "0.24.1", features = ["build"] }

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion components/suggest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interrupt-support = { path = "../support/interrupt" }
once_cell = "1.5"
parking_lot = ">=0.11,<=0.12"
remote_settings = { path = "../remote_settings" }
rusqlite = { version = "0.29.0", features = ["functions", "bundled"] }
rusqlite = { version = "0.29.0", features = ["functions"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sql-support = { path = "../support/sql" }
Expand All @@ -26,6 +26,7 @@ env_logger = { version = "0.7", default-features = false }
expect-test = "1.4"
hex = "0.4"
rc_crypto = { path = "../support/rc_crypto" }
rusqlite = { version = "0.29.0", features = ["bundled"] }

[build-dependencies]
uniffi = { version = "0.24.1", features = ["build"] }
3 changes: 2 additions & 1 deletion components/support/guid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MPL-2.0"
edition = "2021"

[dependencies]
rusqlite = { version = "0.29.0", optional = true, features = ["bundled"] }
rusqlite = { version = "0.29.0", optional = true }
serde = { version = "1", optional = true }
rand = { version = "0.8", optional = true }
base64 = { version = "0.21", optional = true }
Expand All @@ -20,3 +20,4 @@ default = ["serde_support"]

[dev-dependencies]
serde_test = "1"
rusqlite = { version = "0.29.0", features = ["bundled"] }
6 changes: 3 additions & 3 deletions components/support/interrupt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
lazy_static = "1.4"
parking_lot = ">=0.11,<=0.12"
rusqlite = { version = "0.29.0", features = ["functions"] }

[dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "limits", "bundled", "unlock_notify"]
[dev-dependencies]
rusqlite = { version = "0.29.0", features = ["bundled"] }
2 changes: 0 additions & 2 deletions components/support/rc_crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ nss = { path = "nss" }
hawk = { version = "3.2", default-features = false, optional = true }
ece = { version = "2.1", default-features = false, features = ["serializable-keys"], optional = true }

[dev-dependencies]

[dev-dependencies.ece]
version = "2.0"
default-features = false
Expand Down
7 changes: 5 additions & 2 deletions components/support/rc_crypto/nss/nss_sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
mod bindings;
pub use bindings::*;

// So we link against the SQLite lib imported by parent crates
// We need a sqlite - so we link against the SQLite lib imported by parent crates
// such as places and logins.
// But the "gecko" feature is confusingly different - we rely on an external linker
// to put the bits together. `__appsvc_ci_sqlite_hack`` works around `--all-features`
// errors in CI, where linker-related build failures are unavoidable.
#[allow(unused_extern_crates)]
#[cfg(any(not(feature = "gecko"), __appsvc_ci_hack))]
#[cfg(any(not(feature = "gecko"), __appsvc_ci_sqlite_hack))]
extern crate libsqlite3_sys;
6 changes: 2 additions & 4 deletions components/support/sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ ffi-support = "0.4"
thiserror = "1.0"
tempfile = "3.1.0"
prettytable-rs = { version = "0.10", optional = true }

[dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "limits", "bundled", "unlock_notify"]
rusqlite = { version = "0.29.0", features = ["functions", "limits"] }

[dev-dependencies]
env_logger = {version = "0.7", default-features = false}
rusqlite = { version = "0.29.0", features = ["bundled"] }

[build-dependencies]
nss_build_common = { path = "../rc_crypto/nss/nss_build_common" }
6 changes: 3 additions & 3 deletions components/support/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
serde = "1"
serde_derive = "1"
serde_json = "1"
rusqlite = "0.29.0"

[dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "bundled"]
[dev-dependencies]
rusqlite = { version = "0.29.0", features = ["bundled"] }
3 changes: 3 additions & 0 deletions components/sync15/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ viaduct = { path = "../viaduct", optional = true }

[dev-dependencies]
env_logger = { version = "0.7", default-features = false }
# rc_cryto needs nss, which needs sqlite...
rusqlite = { version = "0.29.0", features = ["bundled"] }


[build-dependencies]
uniffi = { version = "0.24.1", features = ["build"] }
3 changes: 2 additions & 1 deletion components/tabs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ error-support = { path = "../support/error" }
interrupt-support = { path = "../support/interrupt" }
lazy_static = "1.4"
log = "0.4"
rusqlite = { version = "0.29.0", features = ["bundled", "unlock_notify"] }
rusqlite = "0.29.0"
serde = "1"
serde_derive = "1"
serde_json = "1"
Expand All @@ -25,6 +25,7 @@ url = "2.1" # mozilla-central can't yet take 2.2 (see bug 1734538)

[dev-dependencies]
env_logger = { version = "0.8.0", default-features = false, features = ["termcolor", "atty", "humantime"] }
rusqlite = { version = "0.29.0", features = ["bundled"] }
tempfile = "3.1"

[build-dependencies]
Expand Down
12 changes: 3 additions & 9 deletions components/webext-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,13 @@ sql-support = { path = "../support/sql" }
sync15 = {path = "../../components/sync15", features=["sync-engine"]}
sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"] }
url = { version = "2.1", features = ["serde"] }

[dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "bundled", "serde_json", "unlock_notify"]
rusqlite = { version = "0.29.0",features = ["functions", "serde_json"] }

[dev-dependencies]
env_logger = { version = "0.7", default-features = false }
tempfile = "3"
# A *direct* dep on the -sys crate is required for our build.rs
# to see the DEP_SQLITE3_LINK_TARGET env var that cargo sets
# on its behalf.
libsqlite3-sys = "0.26.0"
rusqlite = { version = "0.29.0", features = ["bundled"] }
sql-support = { path = "../support/sql" }
tempfile = "3"

[build-dependencies]
nss_build_common = { path = "../support/rc_crypto/nss/nss_build_common" }
13 changes: 0 additions & 13 deletions components/webext-storage/build.rs

This file was deleted.

3 changes: 3 additions & 0 deletions components/webext-storage/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ serde_json = "1"

[dependencies.webext-storage]
path = ".."

[dev-dependencies]
rusqlite = { version = "0.29.0", features = ["bundled"] }
2 changes: 1 addition & 1 deletion examples/autofill-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fxa-client = { path = "../../components/fxa-client" }
error-support = { path = "../../components/support/error" }
interrupt-support = { path = "../../components/support/interrupt" } # XXX - should be removed once we do interrupts correctly!
log = "0.4"
rusqlite = {version = "0.29.0", features = ["functions", "bundled", "serde_json", "unlock_notify"]}
rusqlite = {version = "0.29.0", features = ["bundled"]}
serde_json = "1"
sql-support = { path = "../../components/support/sql" }
structopt = "0.3"
Expand Down
5 changes: 1 addition & 4 deletions examples/places-autocomplete/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ clap = "2.33"
tempfile = "3.1"
rand = "0.8"
find-places-db = "0.2"

[dev-dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "bundled"]
rusqlite = { version = "0.29.0", features = ["bundled"] }

# While we don't have a replacement for termion on Windows yet (and thus
# our example doesn't work on Windows), it does get further in the compilation
Expand Down
5 changes: 1 addition & 4 deletions examples/sync-pass/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ tempfile = "3"
serde_json = "1.0"
url = "2.2"
viaduct-reqwest = { path = "../../components/support/viaduct-reqwest" }

[dev-dependencies.rusqlite]
version = "0.29.0"
features = ["limits"]
rusqlite = { version = "0.29.0", features = ["bundled"] }
6 changes: 6 additions & 0 deletions megazords/full/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ crashtest = { path = "../../components/crashtest" }
error-support = { path = "../../components/support/error" }
suggest = { path = "../../components/suggest" }

# This is a bit of a mess. It appears we get rusqlite=bundled as a side-effect of
# none of the rc_crypto consumers *not* using the `gecko` feature in that crate.
# If we wanted to *avoid* the bundled sqlite here we'd need to use the `in_gecko` feature of rusqlite.
# In an ideal world, it seems we should be required to use `features=["bundled]` for rusqlite here.
# (But for now we want to ship our sqlite for Android, so don't need to do anything here currently)

lazy_static = "1.4"
3 changes: 3 additions & 0 deletions megazords/ios-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ sync15 = {path = "../../components/sync15"}
error-support = { path = "../../components/support/error" }
sync_manager = { path = "../../components/sync_manager" }
as-ohttp-client = { path = "../../components/as-ohttp-client" }

# For iOS we *do not* want to ship sqlite.
rusqlite = { version = "0.29.0", features=["in_gecko"] }
5 changes: 1 addition & 4 deletions testing/separated/places-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@ url = "2.2"
dogear = "0.4"
tempfile = "3.1"
env_logger = { version = "0.7", default-features = false }

[dev-dependencies.rusqlite]
version = "0.29.0"
features = ["functions", "bundled"]
rusqlite = { version = "0.29.0", features = ["bundled"] }
Loading