From 7cdf5b673d696b3cc38a6c86c71f1e15c3e20207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20Gr=C3=B8dem?= <29732646+oddgrd@users.noreply.github.com> Date: Tue, 20 Jun 2023 13:27:54 +0200 Subject: [PATCH] fix: cargo-generate needs openssl (#1023) (#1024) --- .circleci/config.yml | 9 ++++--- Cargo.lock | 52 ++++++++++++++++++++++++++++++++++++++++ cargo-shuttle/Cargo.toml | 4 ++++ 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bb248512..6b9419072 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -401,7 +401,8 @@ jobs: command: | # From https://github.com/briansmith/ring/issues/1414#issuecomment-1055177218 export CC_aarch64_unknown_linux_musl=clang - cargo build --release --package cargo-shuttle --target << parameters.target >> + # "vendored-openssl" is from https://github.com/cross-rs/cross/issues/229#issuecomment-597898074 + cargo build --release --package cargo-shuttle --features vendored-openssl --target << parameters.target >> - make-artifact: target: << parameters.target >> build-binaries-windows: @@ -426,7 +427,8 @@ jobs: # From https://github.com/alexcrichton/openssl-src-rs/issues/45 # Because of https://github.com/openssl/openssl/issues/9048 $env:OPENSSL_SRC_PERL="C:\Strawberry\perl\bin\perl.exe" - ..\.cargo\bin\cargo.exe build --release --package cargo-shuttle --target x86_64-pc-windows-msvc + # "vendored-openssl" is from https://github.com/cross-rs/cross/issues/229#issuecomment-597898074 + ..\.cargo\bin\cargo.exe build --release --package cargo-shuttle --features vendored-openssl --target x86_64-pc-windows-msvc shell: powershell.exe - make-artifact: target: x86_64-pc-windows-msvc @@ -443,7 +445,8 @@ jobs: - run: name: Build command: | - cargo build --release --package cargo-shuttle --target x86_64-apple-darwin + # "vendored-openssl" is from https://github.com/cross-rs/cross/issues/229#issuecomment-597898074 + cargo build --release --package cargo-shuttle --features vendored-openssl --target x86_64-apple-darwin - make-artifact: target: x86_64-apple-darwin publish-github-release: diff --git a/Cargo.lock b/Cargo.lock index 1ea5feb8b..21ef461c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1148,6 +1148,7 @@ dependencies = [ "ignore", "indicatif", "indoc", + "openssl", "portpicker", "reqwest", "reqwest-middleware", @@ -2080,6 +2081,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.0" @@ -3698,12 +3714,47 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl" +version = "0.10.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "111.26.0+1.1.1u" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efc62c9f12b22b8f5208c23a7200a442b2e5999f8bdf80233852122b5a4f6f37" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.88" @@ -3712,6 +3763,7 @@ checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/cargo-shuttle/Cargo.toml b/cargo-shuttle/Cargo.toml index 65b6fb564..43ad18764 100644 --- a/cargo-shuttle/Cargo.toml +++ b/cargo-shuttle/Cargo.toml @@ -28,6 +28,7 @@ headers = { workspace = true } indicatif = "0.17.3" ignore = "0.4.20" indoc = "2.0.1" +openssl = { version = "0.10", optional = true } portpicker = { workspace = true } reqwest = { workspace = true, features = ["json"] } reqwest-middleware = "0.2.0" @@ -66,6 +67,9 @@ workspace = true workspace = true features = ["builder"] +[features] +vendored-openssl = ["openssl/vendored"] + [dev-dependencies] assert_cmd = "2.0.6" rexpect = "0.5.0"