Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dog fails to build check with OpenSSL 3.0 #98

Open
loqs opened this issue Mar 23, 2022 · 4 comments · May be fixed by #112
Open

dog fails to build check with OpenSSL 3.0 #98

loqs opened this issue Mar 23, 2022 · 4 comments · May be fixed by #112

Comments

@loqs
Copy link

loqs commented Mar 23, 2022

If dog fails to compile, or if there is a problem during the build process, then please include the following information in your report:

  • The exact dog commit you are building (git rev-parse --short HEAD)
$ git rev-parse --short HEAD
721440b
  • The version of rustc you are compiling it with (rustc --version)
$ rustc --version
rustc 1.59.0 (Arch Linux rust 1:1.59.0-1)
  • Your operating system and hardware platform
    Arch Linux x86_64 GNU/Linux
  • The Rust build target (the exact output of rustc --print cfg)
$ rustc --print cfg
debug_assertions
target_arch="x86_64"
target_endian="little"
target_env="gnu"
target_family="unix"
target_feature="fxsr"
target_feature="sse"
target_feature="sse2"
target_os="linux"
target_pointer_width="64"
target_vendor="unknown"
unix

If you are seeing compilation errors, please include the output of the build process.

$ cargo build --release --locked --all-features
    Updating crates.io index
    Updating git repository `https://github.com/llogiq/mutagen`
 Downloading crates ...
  Downloaded cc v1.0.67
  Downloaded unic-char-property v0.9.0
  Downloaded spin v0.5.2
  Downloaded unic-idna v0.9.0
  Downloaded unic-common v0.9.0
  Downloaded unic-idna-mapping v0.9.0
  Downloaded unic-ucd-hangul v0.9.0
  Downloaded unic-normal v0.9.0
  Downloaded untrusted v0.7.1
  Downloaded unic-ucd-version v0.9.0
  Downloaded autocfg v1.0.1
  Downloaded unic-ucd-normal v0.9.0
  Downloaded unicode-width v0.1.8
  Downloaded log v0.4.14
  Downloaded httparse v1.3.5
  Downloaded getrandom v0.2.2
  Downloaded byteorder v1.4.3
  Downloaded base64 v0.13.0
  Downloaded matches v0.1.8
  Downloaded json v0.12.4
  Downloaded once_cell v1.7.2
  Downloaded rand v0.8.3
  Downloaded openssl-sys v0.9.61
  Downloaded datetime v0.5.1
  Downloaded ppv-lite86 v0.2.10
  Downloaded openssl v0.10.33
  Downloaded pkg-config v0.3.19
  Downloaded openssl-probe v0.1.2
  Downloaded ansi_term v0.12.1
  Downloaded getopts v0.2.21
  Downloaded foreign-types-shared v0.1.1
  Downloaded foreign-types v0.3.2
  Downloaded bitflags v1.2.1
  Downloaded cfg-if v1.0.0
  Downloaded atty v0.2.14
  Downloaded unic-idna-punycode v0.9.0
  Downloaded native-tls v0.2.7
  Downloaded webpki-roots v0.21.1
  Downloaded sct v0.6.1
  Downloaded rand_chacha v0.3.0
  Downloaded unic-char-range v0.9.0
  Downloaded rustls v0.19.1
  Downloaded unic-ucd-bidi v0.9.0
  Downloaded webpki v0.21.4
  Downloaded libc v0.2.91
  Downloaded rand_core v0.6.2
  Downloaded ring v0.16.20
  Downloaded openssl-src v111.15.0+1.1.1k
   Compiling libc v0.2.91
   Compiling cc v1.0.67
   Compiling cfg-if v1.0.0
   Compiling unic-common v0.9.0
   Compiling autocfg v1.0.1
   Compiling once_cell v1.7.2
   Compiling pkg-config v0.3.19
   Compiling unic-char-range v0.9.0
   Compiling log v0.4.14
   Compiling spin v0.5.2
   Compiling untrusted v0.7.1
   Compiling bitflags v1.2.1
   Compiling getrandom v0.2.2
   Compiling foreign-types-shared v0.1.1
   Compiling openssl v0.10.33
   Compiling native-tls v0.2.7
   Compiling matches v0.1.8
   Compiling httparse v1.3.5
   Compiling unic-idna-punycode v0.9.0
   Compiling base64 v0.13.0
   Compiling openssl-probe v0.1.2
   Compiling ppv-lite86 v0.2.10
   Compiling byteorder v1.4.3
   Compiling unicode-width v0.1.8
   Compiling ansi_term v0.12.1
   Compiling json v0.12.4
   Compiling unic-ucd-version v0.9.0
   Compiling foreign-types v0.3.2
   Compiling unic-char-property v0.9.0
   Compiling unic-ucd-hangul v0.9.0
   Compiling getopts v0.2.21
   Compiling unic-idna-mapping v0.9.0
   Compiling unic-ucd-bidi v0.9.0
   Compiling unic-ucd-normal v0.9.0
   Compiling openssl-src v111.15.0+1.1.1k
   Compiling ring v0.16.20
   Compiling openssl-sys v0.9.61
   Compiling atty v0.2.14
   Compiling datetime v0.5.1
   Compiling unic-normal v0.9.0
   Compiling rand_core v0.6.2
   Compiling unic-idna v0.9.0
   Compiling dns v0.2.0-pre (/build/dog-dns-git/src/dog/dns)
   Compiling rand_chacha v0.3.0
   Compiling dog v0.2.0-pre (/build/dog-dns-git/src/dog)
   Compiling rand v0.8.3
   Compiling webpki v0.21.4
   Compiling sct v0.6.1
   Compiling rustls v0.19.1
   Compiling webpki-roots v0.21.1
   Compiling dns-transport v0.2.0-pre (/build/dog-dns-git/src/dog/dns-transport)
