Repository: shuttle-hq/synth (language: rust)

Issue:
Installation on Ubuntu 22.04 requires an additional debian package of libssl1.1
Following the installation instruction on the website and run `synth` directly.

1. Installation

```
curl --proto '=https' --tlsv1.2 -sSL https://getsynth.com/install | sh
```

2. Error while running the command.
```
$ synth                                                              
synth: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
```

It can be resolved by installing the debian package of `libssl1.1` manually because Ubuntu 22.04 only has
libssl3 in its repository.

```
$ wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb
$ sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb 
```

Then it works without issue.

```
$ synth                                                              
synth 
synthetic data engine on the command line

USAGE:
    synth <SUBCOMMAND>

FLAGS:
    -h, --help    Prints help information

SUBCOMMANDS:
    generate     Generate data from a namespace
    help         Prints this message or the help of the given subcommand(s)
    import       Import data from an external source
    init         (DEPRECATED). For backward compatibility and is a no-op.
    telemetry    Toggle anonymous usage data collection
    version      Version information
```





Discussion / hints:

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 7b2d650e..34dcd648 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1563,6 +1563,21 @@ dependencies = [
  "want",
 ]
 
+[[package]]
+name = "hyper-rustls"
+version = "0.22.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64"
+dependencies = [
+ "futures-util",
+ "hyper",
+ "log",
+ "rustls",
+ "tokio",
+ "tokio-rustls",
+ "webpki",
+]
+
 [[package]]
 name = "hyper-tls"
 version = "0.5.0"
@@ -2143,33 +2158,55 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
 
 [[package]]
 name = "openssl"
-version = "0.10.36"
+version = "0.10.41"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a"
+checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0"
 dependencies = [
  "bitflags",
  "cfg-if 1.0.0",
  "foreign-types",
  "libc",
  "once_cell",
+ "openssl-macros",
  "openssl-sys",
 ]
 
+[[package]]
+name = "openssl-macros"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 name = "openssl-probe"
 version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
 
+[[package]]
+name = "openssl-src"
+version = "111.22.0+1.1.1q"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f31f0d509d1c1ae9cada2f9539ff8f37933831fd5098879e482aa687d659853"
+dependencies = [
+ "cc",
+]
+
 [[package]]
 name = "openssl-sys"
-version = "0.9.66"
+version = "0.9.75"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82"
+checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f"
 dependencies = [
  "autocfg 1.0.1",
  "cc",
  "libc",
+ "openssl-src",
  "pkg-config",
  "vcpkg",
 ]
@@ -2601,6 +2638,7 @@ dependencies = [
  "http",
  "http-body",
  "hyper",
+ "hyper-rustls",
  "hyper-tls",
  "ipnet",
  "js-sys",
@@ -2610,15 +2648,18 @@ dependencies = [
  "native-tls",
  "percent-encoding",
  "pin-project-lite 0.2.7",
+ "rustls",
  "serde",
  "serde_json",
  "serde_urlencoded",
  "tokio",
  "tokio-native-tls",
+ "tokio-rustls",
  "url",
  "wasm-bindgen",
  "wasm-bindgen-futures",
  "web-sys",
+ "webpki-roots",
  "winreg 0.7.0",
 ]
 
@@ -3284,6 +3325,7 @@ dependencies = [
  "log",
  "mongodb",
  "num_cpus",
+ "openssl",
  "paste",
  "posthog-rs",
  "querystring",
diff --git a/Cargo.toml b/Cargo.toml
index 0480748b..835ae5d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,3 +9,4 @@ members = [
 
 # blocked by diesel error for now.
 #resolver = "2"
+
diff --git a/synth/Cargo.toml b/synth/Cargo.toml
index 12c0e422..8ec34230 100644
--- a/synth/Cargo.toml
+++ b/synth/Cargo.toml
@@ -21,6 +21,12 @@ telemetry = ["posthog-rs", "uuid", "backtrace", "console"]
 
 [build-dependencies]
 git2 = "0.13.20"
+#until https://github.com/rust-lang/git2-rs/issues/623 fixed
+[dependencies.openssl]
+version = "0.10.41"
+features = [
+    "vendored"
+]
 
 [dev-dependencies]
 lazy_static = "1.4.0"
@@ -76,7 +82,7 @@ sqlx = { version = "0.5.7", features = [ "postgres", "mysql", "runtime-async-std
 
 beau_collector = "0.2.1"
 
-reqwest = { version = "0.11", features = ["json", "blocking"] }
+reqwest = { version = "0.11", features = ["json", "blocking","rustls-tls"] }
 
 semver = "1.0.4"
 


Test patch: