thomwiggers / kemtls-experiment

Experimental implementation of KEMTLS in Rustls
https://wggrs.nl/p/kemtls/
Other
26 stars 13 forks source link

rustls submodule fails to locate OpenSSL #12

Closed mouse07410 closed 2 years ago

mouse07410 commented 2 years ago

OpenSSL is installed into /opt/local/lib and /opt/local/include.

echo $RUSTFLAGS
-C target-cpu=native -C target-feature=+aes,+ssse3,+sse4.1,+sse4.2,+avx2,+pclmulqdq,+rdrand -L/opt/local/lib -lz -lssl -lcrypto

To reproduce the problem:

$ git clone https://github.com/thomwiggers/kemtls-experiment.git --recurse-submodules
.  .  .
$ cd kemtls-experiment
$ cd rustls
$ cargo build && cargo test
warning: /Users/ur20980/src/kemtls-experiment/rustls/rustls/Cargo.toml: file found to be present in multiple build targets: /Users/ur20980/src/kemtls-experiment/rustls/rustls/tests/benchmarks.rs
    Updating git repository `https://github.com/thomwiggers/ring.git`
    Updating crates.io index
    Updating git repository `https://github.com/thomwiggers/oqs-rs.git`
    Updating git submodule `https://github.com/thomwiggers/liboqs.git`
    Updating git repository `https://github.com/thomwiggers/xmss-rs.git`
    Updating git submodule `https://github.com/thomwiggers/xmss-reference.git`
  Downloaded sct v0.6.1
  Downloaded untrusted v0.7.1
  Downloaded clang-sys v1.3.3
  Downloaded spin v0.5.2
  Downloaded 4 crates (84.7 KB) in 0.67s
   Compiling libc v0.2.126
   Compiling memchr v2.5.0
   Compiling cc v1.0.73
   Compiling glob v0.3.0
   Compiling version_check v0.9.4
   Compiling cfg-if v1.0.0
   Compiling log v0.4.17
   Compiling proc-macro2 v1.0.40
   Compiling quote v1.0.20
   Compiling unicode-ident v1.0.1
   Compiling regex-syntax v0.6.26
   Compiling unicode-width v0.1.9
   Compiling vec_map v0.8.2
   Compiling ansi_term v0.12.1
   Compiling termcolor v1.1.3
   Compiling strsim v0.8.0
   Compiling humantime v2.1.0
   Compiling bindgen v0.58.1
   Compiling bitflags v1.3.2
   Compiling peeking_take_while v0.1.2
   Compiling rustc-hash v1.1.0
   Compiling lazycell v1.3.0
   Compiling shlex v1.1.0
   Compiling lazy_static v1.4.0
   Compiling spin v0.5.2
   Compiling untrusted v0.7.1
   Compiling base64 v0.13.0
   Compiling libloading v0.7.3
   Compiling textwrap v0.11.0
   Compiling build-deps v0.1.4
   Compiling nom v5.1.2
   Compiling clang-sys v1.3.3
   Compiling cmake v0.1.48
   Compiling ring v0.16.999 (https://github.com/thomwiggers/ring.git?branch=longer-der#764621dc)
   Compiling xmss-rs v0.1.0 (https://github.com/thomwiggers/xmss-rs.git#30fc8e60)
   Compiling aho-corasick v0.7.18
   Compiling regex v1.5.6
   Compiling atty v0.2.14
   Compiling which v3.1.1
   Compiling clap v2.34.0
   Compiling cexpr v0.4.0
   Compiling env_logger v0.8.4
The following warnings were emitted during compilation:

warning: xmss-reference/hash.c:3:10: fatal error: 'openssl/sha.h' file not found
warning: #include <openssl/sha.h>
warning:          ^~~~~~~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `xmss-rs v0.1.0 (https://github.com/thomwiggers/xmss-rs.git#30fc8e60)`

Caused by:
  process didn't exit successfully: `/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-6af8040e0c34adcb/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-apple-darwin")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = Some("clang")
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = Some("-O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk")
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/fips202.o" "-c" "xmss-reference/fips202.c"
  exit status: 0
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/hash_address.o" "-c" "xmss-reference/hash_address.c"
  exit status: 0
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/hash.o" "-c" "xmss-reference/hash.c"
  cargo:warning=xmss-reference/hash.c:3:10: fatal error: 'openssl/sha.h' file not found
  cargo:warning=#include <openssl/sha.h>
  cargo:warning=         ^~~~~~~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1

  --- stderr

  error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/hash.o" "-c" "xmss-reference/hash.c" with args "clang" did not execute successfully (status code exit status: 1).
thomwiggers commented 2 years ago

The problem is my custom instantiation of xmss crate assumes Linux (as do all the other scripts in this repository). I don't think I will fix this in this repository, but it should be easy to patch the build.rs.

mouse07410 commented 2 years ago

I don't think I will fix this in this repository, but it should be easy to patch the build.rs

Any guidance regarding what to patch there?

thomwiggers commented 2 years ago

You'll want to add an .include() call with the location of openssl's include dir.

mouse07410 commented 2 years ago

I don't think I will fix this in this repository

May I suggest that you at least fix your repos by adding support for env var OPENSSL_ROOT_DIR, if not OPENSSL_INCLUDE_DIR and OPENSSL_LIB_DIR? I.e., if OPENSSL_ROOT_DIR is defined, then add $OPENSSL_ROOT_DIR/include to includes, and (more important!) $OPENSSL_ROOT_DIR/lib to libraries path?

Currently your build is pulling packages from GitHub, and I really-really don't want to fork it all and attempt to fix to accommodate for things like OpenSSL not being where the custom build thinks they should be.

Thanks in advance.

thomwiggers commented 2 years ago

I guess I can merge a PR

mouse07410 commented 2 years ago

I guess I can merge a PR

That's great, but if I knew how to fix these, I would've done it.

thomwiggers commented 2 years ago

I've pushed something to xmss-rs; you will need to update your local copy to pull in the latest version.

mouse07410 commented 2 years ago

Probably I missed some necessary steps? In the kemtls-experiment/ I did

$ git pull --recurse-submodules; date
$ git-pull
Fetching submodule mk-cert
Fetching submodule mk-cert/xmss-rs
From https://github.com/thomwiggers/xmss-rs
   30fc8e6..262c70e  master     -> origin/master
Fetching submodule mk-cert/xmss-rs/xmss-reference
Fetching submodule oqs-rs
Fetching submodule oqs-rs/oqs-sys/liboqs
Fetching submodule ring
Fetching submodule rustls
Fetching submodule webpki
Already up to date.
Mon Jul 18 15:01:57 EDT 2022

It appeared to have succeeded, though I don't understand why xmss-rs updates were not pulled.

oqs-rs built successfully and passed the tests.

Then, I went to rustls, and observed the same problem:

$ cd rustls
$ git submodule update --init --recursive
$ time cargo test
warning: /Users/ur20980/src/kemtls-experiment/rustls/rustls/Cargo.toml: file found to be present in multiple build targets: /Users/ur20980/src/kemtls-experiment/rustls/rustls/tests/benchmarks.rs
   Compiling libc v0.2.126
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.40
   Compiling quote v1.0.20
   Compiling unicode-ident v1.0.1
   Compiling memchr v2.5.0
   Compiling cc v1.0.73
   Compiling glob v0.3.0
   Compiling version_check v0.9.4
   Compiling bitflags v1.3.2
   Compiling regex-syntax v0.6.26
   Compiling lazy_static v1.4.0
   Compiling log v0.4.17
   Compiling unicode-width v0.1.9
   Compiling strsim v0.8.0
   Compiling ansi_term v0.12.1
   Compiling syn v1.0.98
   Compiling vec_map v0.8.2
   Compiling humantime v2.1.0
   Compiling serde_derive v1.0.138
   Compiling bindgen v0.58.1
   Compiling termcolor v1.1.3
   Compiling lazycell v1.3.0
   Compiling serde v1.0.138
   Compiling rustc-hash v1.1.0
   Compiling peeking_take_while v0.1.2
   Compiling shlex v1.1.0
   Compiling spin v0.5.2
   Compiling untrusted v0.7.1
   Compiling autocfg v1.1.0
   Compiling base64 v0.13.0
   Compiling semver v1.0.12
   Compiling crossbeam-utils v0.8.10
   Compiling once_cell v1.13.0
   Compiling scopeguard v1.1.0
   Compiling rayon-core v1.9.3
   Compiling ryu v1.0.10
   Compiling serde_json v1.0.82
   Compiling either v1.7.0
   Compiling itoa v1.0.2
   Compiling regex-automata v0.1.10
   Compiling plotters-backend v0.3.2
   Compiling itoa v0.4.8
   Compiling same-file v1.0.6
   Compiling strsim v0.10.0
   Compiling half v1.8.2
   Compiling oorandom v11.1.3
   Compiling libloading v0.7.3
   Compiling textwrap v0.11.0
   Compiling build-deps v0.1.4
   Compiling cmake v0.1.48
   Compiling nom v5.1.2
   Compiling clang-sys v1.3.3
   Compiling itertools v0.10.3
   Compiling plotters-svg v0.3.1
   Compiling memoffset v0.6.5
   Compiling crossbeam-epoch v0.9.9
   Compiling num-traits v0.2.15
   Compiling rayon v1.5.3
   Compiling walkdir v2.3.2
   Compiling ring v0.16.999 (https://github.com/thomwiggers/ring.git?branch=longer-der#764621dc)
   Compiling xmss-rs v0.1.0 (https://github.com/thomwiggers/xmss-rs.git#30fc8e60)
   Compiling aho-corasick v0.7.18
   Compiling csv-core v0.1.10
   Compiling rustc_version v0.4.0
   Compiling crossbeam-channel v0.5.5
   Compiling cast v0.2.7
   Compiling regex v1.5.6
The following warnings were emitted during compilation:

warning: xmss-reference/hash.c:3:10: fatal error: 'openssl/sha.h' file not found
warning: #include <openssl/sha.h>
warning:          ^~~~~~~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `xmss-rs v0.1.0 (https://github.com/thomwiggers/xmss-rs.git#30fc8e60)`

Caused by:
  process didn't exit successfully: `/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-6af8040e0c34adcb/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-apple-darwin")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = Some("clang")
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = Some("-O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk")
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/fips202.o" "-c" "xmss-reference/fips202.c"
  exit status: 0
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/hash_address.o" "-c" "xmss-reference/hash_address.c"
  exit status: 0
  running: "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/hash.o" "-c" "xmss-reference/hash.c"
  cargo:warning=xmss-reference/hash.c:3:10: fatal error: 'openssl/sha.h' file not found
  cargo:warning=#include <openssl/sha.h>
  cargo:warning=         ^~~~~~~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1

  --- stderr

  error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=x86_64-apple-darwin" "-O3" "-std=gnu18" "-march=native" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" "-I" "xmss-reference" "-std=c11" "-march=native" "-Ofast" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/xmss-rs-ff509a00abbb904f/out/xmss-reference/hash.o" "-c" "xmss-reference/hash.c" with args "clang" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...

real    0m11.628s
user    1m18.215s
sys 0m13.279s
$ 
mouse07410 commented 2 years ago

Update

I wiped out the existing directory, and cloned a-fresh. oqs-rs worked OK, as before.

With rustls I'm getting different errors now:

$ pwd
/Users/ur20980/src/kemtls-experiment/rustls
$ time cargo test
warning: /Users/ur20980/src/kemtls-experiment/rustls/rustls/Cargo.toml: file found to be present in multiple build targets: /Users/ur20980/src/kemtls-experiment/rustls/rustls/tests/benchmarks.rs
    Updating git repository `https://github.com/thomwiggers/ring.git`
    Updating crates.io index
    Updating git repository `https://github.com/thomwiggers/oqs-rs.git`
    Updating git repository `https://github.com/thomwiggers/xmss-rs.git`
    Updating git submodule `https://github.com/thomwiggers/xmss-reference.git`
  Downloaded cast v0.3.0
  Downloaded criterion-plot v0.4.5
  Downloaded plotters-svg v0.3.2
  Downloaded plotters-backend v0.3.4
  Downloaded serde v1.0.139
  Downloaded serde_derive v1.0.139
  Downloaded criterion v0.3.6
  Downloaded plotters v0.3.2
  Downloaded nix v0.24.2
  Downloaded 9 crates (704.0 KB) in 2.58s
   Compiling libc v0.2.126
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.40
   Compiling memchr v2.5.0
   Compiling quote v1.0.20
   Compiling unicode-ident v1.0.2
   Compiling cc v1.0.73
   Compiling glob v0.3.0
   Compiling lazy_static v1.4.0
   Compiling log v0.4.17
   Compiling regex-syntax v0.6.27
   Compiling version_check v0.9.4
   Compiling bitflags v1.3.2
   Compiling unicode-width v0.1.9
   Compiling ansi_term v0.12.1
   Compiling syn v1.0.98
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling termcolor v1.1.3
   Compiling serde_derive v1.0.139
   Compiling humantime v2.1.0
   Compiling bindgen v0.58.1
   Compiling rustc-hash v1.1.0
   Compiling peeking_take_while v0.1.2
   Compiling shlex v1.1.0
   Compiling lazycell v1.3.0
   Compiling serde v1.0.139
   Compiling untrusted v0.7.1
   Compiling spin v0.5.2
   Compiling autocfg v1.1.0
   Compiling base64 v0.13.0
   Compiling crossbeam-utils v0.8.10
   Compiling once_cell v1.13.0
   Compiling scopeguard v1.1.0
   Compiling rayon-core v1.9.3
   Compiling serde_json v1.0.82
   Compiling either v1.7.0
   Compiling ryu v1.0.10
   Compiling regex-automata v0.1.10
   Compiling itoa v1.0.2
   Compiling plotters-backend v0.3.4
   Compiling same-file v1.0.6
   Compiling itoa v0.4.8
   Compiling strsim v0.10.0
   Compiling cast v0.3.0
   Compiling half v1.8.2
   Compiling oorandom v11.1.3
   Compiling libloading v0.7.3
   Compiling textwrap v0.11.0
   Compiling build-deps v0.1.4
   Compiling nom v5.1.2
   Compiling clang-sys v1.3.3
   Compiling cmake v0.1.48
   Compiling itertools v0.10.3
   Compiling walkdir v2.3.2
   Compiling plotters-svg v0.3.2
   Compiling memoffset v0.6.5
   Compiling crossbeam-epoch v0.9.9
   Compiling num-traits v0.2.15
   Compiling rayon v1.5.3
   Compiling ring v0.16.999 (https://github.com/thomwiggers/ring.git?branch=longer-der#764621dc)
   Compiling xmss-rs v0.1.0 (https://github.com/thomwiggers/xmss-rs.git#262c70e6)
   Compiling aho-corasick v0.7.18
   Compiling csv-core v0.1.10
   Compiling crossbeam-channel v0.5.5
   Compiling regex v1.6.0
   Compiling criterion-plot v0.4.5
   Compiling atty v0.2.14
   Compiling which v3.1.1
   Compiling num_cpus v1.13.1
   Compiling nix v0.24.2
   Compiling mio v0.7.14
   Compiling crossbeam-deque v0.8.1
   Compiling clap v2.34.0
   Compiling ctrlc v3.2.2
   Compiling env_logger v0.8.4
   Compiling cexpr v0.4.0
   Compiling plotters v0.3.2
   Compiling oqs-sys v0.6.0 (https://github.com/thomwiggers/oqs-rs.git?branch=dirty-oqs-avx2-rainbow#7356ebc9)
   Compiling bstr v0.2.17
   Compiling docopt v1.1.1
   Compiling serde_cbor v0.11.2
   Compiling sct v0.6.1
   Compiling ct-logs v0.7.0
   Compiling csv v1.1.6
   Compiling tinytemplate v1.2.1
   Compiling criterion v0.3.6
   Compiling oqs v0.6.0 (https://github.com/thomwiggers/oqs-rs.git?branch=dirty-oqs-avx2-rainbow#7356ebc9)
   Compiling webpki v0.21.9999 (/Users/ur20980/src/kemtls-experiment/webpki)
   Compiling rustls v0.18.1 (/Users/ur20980/src/kemtls-experiment/rustls/rustls)
   Compiling webpki-roots v0.20.0
   Compiling webpki-roots v0.21.1
   Compiling rustls-mio v0.0.1 (/Users/ur20980/src/kemtls-experiment/rustls/rustls-mio)
warning: field is never read: `cmd_forward`
   --> rustls-mio/examples/tlsserver.rs:456:5
    |
456 |     cmd_forward: bool,
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default
note: `Args` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   --> rustls-mio/examples/tlsserver.rs:452:10
    |
452 | #[derive(Debug, Deserialize)]
    |          ^^^^^
    = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustcN7b7Oq/symbols.o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/rustls-f2f10c3792ebca70.100adbvpvdstt8my.rcgu.o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/rustls-f2f10c3792ebca70.115900tvi9guk7a8.rcgu.o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/rustls-f2f10c3792ebca70.11exs4f6jqlnmfgb.rcgu.o"
.  .  .
"/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/rustls-f2f10c3792ebca70.1cp92wveske6g9me.rcgu.o" "-L" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps" "-L" "/opt/local/lib/liconv" "-L" "/opt/local/lib" "-L" "/Users/ur20980/lib" "-L" "/opt/local/libexec/openssl3/lib" "-L" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/oqs-sys-043eb06f34a5f6d4/out/build/lib" "-L" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/build/ring-543fb1dd13cdbe55/out" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-liconv" "-lz" "-lssl" "-lcrypto" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libenv_logger-512480b1819820e4.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libatty-f5c633449a28bd11.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libtermcolor-c291f78763b816e4.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libhumantime-a90aec2d7bfd8527.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libregex-4165c75e78af4862.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libaho_corasick-a328993041ee903c.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libmemchr-ac5fa57b2e662c41.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libregex_syntax-fdf17263b6d0d9db.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-65b5f1e4c899bc3c.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-e20e7f56af695499.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-c6e073ea4221acd8.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_std-def437acad2f0236.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libwebpki_roots-f283aa69339e385b.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libbase64-99a4973b7d33190a.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libsct-7b740e04f22fc146.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libwebpki-b535542468df0a88.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libxmss_rs-9eb994afb767848a.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/liboqs-29b02cca7582f9b7.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/liboqs_sys-73f07c833bb78bb8.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/liblibc-d6d9b83da2ec6e90.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libring-a6e6619443d2565b.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libspin-6d78dfe669564b9d.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libuntrusted-2fcde462d83474d7.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/liblog-72e8f6db1fda554b.rlib" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/libcfg_if-e28c742f84ad7f49.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-98c00dfac2ed63a9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-2bfdefa1eef03ce9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-0879573886b8f3c9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-9457b581f846bd68.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-fdadb45f6ca2a32a.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-d6897e5effdf9a5b.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-8ad11a11751b430a.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-21012ef130278dba.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-31fa754b4cd51f8c.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-73467ddf8dfef1cf.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-e95ad01d527d4484.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-93d1dbc4167d296b.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-c56f06cb067eb4ac.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-6e19428d08824663.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-1dec453fd63e5025.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-b8113748cb9bde10.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e3b159eab9d77c07.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-6414c60128938315.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-fae0f9433d26b3c3.rlib" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lxmss" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-framework" "Security" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/rustls-f2f10c3792ebca70" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lxmss
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `rustls` due to previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit status: 1
.  .  .
"/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-6414c60128938315.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-fae0f9433d26b3c3.rlib" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lxmss" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-framework" "Security" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/api-2edf32158e60fed0" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lxmss
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `rustls` due to previous error
error: could not compile `rustls-mio` due to previous error
warning: `rustls-mio` (example "tlsserver") generated 1 warning
error: could not compile `rustls-mio` due to previous error; 1 warning emitted
error: could not compile `rustls` due to previous error
$
$ find .. -name 'libxmss*' -print
../rustls/target/debug/deps/libxmss_rs-9eb994afb767848a.rlib
../rustls/target/debug/deps/libxmss_rs-9eb994afb767848a.rmeta
$ 
mouse07410 commented 2 years ago

And same problem with kemtls-experiment/ring/ - fails to locate TLS, despite OPENSSL_ROOT_DIR, OPENSSL_LIB_DIR, OPENSSL_INCLUDE_DIR all pointing at the right places.

.  .  .
---- src/agreement.rs - agreement (line 23) stdout ----
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustcTZb4LI/symbols.o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestcNNvXf/rust_out.rust_out.921f0e3c-cgu.0.rcgu.o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestcNNvXf/rust_out.4jh3562snej2r6lm.rcgu.o" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/build/ring-ee217591c8e3380b/out" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libring-5a27fc550d295f9b.rlib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libspin-6d78dfe669564b9d.rlib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libuntrusted-2fcde462d83474d7.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-98c00dfac2ed63a9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-2bfdefa1eef03ce9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-0879573886b8f3c9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-9457b581f846bd68.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-fdadb45f6ca2a32a.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-d6897e5effdf9a5b.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-8ad11a11751b430a.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-21012ef130278dba.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-31fa754b4cd51f8c.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-73467ddf8dfef1cf.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-e95ad01d527d4484.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-93d1dbc4167d296b.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-c56f06cb067eb4ac.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-6e19428d08824663.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-1dec453fd63e5025.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-b8113748cb9bde10.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e3b159eab9d77c07.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-6414c60128938315.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-fae0f9433d26b3c3.rlib" "-framework" "Security" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestcNNvXf/rust_out" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lssl
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
thomwiggers commented 2 years ago

You will need to run cargo update to download the latest version. Cargo puts a commit hash into Cargo.lock and it clones the repository to somewhere under ~/.cargo/.

mouse07410 commented 2 years ago

I do cargo update regularly. Unfortunately, same result:

$ cd ~/src/kemtls-experiment/ring
$ cargo update
    Updating crates.io index
$ time cargo test
warning: unused doc comment
.   .  .
61 |         assert_eq!(mask.as_ref(), key.new_mask(&sample)?);
   |                                   ^^^^^^^^^^^^^^^^^^^^^^ overruled by previous forbid
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

warning: `ring` (test "agreement_tests") generated 3 warnings
warning: `ring` (test "digest_tests") generated 4 warnings
warning: `ring` (test "quic_tests") generated 2 warnings
warning: `ring` (lib test) generated 2 warnings (2 duplicates)
    Finished test [unoptimized + debuginfo] target(s) in 0.14s
     Running unittests src/lib.rs (target/debug/deps/ring-ef668c0ebe78ba98)

running 87 tests
test aead::aes_gcm::tests::max_input_len_test ... ok
test aead::chacha20_poly1305::tests::max_input_len_test ... ok
test aead::block::tests::test_bitxor_assign ... ok
.  .  .
Couldn't compile the test.
---- src/digest.rs - digest::Context (line 124) stdout ----
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustcwG9tTb/symbols.o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestI7VmTi/rust_out.rust_out.921f0e3c-cgu.0.rcgu.o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestI7VmTi/rust_out.4jh3562snej2r6lm.rcgu.o" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/build/ring-ee217591c8e3380b/out" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libring-5a27fc550d295f9b.rlib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libspin-6d78dfe669564b9d.rlib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libuntrusted-2fcde462d83474d7.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-98c00dfac2ed63a9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-2bfdefa1eef03ce9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-0879573886b8f3c9.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-9457b581f846bd68.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-fdadb45f6ca2a32a.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-d6897e5effdf9a5b.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-8ad11a11751b430a.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-21012ef130278dba.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-31fa754b4cd51f8c.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-73467ddf8dfef1cf.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-e95ad01d527d4484.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-93d1dbc4167d296b.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-c56f06cb067eb4ac.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-6e19428d08824663.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-1dec453fd63e5025.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-b8113748cb9bde10.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e3b159eab9d77c07.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-6414c60128938315.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-fae0f9433d26b3c3.rlib" "-framework" "Security" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestI7VmTi/rust_out" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lssl
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error

Couldn't compile the test.

failures:
    src/agreement.rs - agreement (line 23)
    src/digest.rs - digest::Context (line 124)
    src/digest.rs - digest::digest (line 213)
    src/error.rs - error::Unspecified (line 34)
    src/hmac.rs - hmac (line 31)
    src/hmac.rs - hmac (line 51)
    src/hmac.rs - hmac (line 75)
    src/pbkdf2.rs - pbkdf2 (line 32)
    src/signature.rs - signature (line 129)
    src/signature.rs - signature (line 193)

test result: FAILED. 0 passed; 10 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.97s

error: test failed, to rerun pass '--doc'
thomwiggers commented 2 years ago

I had neglected to expose the lib search path to rustc. Try again?

mouse07410 commented 2 years ago

I had neglected to expose the lib search path to rustc. Try again?

Alas, same thing with kemtls-experiment/rustls:

chains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-35af506aebbb3abd.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-e149d7d6ef6750c5.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-cdd7c9a0360e9a15.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-504c8436d3cdf687.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-68d0fd74539b07e1.rlib" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lxmss" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-framework" "Security" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/ur20980/src/kemtls-experiment/rustls/target/debug/deps/api-cfc397019a493804" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lxmss
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile `rustls` due to previous error

And kemtls-experiment/ring:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustcwDy0X9/symbols.o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestNncK5j/rust_out.rust_out.94932d28-cgu.0.rcgu.o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestNncK5j/rust_out.14wh8t0sm2esugyw.rcgu.o" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps" "-L" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/build/ring-3dbf9433c16a8c2f/out" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libring-b3a91e306dd52e3b.rlib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libspin-90783268d17ec9a8.rlib" "/Users/ur20980/src/kemtls-experiment/ring/target/debug/deps/libuntrusted-cdfa003a0a965733.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-10116371125a6aff.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-39e96d52875d1707.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-5291a2db2306cf06.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-390f7d5c905d1758.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-294943fd09f0dfee.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-5b8fe2191a96c1eb.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-6c345d2ae2af194e.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-7fb258730717fc35.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-95d7b07281459669.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-1830aefa1e824398.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-6c20c3f29e08f382.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-392d2b6b8e347168.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-ed102691bd84ae29.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-f8a76297049f40d0.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-35af506aebbb3abd.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-e149d7d6ef6750c5.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-cdd7c9a0360e9a15.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-504c8436d3cdf687.rlib" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-68d0fd74539b07e1.rlib" "-framework" "Security" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-liconv" "-lz" "-lssl" "-lcrypto" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/ur20980/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/var/folders/_l/4q83bg9j5ysb7qd1n9xpnb4h0000gn/T/rustdoctestNncK5j/rust_out" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: library not found for -lssl
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error

Couldn't compile the test.

failures:
    src/agreement.rs - agreement (line 23)
    src/digest.rs - digest::Context (line 124)
    src/digest.rs - digest::digest (line 213)
    src/error.rs - error::Unspecified (line 34)
    src/hmac.rs - hmac (line 31)
    src/hmac.rs - hmac (line 51)
    src/hmac.rs - hmac (line 75)
    src/pbkdf2.rs - pbkdf2 (line 32)
    src/signature.rs - signature (line 129)
    src/signature.rs - signature (line 193)

test result: FAILED. 0 passed; 10 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.88s

error: test failed, to rerun pass '--doc'

In both cases I did cargo clean ; cargo update before time cargo test.

mouse07410 commented 2 years ago

Here's the complete log of time cargo test in kemtls-experiment/ring: ring-out.txt

thomwiggers commented 2 years ago

I will need to dig out the mac machine from one of my moving boxes before I can dig into this properly, I'm afraid.

mouse07410 commented 2 years ago

While you're "out of Mac", I'd be happy to run the tests and trials for you. You would change the source in this repo, and I'll run the build and provide as much feedback as you need.

thomwiggers commented 2 years ago

Okay, I've managed to track down what went wrong with -lxmss; the fix to allow specifying OPENSSL_ROOT_DIR removed the compile instruction 😓 https://github.com/thomwiggers/xmss-rs/commit/262c70e69b03d58098b35272a47aac54188d74d4#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42L27

thomwiggers commented 2 years ago

It builds on MacOS Monterey now.

mouse07410 commented 2 years ago

Thank you! Much better! I think it works now.

Only one test in rustls appears to keep failing:

.  .  .
test x509::test_ludicrous ... ok
test verifybench::test_google_cert ... FAILED
test msgs::message_test::test_read_fuzz_corpus ... ok
test verifybench::test_servo_cert ... ok

failures:

---- verifybench::test_google_cert stdout ----
thread 'verifybench::test_google_cert' panicked at 'called `Result::unwrap()` on an `Err` value: WebPKIError(UnknownIssuer)', rustls/src/verifybench.rs:158:67
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/result.rs:1785:5
   3: rustls::verifybench::bench
   4: rustls::verifybench::test_google_cert
   5: core::ops::function::FnOnce::call_once
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

failures:
    verifybench::test_google_cert

test result: FAILED. 137 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.09s

and it's probably not that crucial - might have to do with the tests being unable to cross the firewall and unaware of web proxy settings.

thomwiggers commented 2 years ago

yeah those tests are a bit finicky sometimes. It might also be that this cert in the test has expired or been replaced something.