foriequal0 / git-trim

Automatically trims your branches whose tracking remote refs are merged or stray
MIT License
489 stars 14 forks source link

openssl 3 is unsupported #194

Closed Sherlock-Holo closed 1 year ago

Sherlock-Holo commented 2 years ago

Archlinux has updated to openssl 3, when compiling git-trim, it will fail and report

The following warnings were emitted during compilation:

warning: build/expando.c:4:24: 错误:pasting "RUST_VERSIONOPENSSL" and "(" does not give a valid preprocessing token warning: 4 | #define VERSION2(n, v) RUSTVERSION##n##_##v warning: | ^~~~~ warning: build/expando.c:5:23: 附注:in expansion of macro ‘VERSION2’ warning: 5 | #define VERSION(n, v) VERSION2(n, v) warning: | ^~~~ warning: build/expando.c:10:1: 附注:in expansion of macro ‘VERSION’ warning: 10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER) warning: | ^~~

error: failed to run custom build command for openssl-sys v0.9.58

Caused by: process didn't exit successfully: /home/sherlock/.cache/yay/git-trim/src/git-trim-0.4.2/target/release/build/openssl-sys-666a532735c180d7/build-script-main (exit code: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=OPENSSL_LIB_DIR OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_DIR OPENSSL_DIR unset cargo:rustc-link-lib=ssl cargo:rustc-link-lib=crypto OPT_LEVEL = Some("3") TARGET = Some("x86_64-unknown-linux-gnu") HOST = Some("x86_64-unknown-linux-gnu") CC_x86_64-unknown-linux-gnu = None CC_x86_64_unknown_linux_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-gnu = None CFLAGS_x86_64_unknown_linux_gnu = None HOST_CFLAGS = None CFLAGS = Some("-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection") CRATE_CC_NO_DEFAULTS = None DEBUG = Some("false") CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-march=x86-64" "-mtune=generic" "-O2" "-pipe" "-fno-plt" "-fexceptions" "-Wp,-D_FORTIFY_SOURCE=2" "-Wformat" "-Werror=format-security" "-fstack-clash-protection" "-fcf-protection" "-I" "/usr/include" "-E" "build/expando.c" cargo:warning=build/expando.c:4:24: 错误:pasting "RUST_VERSIONOPENSSL" and "(" does not give a valid preprocessing token cargo:warning= 4 | #define VERSION2(n, v) RUSTVERSION##n##_##v cargo:warning= | ^~~~~ cargo:warning=build/expando.c:5:23: 附注:in expansion of macro ‘VERSION2’ cargo:warning= 5 | #define VERSION(n, v) VERSION2(n, v) cargo:warning= | ^~~~ cargo:warning=build/expando.c:10:1: 附注:in expansion of macro ‘VERSION’ cargo:warning= 10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER) cargo:warning= | ^~~ exit code: 1

--- stderr thread 'main' panicked at ' Header expansion error: Error { kind: ToolExecError, message: "Command \"cc\" \"-O3\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-m64\" \"-march=x86-64\" \"-mtune=generic\" \"-O2\" \"-pipe\" \"-fno-plt\" \"-fexceptions\" \"-Wp,-D_FORTIFY_SOURCE=2\" \"-Wformat\" \"-Werror=format-security\" \"-fstack-clash-protection\" \"-fcf-protection\" \"-I\" \"/usr/include\" \"-E\" \"build/expando.c\" with args \"cc\" did not execute successfully (status code exit code: 1)." }

Failed to find OpenSSL development headers.

You can try fixing this setting the OPENSSL_DIR environment variable pointing to your OpenSSL installation or installing OpenSSL headers package specific to your distribution:

  # On Ubuntu
  sudo apt-get install libssl-dev
  # On Arch Linux
  sudo pacman -S openssl
  # On Fedora
  sudo dnf install openssl-devel

See rust-openssl README for more information:

  https://github.com/sfackler/rust-openssl#linux

', /home/sherlock/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.58/build/main.rs:140:13 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed

consider openssl crate is supported openssl3 https://github.com/sfackler/rust-openssl/pull/1694 maybe you should just update the openssl version?

Sherlock-Holo commented 2 years ago

I already create a PR to fix this problem

foriequal0 commented 1 year ago

https://github.com/foriequal0/git-trim/pull/197 Would this PR be OK?

Sherlock-Holo commented 1 year ago

197 Would this PR be OK?

yes I think that will be helpful