Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Couldn't compile a test in MacOS #1410

Closed
wangtsiao opened this issue May 16, 2023 · 2 comments · Fixed by #1412
Closed

Couldn't compile a test in MacOS #1410

wangtsiao opened this issue May 16, 2023 · 2 comments · Fixed by #1412
Labels
T-bug Type: bug

Comments

@wangtsiao
Copy link

What command(s) is the bug in?

make test

Describe the bug

Here is part of the error message.

.....
  = note: Undefined symbols for architecture x86_64:
            "_SecCertificateCopyData", referenced from:
                _crypto/x509/internal/macos.x509_SecCertificateCopyData_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecCertificateCreateWithData", referenced from:
                _crypto/x509/internal/macos.x509_SecCertificateCreateWithData_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecPolicyCreateSSL", referenced from:
                _crypto/x509/internal/macos.x509_SecPolicyCreateSSL_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecTrustCreateWithCertificates", referenced from:
                _crypto/x509/internal/macos.x509_SecTrustCreateWithCertificates_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecTrustEvaluateWithError", referenced from:
                _crypto/x509/internal/macos.x509_SecTrustEvaluateWithError_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecTrustGetCertificateAtIndex", referenced from:
                _crypto/x509/internal/macos.x509_SecTrustGetCertificateAtIndex_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecTrustGetCertificateCount", referenced from:
                _crypto/x509/internal/macos.x509_SecTrustGetCertificateCount_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
            "_SecTrustSetVerifyDate", referenced from:
                _crypto/x509/internal/macos.x509_SecTrustSetVerifyDate_trampoline.abi0 in libgeth_utils-f82ba25d13d148dc.rlib(go.o)
          ld: symbol(s) not found for architecture x86_64
          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/test_ctx.rs - test_ctx::TestContext (line 27)

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

error: doctest failed, to rerun pass `-p mock --doc`
make: *** [test] Error 101

Concrete steps to reproduce the bug. If it's able reproduce via testool, please share test_id from jenkins report

No response

@wangtsiao wangtsiao added the T-bug Type: bug label May 16, 2023
@ChihChengLiang
Copy link
Collaborator

It seemed to fail the doc test. I can reproduce and narrow the failure to cargo test --release -p mock --all-features --doc

@wangtsiao
Copy link
Author

The issue was resolved by PR#1412, thank you.

han0110 added a commit that referenced this issue May 16, 2023
### Description

Add `rustdocflags` override in `Makefile` when it's macos to make doc
test work.

Note that `config.toml` doesn't support to specify `rustdocflags` under
`[target.'cfg(target_os = "macos")']` (see
rust-lang/cargo#11323) so we have to use command
line override to add it manually.

### Issue Link

Resolves
#1410

### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### How Has This Been Tested?

On macos, run `make test_doc`.

Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants