Dynamicer builds (#13074)
Fixes https://github.com/zed-industries/zed/issues/13073 Note that, contrary to the issue's text, we're still shipping a statically bundled sqlite3 after this PR. We use enough new features of sqlite, like `sqlite3_error_offset` and `STRICT`, that our minimum version (v3.38.0) is higher than is presumably accessible on Ubuntu. Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
@@ -19,7 +19,6 @@ test-support = ["clock/test-support", "collections/test-support", "gpui/test-sup
|
||||
anyhow.workspace = true
|
||||
async-recursion = "0.3"
|
||||
async-tungstenite = { version = "0.16", features = ["async-std", "async-native-tls"] }
|
||||
async-native-tls = { version = "0.5.0", features = ["vendored"] }
|
||||
chrono = { workspace = true, features = ["serde"] }
|
||||
clock.workspace = true
|
||||
collections.workspace = true
|
||||
@@ -68,10 +67,5 @@ windows.workspace = true
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
cocoa.workspace = true
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
async-native-tls = {"version" = "0.5.0", features = ["vendored"]}
|
||||
# This is an indirect dependency of async-tungstenite that is included
|
||||
# here so we can vendor libssl with the feature flag.
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["async-native-tls"]
|
||||
isahc = { workspace = true, features = ["static-curl"] }
|
||||
async-native-tls = { version = "0.5.0", features = ["vendored"] }
|
||||
|
||||
@@ -135,6 +135,7 @@ xim = { git = "https://github.com/npmania/xim-rs", rev = "27132caffc5b9bc9c432ca
|
||||
"x11rb-xcb",
|
||||
"x11rb-client",
|
||||
] }
|
||||
font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5a5c4d4", features = ["source-fontconfig-dlopen"] }
|
||||
x11-clipboard = "0.9.2"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
|
||||
@@ -35,6 +35,10 @@ tracing = { version = "0.1.34", features = ["log"] }
|
||||
util.workspace = true
|
||||
zstd = "0.11"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
zstd = { version = "0.11", features = [ "pkg-config" ] }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
collections = { workspace = true, features = ["test-support"] }
|
||||
env_logger.workspace = true
|
||||
|
||||
@@ -128,9 +128,15 @@ impl Connection {
|
||||
&mut remaining_sql_ptr,
|
||||
);
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let offset = sqlite3_error_offset(temp_connection.sqlite3);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let offset = 0;
|
||||
|
||||
(
|
||||
sqlite3_errcode(temp_connection.sqlite3),
|
||||
sqlite3_error_offset(temp_connection.sqlite3),
|
||||
offset,
|
||||
sqlite3_errmsg(temp_connection.sqlite3),
|
||||
Some(temp_connection),
|
||||
)
|
||||
@@ -142,9 +148,16 @@ impl Connection {
|
||||
&mut raw_statement,
|
||||
&mut remaining_sql_ptr,
|
||||
);
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let offset = sqlite3_error_offset(self.sqlite3);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let offset = 0;
|
||||
|
||||
(
|
||||
sqlite3_errcode(self.sqlite3),
|
||||
sqlite3_error_offset(self.sqlite3),
|
||||
offset,
|
||||
sqlite3_errmsg(self.sqlite3),
|
||||
None,
|
||||
)
|
||||
@@ -395,6 +408,7 @@ mod test {
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[test]
|
||||
fn test_sql_has_syntax_errors() {
|
||||
let connection = Connection::open_memory(Some("test_sql_has_syntax_errors"));
|
||||
|
||||
@@ -12,7 +12,12 @@ lazy_static::lazy_static! {
|
||||
pub fn sql(tokens: TokenStream) -> TokenStream {
|
||||
let (spans, sql) = make_sql(tokens);
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let error = SQLITE.sql_has_syntax_error(sql.trim());
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let error: Option<(String, usize)> = None;
|
||||
|
||||
let formatted_sql = sqlformat::format(&sql, &sqlformat::QueryParams::None, Default::default());
|
||||
|
||||
if let Some((error, error_offset)) = error {
|
||||
|
||||
Reference in New Issue
Block a user