Commit Graph

281 Commits

Author SHA1 Message Date
Nick Mathewson 875de204e9 cargo_audit: Add an exception for RUSTSEC-2022-0093.
This is the API deficiency in ed25519-dalek v1 that allows you to
mismatch public and private keys, leading to a (fatal)
double-signing attack.  We have worked around this in our current
design, so it's appropriate to suppress this warning for now.
2023-08-14 14:15:15 -04:00
Emil Engler e8cdc4c3d2
maint: use relative shebang in `maint/bump_nodep` 2023-08-09 14:33:01 +02:00
Ian Jackson 17b78f6108 Merge branch 'with_coverage-no-list' into 'main'
maint: provide no list of grcov formats

See merge request tpo/core/arti!1482
2023-08-09 10:37:43 +00:00
Emil Engler ab4d0182ab
maint: remove useless optarg
The `maint/coverage` script has a useless option `c`.
This commit removes it.
2023-08-08 16:32:31 +02:00
Emil Engler 3c1e5e32c2
maint: list the HTML dependencies in coverage
Currently, the `maint/coverage` script does not inform about the
dependencies required for generating the HTML output, those are, the
Python packages `bs4` and `lxml`.

This commit fixes that, by updating the help section accordingly.
2023-08-08 16:29:53 +02:00
Emil Engler e584cc8c08
maint: provide no list of grcov formats
This commit removes a list we provide for the supported grcov formats.
In my opinion, this is a practice of bad software engineering, as we would then
have to maintain this list by ourselves.

Therefore, this commit removes this list from the `maint/with_coverage` script
and replaces it with a references to the accompanying grcov command.
2023-08-08 16:16:21 +02:00
Nick Mathewson 9db1cc430a add_warning: Change missing_docs,unreachable_pub to warn
Part of #951.  See comments for explanation of why this is important.
2023-08-04 07:43:16 -04:00
Micah Elizabeth Scott f24956d441 Add maint/check_all_lockfiles
Looks for any checked-in Cargo.lock files, and checks the lockfile
quickly by running `cargo tree --locked` there.
2023-08-03 10:10:42 -07:00
Micah Elizabeth Scott 21dfc6d58c equix/fuzz: CI and doc fixes
The build found a stale private doc comment as well as an exception
that needed to be made in check_doc_features.

The check_doc_features change solidifies a decision that things marked
with cfg(fuzzing) aren't part of the documented API.
2023-08-02 14:46:46 -07:00
Nick Mathewson b71b04eb84 Script to bump patchlevel without touching other crates
Closes #945.

Based on @diziet's comment in #945, with a little extra safety and
paranoia.  We use this for cases when there are trivial changes only
in one of our crates.
2023-08-01 12:57:58 -04:00
Micah Elizabeth Scott 61bf60d177 check_licenses: Whitelist for crates that may use LGPL-3.0-only
Narrows the previous check, allowing this particular LGPL
only for the hashx and equix crates.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 13:23:26 -07:00
Micah Elizabeth Scott fdba82100f equix, hashx: Prepare for an initial LGPL release
This replaces the 'TODO' marker from earlier commits, using tevador's
copyright and license (LGPL 3.0 only) for the hashx and equix crates.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott a8756f2bce Reimplement HashX in Rust
This is a new pure Rust implementation of the HashX algorithm
designed by tevador for Tor's onion service proof of work puzzle v1.

HashX is a lightweight family of randomly generated hash functions.
A seed, via blake2 and siphash, drives a program generation model
which randomly selects opcodes and registers while following some
constraints that avoid timing stalls or insufficient hash mixing.

