22 lines
1.3 KiB
Python
22 lines
1.3 KiB
Python
import sys
|
|
|
|
cargo_path = r"C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\Cargo.toml"
|
|
with open(cargo_path, "r", encoding="utf-8") as f:
|
|
content = f.read()
|
|
|
|
# Swap reqwest rustls-tls in instead of default (which uses native-tls / openssl)
|
|
# This entirely removes the openssl dependency during Linux cross-compilation
|
|
if 'reqwest = { version = "0.12", default-features = false, features = ["stream", "rustls-tls"] }' not in content:
|
|
content = content.replace('reqwest = "0.12"', 'reqwest = { version = "0.12", default-features = false, features = ["stream", "rustls-tls"] }')
|
|
|
|
# For git2, we don't need vendored openssl if we're not using https fetch/push for libgit2.
|
|
# We just need to read local `.git` files, so we can disable the default features.
|
|
if 'git2 = { version = "0.19.0", features = ["vendored-openssl"] }' in content:
|
|
content = content.replace('git2 = { version = "0.19.0", features = ["vendored-openssl"] }', 'git2 = { version = "0.19.0", default-features = false }')
|
|
elif 'git2 = "0.19.0"' in content:
|
|
content = content.replace('git2 = "0.19.0"', 'git2 = { version = "0.19.0", default-features = false }')
|
|
|
|
with open(cargo_path, "w", encoding="utf-8") as f:
|
|
f.write(content)
|
|
print("Removed OpenSSL dependency entirely from server Cargo.toml")
|