]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: fix SSH server not starting in cases, re-ignore failing vcpkg CI jobs
authorViktor Szakats <commit@vsz.me>
Sun, 9 Mar 2025 12:14:31 +0000 (13:14 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 9 Mar 2025 22:28:07 +0000 (23:28 +0100)
Replace `Cwd::abs_path()` with `File::Spec->rel2abs()`. The former
requires the file to exist, but in some cases, it's missing.

Seen in MSVC vcpkg jobs using Chocolatey OpenSSH v8.0.0.1 ending up with
`$path=/d/a/curl/curl/bld/tests/log/3/server/ssh_server.pid`, which does
not exist while converting to an absolute path (the path is already
absolute, but the conversion is done unconditionally):
```
Use of uninitialized value in subroutine entry at D:/a/curl/curl/tests/pathhelp.pm line 128.
can't convert empty path at D:/a/curl/curl/tests/pathhelp.pm line 128.
```
Ref: https://github.com/curl/curl/actions/runs/13747741797/job/38444844173#step:14:1233 (master)
Ref: https://github.com/curl/curl/actions/runs/13751862952/job/38453816737#step:14:3185 (trace)

Also ignore 3 new libssh2 jobs failing due to memleak.

Partial revert of 1bd5ac998bbc943dbf812b2824ad0f532201734c #16570

Closes #16636

.github/workflows/windows.yml
tests/pathhelp.pm

index 83c61d37b4bac6e7a3b760947cb95aa507e9acfb..78bf71b90f21974e1b02cf28aacc906bdf7259ad 100644 (file)
@@ -922,6 +922,15 @@ jobs:
           export CURL_DIRSUFFIX='${{ matrix.type }}'
           export TFLAGS='-j8 ${{ matrix.tflags }}'
           TFLAGS+=' ~2310'  # flaky
+          TFLAGS+=' ~SCP'  # 601 603 612 617 619 621 641 665 2004 3022
+          TFLAGS+=' ~612'  # SFTP
+          if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then
+            TFLAGS+=' ~SFTP'
+          elif [[ '${{ matrix.install }}' = *'libssh2'* ]]; then
+            TFLAGS+=' ~615 ~616 ~618 ~620 ~622'  # Leak detected: memory still allocated: 22 bytes, allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2006, sshc->homedir = strdup(sshp->readdir_filename);
+          elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then
+            TFLAGS+=' ~614'  # 'SFTP pre-quote chmod' SFTP, pre-quote, directory
+          fi
           PATH="$PWD/bld/lib/${{ matrix.type }}:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64"
           PATH="/c/msys64/usr/bin:$PATH"
           cmake --build bld --config '${{ matrix.type }}' --target test-ci
index 963552770ce0495d7763f9e46bda99d4270c7e53..fcf4e9e962d5767ec25225d9a35dc74509622402 100644 (file)
@@ -51,7 +51,7 @@ package pathhelp;
 
 use strict;
 use warnings;
-use Cwd 'abs_path';
+use File::Spec;
 
 BEGIN {
     use base qw(Exporter);
@@ -118,20 +118,20 @@ sub sys_native_abs_path {
     my ($path) = @_;
 
     # Return untouched on non-Windows platforms.
-    return Cwd::abs_path($path) if !os_is_win();
+    return File::Spec->rel2abs($path) if !os_is_win();
 
     # Do not process empty path.
     return $path if ($path eq '');
 
     my $res;
     if($^O eq 'msys' || $^O eq 'cygwin') {
-        $res = Cygwin::posix_to_win_path(Cwd::abs_path($path));
+        $res = Cygwin::posix_to_win_path(File::Spec->rel2abs($path));
     }
     elsif($path =~ m{^/(cygdrive/)?([a-z])/(.*)}) {
         $res = uc($2) . ":/" . $3;
     }
     else {
-        $res = Cwd::abs_path($path);
+        $res = File::Spec->rel2abs($path);
     }
 
     $res =~ s{[/\\]+}{/}g;
@@ -147,14 +147,14 @@ sub build_sys_abs_path {
     my ($path) = @_;
 
     # Return untouched on non-Windows platforms.
-    return Cwd::abs_path($path) if !os_is_win();
+    return File::Spec->rel2abs($path) if !os_is_win();
 
     my $res;
     if($^O eq 'msys' || $^O eq 'cygwin') {
         $res = Cygwin::win_to_posix_path($path, 1);
     }
     else {
-        $res = Cwd::abs_path($path);
+        $res = File::Spec->rel2abs($path);
 
         if($res =~ m{^([A-Za-z]):(.*)}) {
             $res = "/" . lc($1) . $2;