~witcher/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
5 4

[PATCH rss-email 0/1] Replace OpenSSL with RustTLS

Details
Message ID
<20220816113539.2281035-1-srht@city17.xyz>
DKIM signature
missing
Download raw message
Hey!

This patch replaces the native OpenSSL dependency with the pure Rust implementation.
When possible I try to do that in my projects to reduce usage of system dependencies
and because I think RustTLS is mature enough.

After applying this patch, you can check with `cargo tree` that openssl is now nowhere.

What do you think? This patch was not discussed so totally fine if you decide
to discard it :)

I've only compiled so no guarantees I didn't break anything :) I think now you
can remove openssl also from the .build.yml

p.s. I've checked the build file for this project and found some interesting bits
that I'll steal for my projects, thanks!

p.p.s. I'm also on IRC

jman (1):
  Use RustTLS instead of native OpenSSL

 Cargo.toml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.35.1

[PATCH rss-email 1/1] Use RustTLS instead of native OpenSSL

Details
Message ID
<20220816113539.2281035-2-srht@city17.xyz>
In-Reply-To
<20220816113539.2281035-1-srht@city17.xyz> (view parent)
DKIM signature
missing
Download raw message
Patch: +2 -2
Signed-off-by: jman <srht@city17.xyz>
---
 Cargo.toml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index fe45c45..bb2c31e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,11 +11,11 @@ strip = "symbols"
diesel = { version = "1.4", features = ["sqlite"] }
rss = "2.0"
anyhow = "1.0"
reqwest = { version = "0.11", features = ["blocking"] }
reqwest = {version = "0.11", default-features = false, features = ["blocking", "rustls-tls"]}
clap = { version = "3", features = ["derive"] }
chrono = "0.4"
toml = "0.5.8"
lettre = "0.10.1"
lettre = { version = "0.10.1", default-features = false, features = ["rustls", "rustls-tls", "builder", "smtp-transport"] }
serde = { version = "1.0", features = ["derive"] }
diesel_migrations = "1.4.0"
directories = "4.0.1"
-- 
2.35.1

[rss-email/patches/.build.yml] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CM7F89RLRCX5.MGLUVK2W1F4N@cirno>
In-Reply-To
<20220816113539.2281035-2-srht@city17.xyz> (view parent)
DKIM signature
missing
Download raw message
rss-email/patches/.build.yml: FAILED in 52s

[Replace OpenSSL with RustTLS][0] from [jman][1]

[0]: https://lists.sr.ht/~witcher/public-inbox/patches/34708
[1]: srht@city17.xyz

✗ #824515 FAILED rss-email/patches/.build.yml https://builds.sr.ht/~witcher/job/824515
Details
Message ID
<20220816150032.mzigx73vmzhoubak@portable-navi>
In-Reply-To
<20220816113539.2281035-1-srht@city17.xyz> (view parent)
DKIM signature
missing
Download raw message
On 16.08.22 01:35, jman wrote:
>This patch replaces the native OpenSSL dependency with the pure Rust
>implementation.
Good idea, I've been struggling with cross-compilation with OpenSSL so
rustls is welcome!

>I've only compiled so no guarantees I didn't break anything :)
I just tested and can verify this is still working!
I should add tests in the near future, too, so contributing is easier.

>I think now you can remove openssl also from the .build.yml
Right! I forgot about it just now, but I'll do that, too.

>p.s. I've checked the build file for this project and found some
>interesting bits that I'll steal for my projects, thanks!
Haha you're welcome! I'm wondering whether I should remove the step
running `cargo clippy` as that takes a while and adds to the build time
dramatically (I already feel build for build times approaching 1 minute,
currently the CI takes *9 minutes*). It is quite important though, so
I'm not sure if/how I can improve the build times for the CI.

The build failed as I was verifying signatures on git commits from my
PGP key, so I removed it for now. Sorry about that!

Thanks for the small contribution! I applied it to upstream.

P.S.: Did you mean to send this to " m.mustermann@organization.org"?

-- 
witcher
https://wiredspace.de
Details
Message ID
<87sflrxawu.fsf@city17.xyz>
In-Reply-To
<20220816150032.mzigx73vmzhoubak@portable-navi> (view parent)
DKIM signature
missing
Download raw message
> I'm wondering whether I should remove the step
> running `cargo clippy` as that takes a while and adds to the build time
> dramatically (I already feel build for build times approaching 1 minute,
> currently the CI takes *9 minutes*). It is quite important though, so

I've investigated a little bit, You're building the artifacts twice: one in
debug mode (for tests, which I believe you don't have right now) and
one for release mode (the final application binaries). Then you run
cargo clippy over the debug artifacts.

I think you can avoid one build with this workflow:
```
cargo build --release
(cargo test --release)
cargo clippy --release -- -D warnings
```

and just reuse the existing release artifacts. You'll shave off 2'36" for
basically free.

Also, I'm not sure the "--no-deps" for clippy flag is useful here.
Unless you have a workspace I think it does not help, see here:
https://github.com/rust-lang/rust-clippy/blob/master/README.md#workspaces

> I'm not sure if/how I can improve the build times for the CI.

Beside some slight improvements playing with compile flags, I can't
think of anything really useful. Ideally the CI should be able to fetch
pre-compiled cached artifacts from somewhere if the dependencies never
change and just build your application. Something I didn't investigate
yet.

I would keep the release build optimized for performace and size, which
goes in the opposite direction of optimizing for build time.

> Thanks for the small contribution! I applied it to upstream.

Cool. Glad to help!
Details
Message ID
<20220820193552.ant7w5pbxd27rbiq@portable-navi>
In-Reply-To
<87sflrxawu.fsf@city17.xyz> (view parent)
DKIM signature
missing
Download raw message
On 20.08.22 01:28, jman wrote:
>You're building the artifacts twice
I've eventually noticed that, seems I forgot about fixing it. Oops!
Thanks for the reminder.

>You'll shave off 2'36" for basically free.
~2.5m is quite a bit of time. Glad I'm shaving that off of the CI
with simple fixes.

-- 
witcher
Reply to thread Export thread (mbox)