[tor-bugs] #25386 [Core Tor/Tor]: fix rust tests

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Apr 19 02:26:45 UTC 2018


#25386: fix rust tests
-------------------------------------------------+-------------------------
 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 Hello71):

 latest iteration:

 1. still need to build a shared library

 2. still needs cleanup, i.e. splitting commits. current state of code
 LGTM, good if people want to review Tor on meson vs autotools :)

 3. needs testing on Mac and Windows (Rust should work on Windows now!)

 4. cargo testing a single directory is once again unsupported. should be
 possible without *too* much work, but I need to think of a good interface.
 I think this is not a huge issue though, since cargo doesn't rebuild
 everything anymore. Definitely shouldn't block this bug, anyways.

 5. everything works except rustdoc with asan due to aforementioned Rust
 bug. even Rust is built with asan, so it should catch everything asan can
 catch (within Rust limits, e.g. libstd is not instrumented). filed #25841
 for actually checking that this works.

 the basic architecture of this solution is fairly simple, and I tried to
 make minimal changes to the existing crate layout. it's basically 1. build
 a shared library, 2. get Rust to link with that shared library at compile-
 time, 3. use `LD_LIBRARY_PATH` so it can find it at run-time. the rest is
 finicky stuff to deal with Rust bugs like https://github.com/rust-
 lang/rust/issues/41807.

 "minimal changes" means build scripts instead of `links` key in manifest.
 the latter might be preferable since it means the build scripts don't need
 to know anything about where they're being built. however, because `links`
 keys may not be duplicated in a dependency tree, that requires all Rust ->
 C definitions to be in a single crate, which is better handled in #25639.

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


More information about the tor-bugs mailing list