The execution of these hash funcions can be done using a pure Rust
interpreter, or about 20x faster using a very simple just in time
compiler based on the dynasm assembler crate. This has been
implemented for x86_64 and aarch64.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:06 -07:00
Dimitris Apostolou 947ddfff0c
Fix typos 2023-07-22 10:10:34 +03:00
Ian Jackson 1d644d2923 cargo audit: un-ignore RUSTSEC-2023-0040 ("`users` is unmaintained" 2023-07-14 16:02:45 +01:00
Ian Jackson 0251e99680 tor-proto: Add a suppression to "fix" the CI
This is failing in CI.  I have no idea what the rules are and AFAICT
no-one is alleging that there is an actual bug in the attributes.

Empirically this suppression causes the script to pass.
2023-07-12 15:32:27 +01:00
Ian Jackson 01cb7ee0a1 clippy: in tests, allow clippy::useless_vec
This is a perf issue, only.  If tests are too slow, we will notice and
ca speed them up.  We should optimise for clarity and convenience,
rather than speed.

Forbidding this can result in churn between vec![] and [] as tests are
updated and changed.
2023-07-10 13:49:51 +01:00
Ian Jackson 43bf89d540 clippy: globally allow clippy::needless_raw_string_hashes
Rationale: no-one writes these by default without thinkinh.  If they
are unnecessary, then either the string must have had " in it
before (in which case it might do again), or it is near other strings
which *do* need it.

And having it does no harm; indeed IMO it can increase clarity.

Alternative to !1388's
  Fix new "needless_raw_string_hashes" lint from clippy +nightly
2023-07-10 13:49:51 +01:00
Ian Jackson 80f397fb0b Merge branch 'allow_missing_panics' into 'main'
add_warning: Tolerate clippy::missing_panics_doc

Closes #950

See merge request tpo/core/arti!1380
2023-07-07 12:53:46 +00:00
Nick Mathewson 7e2fa11065 add_warning: Tolerate clippy::missing_panics_doc
As of current nightly, this lint now includes expect()s,
which makes it trigger way more than we'd like.

See discussion on #950.
2023-07-06 14:29:40 -04:00
Nick Mathewson 486b6b8c82 tor-rtcompat: Simplify trivial all() expressions.
Clippy nightly doesn't like `#[cfg(all(...))]` with only a single
expression inside the `all(...)`.

This requires an adjustment in check_doc_features.
2023-07-06 14:26:43 -04:00
Nick Mathewson e98f79617a Replace our old complex semver-checks script.
Now with cargo semver-checks >= 0.22.1, we no longer need to
jump through hoops in order to only look at the `full` features.
This, combined with our work on `fixup-features`, lets us be
confident that we're only looking at semver breakage in experimental
code.
2023-06-29 13:22:25 -04:00
Ian Jackson 802200e238 lints: Promote clippy::print_stderr and clippy::print_stdout
These are available in our MSRV now, so we don't need to handle
specially.  We can just add them to the standard lint block.

(Lint block in every crate will be updated automatically in the next
commit.)
2023-06-21 12:14:10 +01:00
Ian Jackson 952bcb11ed CI: add script to test every crate with default features 2023-06-14 18:47:51 +01:00
Gabriela Moldovan 54120b37bd
maint/cargo-audit: Ignore RUSTSEC-2023-0040 (the users crate is unmaintained)
Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-06-05 11:52:06 +01:00
Nick Mathewson 1f4cd3f389 New script to run cargo-semver-checks with appropriate options.
The options are rather complicated; because we do not want to
subject our experimental features to semver, we need to run generate
JSON rustdoc on our own and then pass that JSON to
cargo-semver-checks.  This in turn requires us to use the same
options that cargo-semver-checks uses, including "RUSTC_BOOTSTRAP".

I've left some TODOs here in places where we will likely want to
improve our code in the future.

See #711.
2023-05-31 10:04:29 -04:00
Nick Mathewson e5fa42e1c7 maint/check_license: Make MPL-2.0 into an allow-list
Previously we allowed this license unconditionally.  But because of its
non-self-enacting nature, we need the actual notice from its "exhibit A"
to appear somewhere that says that it applies to all the relevant code.

Therefore, we shouldn't take new MPL-2.0 dependencies without
hand-checking them.  (I am tentatively allowing option-ext, though,
since we already have an indirect dependency on that crate via
`directories`.)

For more info, see https://gitlab.torproject.org/tpo/core/arti/-/issues/845
2023-05-23 13:51:51 -04:00
Nick Mathewson 407a928022 thanks: Also acknowledge Suggested-By 2023-05-22 07:58:54 -04:00
Nick Mathewson 217a9ead49 maint/thanks: Split up some long pipelines 2023-05-18 13:28:45 -04:00
Nick Mathewson bd2b2a171f maint/thanks: Remove email addresses from git trailers
Okay, technically we're removing everything between the first `<` and
the `>` at the end of the line.
2023-05-18 13:27:03 -04:00
Nick Mathewson 8cf1ff5084 maint/thanks: Include some git trailers in acknowledgments
When building our list of acknowledgments, previously we would only
include author and committer names.

Now we also include anybody listed in the "Reported-by",
"Co-authored-by", and "Thanks" trailers.
2023-05-18 13:26:50 -04:00
Nick Mathewson 75776bb8a3 fixup-features: minor doc fix. 2023-05-15 08:27:48 -04:00
Nick Mathewson aa452d6627 fixup-features: Do not annotate non-features. 2023-05-15 08:27:48 -04:00
Nick Mathewson bcac88990f fixup-features: Do not add edges from non-features. 2023-05-15 08:27:48 -04:00
Nick Mathewson 3e61de4f48 fixup-features: distinguish internal and external edges
An external edge does not cause its target to be created as a feature.
2023-05-15 08:11:30 -04:00
Nick Mathewson 85ce5162f5 fixup-features: Add an option to not annotate. 2023-05-15 08:11:30 -04:00
Nick Mathewson ae6254ac35 fixup-features: ability to add annotations for everything. 2023-05-15 08:11:30 -04:00
Nick Mathewson d5c21884fd fixup-features: fix off-by-one in argument reading. 2023-05-15 08:11:30 -04:00
Nick Mathewson 690c0134fe fixup-features: Implement remaining rules. 2023-05-15 08:11:30 -04:00
Nick Mathewson 5046e2003f fixup-features: Enforce __is_experimental tagging rule. 2023-05-15 08:11:30 -04:00
Nick Mathewson d5a38fc5ed fixup-features: Revise our rule 2 enforcement to use newer APIs. 2023-05-15 08:11:30 -04:00
Nick Mathewson 6a468ee4ae fixup-features: Refactor "apply a list of changes" code into a new module. 2023-05-15 08:11:30 -04:00
Nick Mathewson 54e50205dd fixup-features: Make a feature graph type in a submodule
I tried to use petgraph, but it was optimized for performance over
usability, and the usability was beyond me.
2023-05-15 08:11:30 -04:00
Nick Mathewson 059af736e1 fixup-features: minor spelling and comment fixes. 2023-05-15 08:11:30 -04:00
Nick Mathewson 7c556eea67 fixup-features: Describe the semantics we actually want
The problem with our old rules is that "reachable from __nonadditive"
and "reachable from experimental" were not themselves sensible
definitions of nonadditive and experimental.

See
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1068#note_2887939
2023-05-15 08:11:30 -04:00
trinity-1686a 6d25a81a01 allow rustls-webpki license 2023-05-08 18:22:43 +02:00
Nick Mathewson 6cfc387f14 check-licenses: Permit MPL-2.0
The generational-arena crate is distributed under MPL-2.0,
so we need to allow it.

I believe that this license is fine and does not interfere with
our code or our users; the reviewer should double-check.
2023-05-04 10:35:05 -04:00
trinity-1686a 1b348f5613 fix macos reproducible builds 2023-04-16 13:22:18 +02:00
Nick Mathewson a9b1d8f612 Bump Rust version in reproducible build scripts
Now that we require 1.65, Rust 1.63 is no longer sufficient.
2023-04-13 07:31:20 -04:00
Nick Mathewson 104d64589d Increment MSRV to 1.65 in every crate. 2023-04-11 15:31:12 -04:00