[tor-bugs] #25386 [Core Tor/Tor]: Link Rust Tests to C Dependencies in Tor (allow integration testing from Rust to C)

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jun 1 02:47:49 UTC 2018


#25386: Link Rust Tests to C Dependencies in Tor (allow integration testing from
Rust to C)
-------------------------------------------------+-------------------------
 Reporter:  Hello71                              |          Owner:  Hello71
     Type:  defect                               |         Status:
                                                 |  needs_revision
 Priority:  High                                 |      Milestone:  Tor:
                                                 |  0.3.4.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.3.3.1-alpha
 Severity:  Normal                               |     Resolution:
 Keywords:  rust, tor-test, 033-backport,        |  Actual Points:
  review-group-34, 034-triage-20180328,          |
  034-included-20180401                          |
Parent ID:                                       |         Points:  3
 Reviewer:  isis                                 |        Sponsor:
                                                 |  SponsorQ
-------------------------------------------------+-------------------------

Comment (by nickm):

 To summarize, I think the issues here (as I understand them) are these.
 I'll try to isolate them better and in more detail over the course of the
 week, but for now I'm just writing them down so I won't forget.

   1. When we invoke cargo test, we need to make sure that RUSTFLAGS
 includes the -L and -l flags necessary to link our C code, including
 system libraries.  We can do that in lots of different ways.

   2. But doing this doesn't seem to actually pass the necessary flags to
 the linker when rustdoc is run.  That's one problem.  I think there have
 been a few bugs of this kind in the past, like https://github.com/rust-
 lang/cargo/issues/1401 .

   3. Remaining problem is that when we have compiled our C code using
 -fsanitize=address and -fsanitize=undefined, we get linker issues.  Adding
 these options to the linker line doesn't seem to help.  Possibly we need
 to explicitly link with the backend files here, or somehow stop rustc from
 telling the linker -nodefaultlibs?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25386#comment:45>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list