#24795 closed defect (worksforme)

test_rust fails on osx with "can't find crate for `libc`"

Reported by: nickm Owned by: isis
Priority: Medium Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: rust, osx, tests, 032-backport, 033-triage-20180320, fast-fix
Cc: Actual Points:
Parent ID: Points: 1
Reviewer: Sponsor: SponsorM-can

Description

After I apply mix fix for #24642, I see this message in test-suite.log from test_rust.sh:

   Doc-tests protover
error[E0463]: can't find crate for `libc`
  --> /Users/nickm/src/tor/src/rust/protover/lib.rs:25:1
   |
25 | extern crate libc;
   | ^^^^^^^^^^^^^^^^^^ can't find crate

I do not see the same message on my linux rust builds.

Child Tickets

Change History (12)

comment:1 Changed 20 months ago by nickm

Could it be that we haven't noted a "libc" dependency everywhere that we were supposed to? Or that we aren't passing some options that cargo expects here?

comment:2 Changed 18 months ago by teor

Milestone: Tor: 0.3.2.x-finalTor: 0.3.3.x-final

These bugfix tickets have no patches. The earliest they will get done is 0.3.3.

comment:3 Changed 18 months ago by teor

Keywords: 032-backport added

This is a backport candidate

comment:4 Changed 17 months ago by nickm

Keywords: 033-triage-20180320 added

Marking all tickets reached by current round of 033 triage.

comment:5 Changed 17 months ago by nickm

Keywords: 033-removed-20180320 added

Mark all not-already-included tickets as pending review for removal from 0.3.3 milestone.

comment:6 Changed 17 months ago by isis

Keywords: 033-removed-20180320 removed
Owner: set to isis
Points: 1
Sponsor: SponsorM-can
Status: newaccepted

It might be something glitchy/weird with your local cargo setup on the Mac? Maybe try doing cargo clean in the protover directory and running make test-rust again? Also, possibly your lockfile has something weird going on, so maybe if that doesn't fix it, try rm src/rust/Cargo.lock and running again?

Also if you add a --verbose flag to the cargo command in src/test/test_rust.sh, we might find that cargo isn't passing the correct path to rustc.

Last edited 17 months ago by isis (previous) (diff)

comment:7 Changed 17 months ago by isis

Status: acceptedneeds_information

comment:8 Changed 17 months ago by isis

Keywords: 033-removed-20180320 added

Oops, adding the 033-removed-20180320 keyword back in for now, while in needs_information, because I'm not sure yet if it's eligible for fast-fix.

comment:9 Changed 17 months ago by isis

Keywords: fast-fix added; 033-removed-20180320 removed

Marking fast-fix as per Nick's recommendation.

Waiting on info from teor for bug reproduceability.

comment:10 in reply to:  9 Changed 17 months ago by teor

Replying to isis:

Marking fast-fix as per Nick's recommendation.

Waiting on info from teor for bug reproduceability.

Rust works for me, you should ask nickm, who reported the issue.

comment:11 Changed 17 months ago by nickm

wait, that was me? I thought it was you, teor! I'll see if it happens again.

comment:12 Changed 17 months ago by nickm

Resolution: worksforme
Status: needs_informationclosed

Oh. This was me, but after a bunch of experimentation, it turned out to have been caused by something stale in one of the cargo directories inside the tor build. "git clean -xf" made things work again.

Note: See TracTickets for help on using tickets.