Skip to content

GHA/windows: enable MulitSSL in an MSVC job #14276

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

Closed
wants to merge 1 commit into from

Conversation

talregev
Copy link
Contributor

@talregev talregev commented Jul 26, 2024

Ref: 98da147 #14305
Closes #14276

@github-actions github-actions bot added Windows Windows-specific CI Continuous Integration labels Jul 26, 2024
@vszakats
Copy link
Member

vszakats commented Jul 26, 2024

Can you make this part of an existing job?

These jobs are already flaky and each one added increases the chance for a PR to go red.

@talregev
Copy link
Contributor Author

talregev commented Jul 26, 2024

Can you make this part of an existing job?

These jobs are already flaky and each one added increases the chance for a PR to go red.

This PR is just meant to show the compilation problem. When it solve, we can think where to put the multissl.
I can put this PR on draft.

@talregev talregev force-pushed the TalR/multissl branch 5 times, most recently from e1fed55 to 3ce5893 Compare July 26, 2024 13:31
@talregev talregev force-pushed the TalR/multissl branch 2 times, most recently from 9b83dea to 4faa896 Compare July 29, 2024 20:28
@talregev
Copy link
Contributor Author

@vszakats I add another suggestion.

@talregev
Copy link
Contributor Author

talregev commented Jul 29, 2024

https://stackoverflow.com/questions/40738351/forward-declaration-as-struct-vs-class

I think the link is misleading, because it talk another warning.

@talregev
Copy link
Contributor Author

https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements-2017?view=msvc-170#uninitialized-const-variables

There is a problem with forward deceleration and const. Maybe it is msvc bug?

@bagder
Copy link
Member

bagder commented Jul 29, 2024

const object should be initialized

Global variables are guaranteed to be initialized to zero according to the standard. So what exactly does this mean?

@talregev talregev requested a review from vszakats July 29, 2024 21:07
@talregev
Copy link
Contributor Author

talregev commented Jul 29, 2024

const object should be initialized

Global variables are guaranteed to be initialized to zero according to the standard. So what exactly does this mean?

On the original code on line 417, is forward declaration, not a definition. It should not do initialization on this line.
For me it seems that you cannot do forward declaration with static const in msvc, even if it legal in c. That why I think it msvc bug.

@talregev
Copy link
Contributor Author

@talregev
Copy link
Contributor Author

talregev commented Jul 29, 2024

Copy link
Member

@vszakats vszakats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! As discussed earlier, I'd prefer integrating this into an existing job, rather than adding a new one, to avoid adding more chance for flakiness.

How about enabling Schannel in the existing 'openssl' job?

@vszakats vszakats changed the title Add mulitssl msvc test GHA/Windows: add MSVC MulitSSL job Jul 29, 2024
@talregev
Copy link
Contributor Author

talregev commented Jul 30, 2024

I know you don't want to add many tests. but my plan is to have multissl to install as much ssl backends for curl together.
I already succeeded with vcpkg to have 4
Can you consider it again?

C:\src\vcpkg\installed\x64-windows\tools\curl>curl --version
curl 8.9.0-DEV (Windows) libcurl/8.9.0-DEV GnuTLS/3.8.4 (mbedTLS/2.28.8) (OpenSSL/3.3.1) (Schannel) zlib/1.3.1
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe TLS-SRP Unicode UnixSockets

@vszakats
Copy link
Member

Tests will only run on the default TLS backend, so running with extra backends will not increase test coverage. Having a single extra backend tests the MultiSSL codepath, this is covered in this PR. Adding more backends would only add build tests for the extra backends. We have this covered for many now in separate jobs, and new ones can be appended to an existing job.

I think the situation with flaky MSVC jobs is already very bad, breaking almost all runs. I don't know why that it, but adding more flaky jobs don't seem to help us because of this.

All in all, I think we'd better off we using the existing openssl job to test MultiSSL, and untested backends can be appended there too.

@talregev
Copy link
Contributor Author

talregev commented Jul 30, 2024

Can we just build the tests without running them on multissl job?

Build the tests in different compiler will raise new warning that we can solve like this one.

@vszakats
Copy link
Member

Why would that be better than adding it to an existing job?

@talregev
Copy link
Contributor Author

My goal is to add on the same build, as much backend together. If I add more backends in openssl test, it will be not be a default anymore, because curl choose the default automatic according the first in the alphabet order.
As you can see this code is not compile with msvc on curl ci and then we found warning / errors on the code.
Also I want to find these error and warning, and try to fix them if possible.

@talregev talregev force-pushed the TalR/multissl branch 2 times, most recently from 3258212 to 59f4231 Compare July 30, 2024 14:47
@talregev
Copy link
Contributor Author

talregev commented Jul 30, 2024

I am not sure why the ci is failing.

@vszakats
Copy link
Member

vszakats commented Jul 30, 2024

My goal is to add on the same build, as much backend together. If I add more backends in openssl test, it will be not be a default anymore, because curl choose the default automatic according the first in the alphabet order. As you can see this code is not compile with msvc on curl ci and then we found warning / errors on the code. Also I want to find these error and warning, and try to fix them if possible.

You can manually select the default TLS backend using -DCURL_DEFAULT_SSL_BACKEND= if it becomes something else than OpenSSL.

The MultiSSL compiler warning came up because of enabling MultiSSL at all. Adding more backends will not uncover more such issues. Either way I've nowhere said not to enable more backends, but to add new ones to an existing job.

Also notice that MultiSSL isn't really where the puck is going in curl, e.g. because it lacks support for HTTP/3 and the original reasons for having it are now obsolete:
#12807 (comment)
#14308 (comment)

@talregev
Copy link
Contributor Author

ok. I will Enable Schannel in openssl job.
Thank you for your review, and time for listening my ideas.

@talregev talregev requested a review from vszakats July 30, 2024 15:02
@talregev
Copy link
Contributor Author

we can wait until the PR #14305 will be merge, and I will rebase this PR from the master after the merge.

vszakats pushed a commit that referenced this pull request Jul 30, 2024
The MSVC compiler cannot have forward declaration with const and static
variable, causing this error:
```
curl\lib\vtls\vtls.c(417,44): warning C4132: 'Curl_ssl_multi': const object should be initialized
```

Ref: #14276
Closes #14305
vszakats
vszakats previously approved these changes Jul 30, 2024
@vszakats vszakats changed the title GHA/Windows: add MSVC MulitSSL job GHA/Windows: enable MulitSSL in an MSVC job Jul 30, 2024
@vszakats vszakats dismissed their stale review July 30, 2024 23:44

CI broken

@vszakats
Copy link
Member

We need to find another job for MultiSSL. The openssl one has HTTP/3 enabled which is incompatible with MultiSSL. Hence the CI failure.

How about the 'Schannel U' job? It needs the -DCURL_DEFAULT_SSL_BACKEND=schannel option for keeping Schannel the default.

@talregev talregev force-pushed the TalR/multissl branch 2 times, most recently from a9e2df8 to e815503 Compare July 31, 2024 05:18
@talregev
Copy link
Contributor Author

Done.

@talregev talregev requested a review from vszakats July 31, 2024 05:42
@vszakats vszakats changed the title GHA/Windows: enable MulitSSL in an MSVC job GHA/windows: enable MulitSSL in an MSVC job Jul 31, 2024
@vszakats vszakats closed this in ec41cfb Jul 31, 2024
@vszakats
Copy link
Member

Thanks @talregev!

@talregev talregev deleted the TalR/multissl branch July 31, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Windows Windows-specific
Development

Successfully merging this pull request may close these issues.

4 participants