warning: function is never used: `stream_rustls`
  --> dns-transport/src/tls_stream.rs:14:4
   |
14 | fn stream_rustls(domain: &str, port: u16) -> Result<rustls::StreamOwned<rustls::ClientSession,TcpStream>, Error> {
   |    ^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> dns-transport/src/lib.rs:12:9
   |
12 | #![warn(unused)]
   |         ^^^^^^
   = note: `#[warn(dead_code)]` implied by `#[warn(unused)]`

warning: `dns-transport` (lib) generated 1 warning
    Finished release [optimized] target(s) in 35.53s
$ cargo test --release --locked
 Downloading crates ...
  Downloaded diff v0.1.12
  Downloaded pretty_assertions v0.7.1
   Compiling unic-common v0.9.0
   Compiling cfg-if v1.0.0
   Compiling unic-char-range v0.9.0
   Compiling openssl v0.10.33
   Compiling foreign-types-shared v0.1.1
   Compiling matches v0.1.8
   Compiling unic-idna-punycode v0.9.0
   Compiling once_cell v1.7.2
   Compiling native-tls v0.2.7
   Compiling ppv-lite86 v0.2.10
   Compiling byteorder v1.4.3
   Compiling openssl-probe v0.1.2
   Compiling base64 v0.13.0
   Compiling diff v0.1.12
   Compiling unicode-width v0.1.8
   Compiling ansi_term v0.12.1
   Compiling json v0.12.4
   Compiling libc v0.2.91
   Compiling openssl-sys v0.9.61
   Compiling bitflags v1.2.1
   Compiling httparse v1.3.5
   Compiling dog v0.2.0-pre (/build/dog-dns-git/src/dog)
   Compiling log v0.4.14
   Compiling foreign-types v0.3.2
   Compiling unic-ucd-version v0.9.0
   Compiling unic-char-property v0.9.0
   Compiling getopts v0.2.21
   Compiling unic-ucd-hangul v0.9.0
   Compiling unic-ucd-normal v0.9.0
   Compiling unic-ucd-bidi v0.9.0
   Compiling unic-idna-mapping v0.9.0
   Compiling pretty_assertions v0.7.1
The following warnings were emitted during compilation:

warning: build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
warning:     4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
warning:       |                        ^~~~~~~~~~~~~
warning: build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
warning:     5 | #define VERSION(n, v) VERSION2(n, v)
warning:       |                       ^~~~~~~~
warning: build/expando.c:10:1: note: 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.61`

Caused by:
  process didn't exit successfully: `/build/dog-dns-git/src/dog/target/release/build/openssl-sys-a6ed4e6e8435c37d/build-script-main` (exit status: 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:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=SYSROOT
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rustc-link-lib=ssl
  cargo:rustc-link-lib=crypto
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  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: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
  cargo:warning=    4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
  cargo:warning=      |                        ^~~~~~~~~~~~~
  cargo:warning=build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
  cargo:warning=    5 | #define VERSION(n, v) VERSION2(n, v)
  cargo:warning=      |                       ^~~~~~~~
  cargo:warning=build/expando.c:10:1: note: in expansion of macro ‘VERSION’
  cargo:warning=   10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
  cargo:warning=      | ^~~~~~~
  exit status: 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 status: 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
  ', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.61/build/main.rs:147:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Updating the crates openssl to 0.10.38 and openssl-sys to 0.9.72 allowed check to build and pass.
v0.1.0 failed during build, the same update also fixed that build.

@martinetd
Copy link

FWIW I ran into this as well (debian testing) and just ran cargo update without problems before checking here, worked like a charm and dog worked.

fedora rawhide and alpine edge also updated to openssl 3 so it'd be great for all these adventurous people if you could just update the cargo lock, I don't see why it'd stop working with 1.1 for a while longer :)

thanks!

@owocado
Copy link

owocado commented Nov 13, 2022

Hi, I also came across this same issue while building dog on Ubuntu 22.04 arm64 machine. I did cargo update as suggested on above issue comment by @martinetd but it adds bunch of Windows OS related crates and it feels weird why it does that on linux machine and I dont quite know how to tell it to not add those. I feel bit stuck. 😅

image

martinetd added a commit to martinetd/dog that referenced this issue Dec 3, 2022
our openssl-sys package is too old to support systems with openssl 3.0,
running cargo update fixes that issue and is still compatible with
older versions.

Fixes: ogham#98
@martinetd martinetd linked a pull request Dec 3, 2022 that will close this issue
@martinetd
Copy link

It's an indirect dependency for schannel, itself a dependency for native-tls included in dns-transport/Cargo.toml -- but if you run something like cargo tree you'll see it's not actually being used for linux, so I think it's safe to ignore.

Anyway, I've opened #112 with cargo update -- given the lack of activity I'm not holding my hopes up, but at least I won't need to run cargo update the next time I clone this repo...

@alex27riva
Copy link

FWIW I ran into this as well (debian testing) and just ran cargo update without problems before checking here, worked like a charm and dog worked.

fedora rawhide and alpine edge also updated to openssl 3 so it'd be great for all these adventurous people if you could just update the cargo lock, I don't see why it'd stop working with 1.1 for a while longer :)

thanks!

Thank you, it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants