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

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Mar 27 14:32:19 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                                |
Parent ID:                                       |         Points:  3
 Reviewer:  isis                                 |        Sponsor:
                                                 |  Sponsor8-can
-------------------------------------------------+-------------------------

Comment (by Hello71):

 I think I agree that libtool is too much work. Possibly we could revisit
 that if we move to a better build system at some point.

 I think I'll try my wrapper linker solution again and see how it works. If
 that doesn't work out, I'll do the solution where we do CI builds "no
 rust, ubsan + asan", "rust, asan only".

 There is another problem though. The Rust code is not really well
 segmented into crates right now; it is possible for one crate to call
 ''indirectly'' code in another crate, through the magic of static linking.
 However, this does not work in tests, because there we only use Rust code
 from a single crate. Simply adding `libtor_rust.a` does not work, since
 then we get multiple definition errors. Presently, this is not an issue,
 because the linker automagically optimizes everything out with `--gc-
 sections --as-needed`. For some reason though, adding asan confuses the
 linker, and trying to test anything but protover causes undefined
 references to protover functions (because the C version is not compiled if
 Rust is enabled, but if we are testing Rust then we only add the current
 Rust crate). Moreover, eventually it is likely that we will want real
 interdependencies between crates, and I think there is little to no value
 to juggle Rust dependencies when there are no even hypothetical plans to
 embed them in something other than Tor proper all together. I think the
 best solution is to just merge all our Rust crates together, and I've
 filed #25639 to that effect. There may be better solutions, and I'm open
 to suggestions, but it seems to me like that is the only practical one.

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


More information about the tor-bugs mailing list