[tor-bugs] #22106 [Core Tor/Tor]: Initial Rust support
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon May 1 13:41:55 UTC 2017
#22106: Initial Rust support
--------------------------+------------------------------------
Reporter: Sebastian | Owner:
Type: defect | Status: needs_revision
Priority: Medium | Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
--------------------------+------------------------------------
Changes (by teor):
* status: new => needs_revision
Comment:
> 1) Just commit them along with the Rust and C source code
We typically have tightly-bound dependencies in src/ext, this would be a
good place for tor_util and maybe tiny_keccak (as we already have a C
keccak in ext).
I think it's ok to expect people to install rust's libc: we already do
this with libevent and {open,libre,*}SSL. They'll have to install rust, so
installing libc is a reasonable ask.
The code looks reasonable to me, but I have only known rust for a few
weeks.
Specific commits:
9a96733a2dab56342d6b3de1f2c2915429b21725
Should we run the following rust tests during make check?
* tiny_keccak (yes, if we include it in ext)
* libc (no, but we might want to run it on platforms with poor rust
support, so let's say that in the instructions)
57838056b20eb2fc555ff8dc9148fca1e22be3d3
src/or/config.c:
This violates the version-spec, which allows a single EXTRA_INFO with no
spaces in brackets.
https://gitweb.torproject.org/torspec.git/tree/version-spec.txt#n22
This matters for get_version(), because it's sent in response to GETINFO
version. This will at least break stem's version parsing, see:
https://gitweb.torproject.org/stem.git/tree/stem/version.py#n168
(Also see #22110 for a rare case where we break the version spec already,
and #22109 for adding unit tests for parsing our own version.)
(It would also matter for get_short_version(), which is in the descriptor,
but we're not adding "rust" to that.)
I'd prefer get_version add "(rust-*version*)", if possible.
But maybe it doesn't matter than much, we don't give C compiler versions.
In tor_int in main.c, we have existing code that does:
{{{
if (strstr(version, "alpha") || strstr(version, "beta"))
log_notice(LD_GENERAL, "This version is not a stable Tor release. "
"Expect more bugs than usual.");
}}}
Do we want to log some message about rust being experimental as well?
src/test/test_rust.c:
I'd tt_assert() the string is non-null before taking its length.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22106#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list