Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rustls-tls feature #1194

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Conversation

stefankreutz
Copy link
Contributor

Commit 14e7487 (cookie support #1146) re-introduced an unconditional
dependency on the openssl-sys crate. That is, building Lychee with the
Rustls TLS backend now requires OpenSSL. I suppose this change was
unintended, maybe due to automatic conflict resolution. If not, please
let me know.

You can review the re-introduced dependency like so:

cargo tree --no-default-features --features rustls-tls -i openssl-sys

This commit puts the OpenSSL dependency behind the native-tls feature
flag again.

You can check the TLS features like so:

cargo check --workspace --all-targets --features vendored-openssl

cargo check --workspace --all-targets --all-features

cargo check --workspace --all-targets --no-default-features --features rustls-tls

Maybe this should be added to CI. But I don't want to waste anybody's
time.

Commit 14e7487 (cookie support lycheeverse#1146) re-introduced an unconditional
dependency on the openssl-sys crate. That is, building Lychee with the
Rustls TLS backend now requires OpenSSL. I suppose this change was
unintended, maybe due to automatic conflict resolution. If not, please
let me know.

You can review the re-introduced dependency like so:

```
cargo tree --no-default-features --features rustls-tls -i openssl-sys
```

This commit puts the OpenSSL dependency behind the native-tls feature
flag again.

You can check the TLS features like so:

```
cargo check --workspace --all-targets --features vendored-openssl

cargo check --workspace --all-targets --all-features

cargo check --workspace --all-targets --no-default-features --features rustls-tls
```

Maybe this should be added to CI. But I don't want to waste anybody's
time.
@mre
Copy link
Member

mre commented Aug 2, 2023

Ah right, nice catch! It certainly wasn't intended, and we should add a check to CI/CD. Want to add it right away? I don't think it will significantly impact the CI runtime, as the crate should be built when we run the check. If it takes too long, we can also move it to the release pipeline.

Adds a new CI job 'check-feature-flags' to verify the following:

- Lychee with rustls-tls feature only doesn't depend on OpenSSL
- Cargo check passes with default features
- Cargo check passes with all features
- Cargo check passes with rustls-tls feature only
@stefankreutz
Copy link
Contributor Author

I've added a new CI job to check the TLS feature flags. It looks like it does work on my fork, but I'm not that familiar with Github Actions 😅

@mre
Copy link
Member

mre commented Aug 4, 2023

Thanks for adding the test.

The build time change is quite significant (80% increase), but it could also be flaky runners.

image

https://github.com/lycheeverse/lychee/actions/workflows/ci.yml?query=is%3Asuccess+branch%3Afix-rustls-tls-feature

Let me run the test once more to get a better picture. I guess we could also move the test into the release pipeline to block the release if it breaks. This way, we wouldn't pay for it during CI with the downside of not discovering the issue during feature development. We discussed that option already, but I'm undecided. Feedback welcome!

To be fair, the test runtime has deteriorated anyway in the last few months, as can be seen by checking the timings:
https://github.com/lycheeverse/lychee/actions/workflows/ci.yml?query=is%3Asuccess
It also varies a lot, so it might be fine? Maybe it's just the GitHub runner network connection being slow?

@mre
Copy link
Member

mre commented Aug 4, 2023

I was mistaken. Seems like check-feature-flags takes 33 seconds in the pipeline, and it runs next to the other checks, so nothing to worry about(?). I will go ahead and merge this. If it's causing problems, we can always refactor or move it into a separate pipeline.

Thanks for the fix and for caring about that part @stefankreutz. ⭐

@mre mre merged commit b1b32e7 into lycheeverse:master Aug 4, 2023
7 checks passed
@stefankreutz stefankreutz deleted the fix-rustls-tls-feature branch August 5, 2023 09:39
@mre mre added the bug Something isn't working label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants