Skip to content

test1545 fails to compile in an AppVeyor CI job with [-Werror=deprecated-declarations] #12445

@vszakats

Description

@vszakats

I did this

test1545 fails to compile in an AppVeyor CI jobs since:
07a3cd8 #12421:
https://ci.appveyor.com/project/curlorg/curl/builds/48662893/job/ol8a78q9gmilb6wt#L1263

Due to how PowerShell works (or due to me implementing this
poorly), PowerShell just abruptly stops without leaving the details
in the log:

The running command stopped because the preference variable 
   "ErrorActionPreference" or common parameter is set to Stop:
C:/projects/curl/tests/libtest/lib1545.c: In function 'test':

https://ci.appveyor.com/project/curlorg/curl/builds/48662115/job/oaos4h0nf8nvwvrp#L1183

What is the way to tell PowerShell to show the full error and stop?

Current $ErrorActionPreference = 'Stop' in appveyor.yml
clearly stops but hides the error. Continue (the default) shows
the error but won't always stop.

For the full error see #12444, in which I left it to Continue, and which
actually stopped in this particular case (but I've seen otherwise when
testing this in #12331):

cmake : C:/projects/curl/tests/libtest/lib1545.c: In function 'test':
At line:112 char:3
+   cmake --build . --config $env:PRJ_CFG --parallel 2 --target testdep ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (C:/projects/cur...unction 'test'::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
C:/projects/curl/tests/libtest/lib1545.c:38:3: error: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init() [-Werror=deprecated-declarations]
   38 |   curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file",
      |   ^~~~~~~~~~~~
In file included from C:/projects/curl/tests/libtest/test.h:34,
                 from C:/projects/curl/tests/libtest/lib1545.c:24:
C:/projects/curl/include/curl/curl.h:2576:1: note: declared here
 2576 | curl_formadd(struct curl_httppost **httppost,
      | ^~~~~~~~~~~~
C:/projects/curl/tests/libtest/lib1545.c:38:3: error: 'CURLFORM_COPYNAME' is deprecated: since 7.56.0. Use curl_mime_name() [-Werror=deprecated-declarations]
   38 |   curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file",
      |   ^~~~~~~~~~~~
C:/projects/curl/include/curl/curl.h:2501:3: note: declared here
 2501 |   CURLFORM_COPYNAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
      |   ^~~~~~~~~~~~~~~~~
C:/projects/curl/tests/libtest/lib1545.c:39:16: error: 'CURLFORM_FILE' is deprecated: since 7.56.0. Use curl_mime_filedata() [-Werror=deprecated-declarations]
   39 |                CURLFORM_FILE, "missing-file", CURLFORM_END);
      |                ^~~~~~~~~~~~~
C:/projects/curl/include/curl/curl.h:2510:3: note: declared here
 2510 |   CURLFORM_FILE            CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),
      |   ^~~~~~~~~~~~~
C:/projects/curl/tests/libtest/lib1545.c:40:3: error: 'CURLOPT_HTTPPOST' is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST [-Werror=deprecated-declarations]
   40 |   curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost);
      |   ^~~~~~~~~~~~~~~~
C:/projects/curl/include/curl/curl.h:1190:21: note: declared here
 1190 |   CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
      |                     ^~~~~~~~~~~~~~~~
C:/projects/curl/include/curl/curl.h:1076:40: note: in definition of macro 'CURLOPTDEPRECATED'
 1076 | #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
      |                                        ^~
C:/projects/curl/tests/libtest/lib1545.c:47:3: error: 'curl_formfree' is deprecated: since 7.56.0. Use curl_mime_free() [-Werror=deprecated-declarations]
   47 |   curl_formfree(m_formpost);
      |   ^~~~~~~~~~~~~
C:/projects/curl/include/curl/curl.h:2612:1: note: declared here
 2612 | curl_formfree(struct curl_httppost *form);
      | ^~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors

Why only this single CI job? Possibly because that's the only
gcc 13 one for Windows? Though we must have it for non-Windows
in GHA and there is nothing Windows-specific in this.

I expected the following

Green CI

curl/libcurl version

master / 0eda1f6

operating system

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous Integrationtests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions