firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.15k stars 125 forks source link

rsync error with artifacts - Windows Gitbash #1026

Open texanator opened 9 months ago

texanator commented 9 months ago

Minimal .gitlab-ci.yml illustrating the issue

---
hello:
  image: ubuntu
  script:
    - echo "Heya" > tempfile
  artifacts:
    paths:
      - tempfile

Expected behavior

Host information

Containerd binary

Additional context

~/temp/smalls
$ gcl
Using fallback git commit data
Using fallback git remote data
parsing and downloads finished in 190 ms
hello starting ubuntu:latest (test)
hello copied to docker volumes in 1.14 s
hello $ echo "Heya" > tempfile
hello finished in 2.91 s
hello exported artifacts in 1.1 s
Error: Command failed with exit code 1: rsync --exclude=/.gitlab-ci-reports/ -a C:\Users\me\temp\smalls/.gitlab-ci-local/artifacts/hello/. C:\Users\me\temp\smalls
The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1426) [Receiver=3.2.7]
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Job.copyArtifactsOut (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:941:13)
    at done (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:467:17)
    at Job.start (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:498:16)
    at C:\snapshot\firecow-gitlab-ci-local\node_modules\p-map\index.js:57:22
firecow commented 9 months ago

What gitbash version are you using?

It's defininently a problem with those windows paths being passed to the "rsync" container.

texanator commented 9 months ago

I am using the Git for Windows SDK https://github.com/git-for-windows/build-extra/releases/tag/git-sdk-1.0.8

$ bash --version
GNU bash, version 5.2.15(1)-release (x86_64-pc-msys)

git-bash.exe shows File version: 2.42.0.2

$ rsync --version
rsync  version 3.2.7  protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
firecow commented 9 months ago

Can you try without --variable MSYS_NO_PATHCONV=1 @texanator

firecow commented 9 months ago
  • I am running the --variable MSYS_NO_PATHCONV=1 argument and I have it set as an environment variable.

You have set is as an environment variable, you say?

Please provide a printenv

texanator commented 9 months ago

Results of printenv

IntelliJ IDEA=C:\Program Files\JetBrains\IntelliJ IDEA 2022.1\bin;
ProgramFiles(x86)=C:\Program Files (x86)
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
!C:=C:\Users\me
SHELL=/usr/bin/bash
DATADIR=C:\Users\me\Documents
MSYS2_NOSTART=yes
NUMBER_OF_PROCESSORS=16
FPS_BROWSER_USER_PROFILE_STRING=Default
PROCESSOR_LEVEL=6
WD=C:\git-sdk-64\usr\bin\
MINGW_PREFIX=/mingw64
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
USERDOMAIN_ROAMINGPROFILE=OPR
WT_SESSION=29ed21c6-0179-4da1-9f54-c7d689881b07
HOSTNAME=WPWF106P
PROGRAMFILES=C:\Program Files
MSYSTEM=MINGW64
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
JAVA_HOME=C:\Users\me\dev\tools\jdk-17.0.2
ORIGINAL_TEMP=/tmp
MINGW_CHOST=x86_64-w64-mingw32
OS=Windows_NT
NVM_SYMLINK=C:\Program Files\nodejs
UATDATA=C:\PROD\WSD\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
OA=9
HOMEDRIVE=C:
ON=00
MSYSTEM_CARCH=x86_64
USERDOMAIN=OPR 
SIPDEVICEGROUP=LTS
PWD=/c/Users/me/temp/smalls
USERPROFILE=C:\Users\me
MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
MSYS_NO_PATHCONV=1
POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Enterprise
TZ=America/Chicago
TF_PLUGIN_CACHE_DIR=C:\Users\me\.terraform.d\plugin_cache
PRODDIR=C:\PROD
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/c/Program Files/WindowsApps/Microsoft.WindowsTerminal_1.17.11461.0_x64__8wekyb3d8bbwe:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Users/me/.kube:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/PROD/ISS:/c/Program Files/1E/Client/Extensibility/NomadBranch:/c/Users/me/bin:/c/Users/me/AppData/Roaming/Python/Python310/Scripts:/c/Users/me/AppData/Roaming/Python/Python310:/c/Users/me/dev/tools/apache-maven-3.8.5/bin:/c/Users/me/AppData/Local/Programs/Microsoft VS Code:/c/Program Files/PowerShell/7:/c/Users/me/dev/tools/jdk-17.0.2/bin:/c/Users/me/AppData/Local/Programs/Python38/Scripts:/c/Users/me/AppData/Local/Programs/Python38:/c/Program Files (x86)/Micro Focus/RUMBA:/c/Program Files (x86)/Micro Focus/RUMBA/System:/c/Program Files/Micro Focus/Rumba/system:/c/Users/me/dev/tools/git-filter-repo:/c/Windows/system32/config/systemprofile/AppData/Roaming/npm:/c/Program Files/Amazon/AWSCLIV2:/c/PROGRA~1/DB2/SQLLIB/BIN:/c/PROGRA~1/DB2/SQLLIB/FUNCTION:/c/Users/me/AppData/Roaming/nvm:/c/Program Files/nodejs:/c/Program Files/nodejs:/c/Program Files (x86)/HID Global/ActivClient:/c/Program Files/HID Global/ActivClient:/c/Users/me/dev/tools/zstd-v1.5.5-win64:/c/Program Files/Docker/Docker/resources/bin:/mingw64/bin:/c/Users/me/AppData/Local/Programs/Python310:/c/Users/me/AppData/Local/Programs/Python310/Scripts:/c/Users/me/AppData/Roaming/Python/Python310/Scripts:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Users/me/.kube:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/PROD/ISS:/c/Program Files/1E/Client/Extensibility/NomadBranch:/c/Users/me/bin:/c/Users/me/AppData/Roaming/Python/Python310/Scripts:/c/Users/me/AppData/Roaming/Python/Python310:/c/Users/me/dev/tools/apache-maven-3.8.5/bin:/c/Users/me/AppData/Local/Programs/Microsoft VS Code:/c/Program Files/PowerShell/7:/c/Users/me/dev/tools/jdk-17.0.2/bin:/c/Users/me/AppData/Local/Programs/Python38/Scripts:/c/Users/me/AppData/Local/Programs/Python38:/c/Program Files (x86)/Micro Focus/RUMBA:/c/Program Files (x86)/Micro Focus/RUMBA/System:/c/Program Files/Micro Focus/Rumba/system:/c/Users/me/dev/tools/git-filter-repo:/c/Windows/system32/config/systemprofile/AppData/Roaming/npm:/c/Program Files/Amazon/AWSCLIV2:/c/PROGRA~1/DB2/SQLLIB/BIN:/c/PROGRA~1/DB2/SQLLIB/FUNCTION:/c/Users/me/AppData/Roaming/nvm:/c/Program Files/nodejs:/c/Program Files/nodejs:/c/Program Files (x86)/HID Global/ActivClient:/c/Program Files/HID Global/ActivClient:/c/Users/me/dev/tools/zstd-v1.5.5-win64:/c/Program Files/Docker/Docker/resources/bin:/mingw64/bin:/c/Users/me/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/me/AppData/Roaming/Cloud Foundry:/c/Users/me/AppData/Roaming/nvm:/c/Program Files/nodejs:/c/Users/me/AppData/Roaming/npm
CommonProgramW6432=C:\Program Files\Common Files
HOME=/c/Users/me
USERNAME=me
SSH_ASKPASS=/mingw64/bin/git-askpass.exe
LANG=en_US.UTF-8
NBDomName=OPR
COMSPEC=C:\Windows\system32\cmd.exe
ONME=HOME
TMPDIR=/tmp
APPDATA=C:\Users\me\AppData\Roaming
SYSTEMROOT=C:\Windows
LOCALAPPDATA=C:\Users\me\AppData\Local
PROMPT=$P$G
COMPUTERNAME=WPWF106P
INFOPATH=/mingw64/local/info:/mingw64/share/info:/usr/local/info:/usr/share/info:/usr/info:/share/info
TERM=xterm-256color
NVM_HOME=C:\Users\me\AppData\Roaming\nvm
LOGONSERVER=\\WPSHDBQ6
ZES_ENABLE_SYSMAN=1
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
NO_PROXY=localhost,127.0.0.1
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell
DB2INSTANCE=DB2
TEMP=/tmp
MSYSTEM_CHOST=x86_64-w64-mingw32
DISPLAY=needs-to-be-defined
ORIGINAL_TMP=/tmp
SHLVL=1
DRIVE=C
PROCESSOR_REVISION=8d01
DriverData=C:\Windows\System32\Drivers\DriverData
COMMONPROGRAMFILES=C:\Program Files\Common Files
CONICON=mingw64.ico
AWS_SDK_LOAD_CONFIG=1
CLASSPATH=.;C:\PROGRA~1\DB2\SQLLIB\java\db2java.zip;C:\PROGRA~1\DB2\SQLLIB\java\db2jcc4.jar;C:\PROGRA~1\DB2\SQLLIB\java\db2jcc_license_cisuz.jar;C:\PROGRA~1\DB2\SQLLIB\java\db2jcc_license_cu.jar;C:\PROGRA~1\DB2\SQLLIB\bin
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 141 Stepping 1, GenuineIntel
SESSIONNAME=Console
PS1=
\[\033[1;34m\]\w\[\e[0m\] 
$ 
WSLENV=WT_SESSION::WT_PROFILE_ID
CHERE_INVOKING=enabled_from_arguments
PKG_CONFIG_SYSTEM_LIBRARY_PATH=/mingw64/lib
HOMEPATH=\Users\me
XDG_DATA_DIRS=/mingw64/share/:/usr/local/share/:/usr/share/
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=C:\Users\me\AppData\Roaming\Python\Python38\Scripts:C:\Users\me\AppData\Local\Programs\Python38\Scripts:C:\Users\me\AppData\Local\Programs\Python38:C:\Users\me\AppData\Local\Programs\Python310\Scripts:C:\Users\me\AppData\Local\Programs\Python310:/c/Users/me/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Program Files/WindowsApps/Microsoft.WindowsTerminal_1.17.11461.0_x64__8wekyb3d8bbwe:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Users/me/.kube:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/PROD/ISS:/c/Program Files/1E/Client/Extensibility/NomadBranch:/c/Users/me/bin:/c/Users/me/AppData/Roaming/Python/Python310/Scripts:/c/Users/me/AppData/Roaming/Python/Python310:/c/Users/me/dev/tools/apache-maven-3.8.5/bin:/c/Users/me/AppData/Local/Programs/Microsoft VS Code:/c/Program Files/PowerShell/7:/c/Users/me/dev/tools/jdk-17.0.2/bin:/c/Users/me/AppData/Local/Programs/Python38/Scripts:/c/Users/me/AppData/Local/Programs/Python38:/c/Program Files (x86)/Micro Focus/RUMBA:/c/Program Files (x86)/Micro Focus/RUMBA/System:/c/Program Files/Micro Focus/Rumba/system:/c/Users/me/dev/tools/git-filter-repo:/c/Windows/system32/config/systemprofile/AppData/Roaming/npm:/c/Program Files/Amazon/AWSCLIV2:/c/PROGRA~1/DB2/SQLLIB/BIN:/c/PROGRA~1/DB2/SQLLIB/FUNCTION:/c/Users/me/AppData/Roaming/nvm:/c/Program Files/nodejs:/c/Program Files/nodejs:/c/Program Files (x86)/HID Global/ActivClient:/c/Program Files/HID Global/ActivClient:/c/Users/me/dev/tools/zstd-v1.5.5-win64:/c/Program Files/Docker/Docker/resources/bin:/mingw64/bin:/c/Users/me/AppData/Local/Programs/Python310:/c/Users/me/AppData/Local/Programs/Python310/Scripts:/c/Users/me/AppData/Roaming/Python/Python310/Scripts:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Users/me/.kube:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/PROD/ISS:/c/Program Files/1E/Client/Extensibility/NomadBranch:/c/Users/me/bin:/c/Users/me/AppData/Roaming/Python/Python310/Scripts:/c/Users/me/AppData/Roaming/Python/Python310:/c/Users/me/dev/tools/apache-maven-3.8.5/bin:/c/Users/me/AppData/Local/Programs/Microsoft VS Code:/c/Program Files/PowerShell/7:/c/Users/me/dev/tools/jdk-17.0.2/bin:/c/Users/me/AppData/Local/Programs/Python38/Scripts:/c/Users/me/AppData/Local/Programs/Python38:/c/Program Files (x86)/Micro Focus/RUMBA:/c/Program Files (x86)/Micro Focus/RUMBA/System:/c/Program Files/Micro Focus/Rumba/system:/c/Users/me/dev/tools/git-filter-repo:/c/Windows/system32/config/systemprofile/AppData/Roaming/npm:/c/Program Files/Amazon/AWSCLIV2:/c/PROGRA~1/DB2/SQLLIB/BIN:/c/PROGRA~1/DB2/SQLLIB/FUNCTION:/c/Users/me/AppData/Roaming/nvm:/c/Program Files/nodejs:/c/Program Files/nodejs:/c/Program Files (x86)/HID Global/ActivClient:/c/Program Files/HID Global/ActivClient:/c/Users/me/dev/tools/zstd-v1.5.5-win64:/c/Program Files/Docker/Docker/resources/bin:/mingw64/bin:/c/Users/me/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/me/AppData/Roaming/Cloud Foundry:/c/Users/me/AppData/Roaming/nvm:/c/Program Files/nodejs:/c/Users/me/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl:/C/Users/me/.kube:/C/Users/me/.kube:/c/Users/me/.kube
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/mingw64
APPSDIR=C:\Program Files
LOGINSHELL=bash
CONTITLE=MinGW x64
WINDIR=C:\Windows
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
PROCESSOR_ARCHITECTURE=AMD64
WT_PROFILE_ID={87c5d26f-ca09-472c-b67e-7f15578a3881}
PUBLIC=C:\Users\Public
PKG_CONFIG_SYSTEM_INCLUDE_PATH=/mingw64/include
SYSTEMDRIVE=C:
OLDPWD=/c/Users/me
ProgramData=C:\ProgramData
EDXDEVICEGROUP=LTS
_=/usr/bin/printenv
texanator commented 9 months ago

Running gitlab-ci-local without MSYS_NO_PATHCONV results in the following error:

~/temp/smalls
$ gcl
Using fallback git commit data
Using fallback git remote data
parsing and downloads finished in 521 ms
hello starting ubuntu:latest (test)
hello copied to docker volumes in 1.21 s
hello $ echo "Heya" > tempfile
hello finished in 3.12 s
Error: Command failed with exit code 1: docker create -i  -v gcl-hello-334977-build:/gcl-builds/ -w /gcl-builds docker.io/firecow/gitlab-ci-local-util bash -c "shopt -s globstar nullglob dotglob
mkdir -p ../../artifacts/hello
rsync --exclude '.gitlab-ci-local/**' -Ra tempfile ../../artifacts/hello/. || true
"
Error response from daemon: the working directory 'C:/git-sdk-64/gcl-builds' is invalid, it needs to be an absolute path
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Job.copyOut (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:958:43)
    at Job.copyArtifactsOut (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:925:9)
    at done (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:467:17)
    at Job.start (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:498:16)
    at C:\snapshot\firecow-gitlab-ci-local\node_modules\p-map\index.js:57:22
texanator commented 9 months ago

The artifact is created in the expected .gitlab-ci-local directory when it runs and before the error is thrown.
.gitlab-ci-local\artifacts\hello\tempfile

gitlab-ci-local doesn't have any errors when using caching

---
 cache:
  key: $CI_COMMIT_REF_SLUG
  paths:
    - tmp

hello:
  image: ubuntu
  script:
    - echo "Heya" > tempfile
    - mkdir -p tmp
    - echo "Hellorld" > tmp/some.md
    - ls -la tmp
~/temp/smalls
$ gcl
Using fallback git commit data
Using fallback git remote data
parsing and downloads finished in 393 ms
hello starting ubuntu:latest (test)
hello copied to docker volumes in 1.11 s
hello imported cache 'main' in 290 ms
hello $ echo "Heya" > tempfile
hello $ mkdir -p tmp
hello $ echo "Hellorld" > tmp/some.md
hello $ ls -la tmp
hello > total 12
hello > drwxr-xr-x 2 root root 4096 Nov 10 14:26 .
hello > drwxrwxrwx 3 root root 4096 Nov 10 14:26 ..
hello > -rw-r--r-- 1 root root    9 Nov 10 14:26 some.md
hello finished in 3.17 s
hello exported cache tmp 'main' in 1.27 s

 PASS  hello
pipeline finished in 6.26 s

Hopefully that's useful information. This is an amazing app that you've built and I've found a lot of value in it even while working around the artifact issue.

valentinschabschneider commented 6 months ago

Running gitlab-ci-local without MSYS_NO_PATHCONV results in the following error:

~/temp/smalls
$ gcl
Using fallback git commit data
Using fallback git remote data
parsing and downloads finished in 521 ms
hello starting ubuntu:latest (test)
hello copied to docker volumes in 1.21 s
hello $ echo "Heya" > tempfile
hello finished in 3.12 s
Error: Command failed with exit code 1: docker create -i  -v gcl-hello-334977-build:/gcl-builds/ -w /gcl-builds docker.io/firecow/gitlab-ci-local-util bash -c "shopt -s globstar nullglob dotglob
mkdir -p ../../artifacts/hello
rsync --exclude '.gitlab-ci-local/**' -Ra tempfile ../../artifacts/hello/. || true
"
Error response from daemon: the working directory 'C:/git-sdk-64/gcl-builds' is invalid, it needs to be an absolute path
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Job.copyOut (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:958:43)
    at Job.copyArtifactsOut (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:925:9)
    at done (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:467:17)
    at Job.start (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:498:16)
    at C:\snapshot\firecow-gitlab-ci-local\node_modules\p-map\index.js:57:22

i also have this error

firecow commented 6 months ago

We need to get C:/git-sdk-64/gcl-builds to be /c/git-sdk-64/gcl-builds via gitbash terminal somehow.

JohannesLipp commented 1 month ago

Still having this issue today. No combination of {Windows CMD, PowerShell, Git Bash} and {gitlab-ci-local, gitlab-ci-local --variable MSYS_NO_PATHCONV=1} works on my Windows machine.

Git Bash returns:

Error response from daemon: the working directory 'C:/Program Files/Git/gcl-builds' is invalid, it needs to be an absolute path
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Job.execScripts (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:759:43)
    at Job.execPreScripts (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:609:36)
    at Job.start (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:506:9)
    at C:\snapshot\firecow-gitlab-ci-local\node_modules\p-map\index.js:57:22

Both Windows consoles return:

Error: Command failed with exit code 1: rsync -a --delete-excluded --delete --exclude-from=<(git ls-files -o --directory | awk '{print "/"$0}') --exclude .gitlab-ci-local/ ./ .gitlab-ci-local/builds/.docker/
<3>WSL (1079) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (1079) ERROR: CreateProcessEntryCommon:508: Create process not expected to return
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Function.rsyncTrackedFiles (C:\snapshot\firecow-gitlab-ci-local\src\utils.ts:260:9)
    at handler (C:\snapshot\firecow-gitlab-ci-local\src\handler.ts:98:9)
    at Object.handler (C:\snapshot\firecow-gitlab-ci-local\src\index.ts:37:21)

Unfortunately, it does not create a directory .gitlab-ci-local\artifacts\ with content in it, as @texanator posted above.

Puncher1 commented 1 month ago

Still having this issue today. No combination of {Windows CMD, PowerShell, Git Bash} and {gitlab-ci-local, gitlab-ci-local --variable MSYS_NO_PATHCONV=1} works on my Windows machine.

Git Bash returns:

Error response from daemon: the working directory 'C:/Program Files/Git/gcl-builds' is invalid, it needs to be an absolute path
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Job.execScripts (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:759:43)
    at Job.execPreScripts (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:609:36)
    at Job.start (C:\snapshot\firecow-gitlab-ci-local\src\job.ts:506:9)
    at C:\snapshot\firecow-gitlab-ci-local\node_modules\p-map\index.js:57:22

Both Windows consoles return:

Error: Command failed with exit code 1: rsync -a --delete-excluded --delete --exclude-from=<(git ls-files -o --directory | awk '{print "/"$0}') --exclude .gitlab-ci-local/ ./ .gitlab-ci-local/builds/.docker/
<3>WSL (1079) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (1079) ERROR: CreateProcessEntryCommon:508: Create process not expected to return
    at makeError (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\snapshot\firecow-gitlab-ci-local\node_modules\execa\index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Function.rsyncTrackedFiles (C:\snapshot\firecow-gitlab-ci-local\src\utils.ts:260:9)
    at handler (C:\snapshot\firecow-gitlab-ci-local\src\handler.ts:98:9)
    at Object.handler (C:\snapshot\firecow-gitlab-ci-local\src\index.ts:37:21)

Unfortunately, it does not create a directory .gitlab-ci-local\artifacts\ with content in it, as @texanator posted above.

Add MSYS_NO_PATHCONV to environment variables instead of using --variable MSYS_NO_PATHCONV=1, this fixed the first error for me and created .gitlab-ci-local\artifacts

JohannesLipp commented 1 month ago

Add MSYS_NO_PATHCONV to environment variables instead of using --variable MSYS_NO_PATHCONV=1, this fixed the first error for me and created .gitlab-ci-local\artifacts

Very confusing, but it works. Thank you! In the Git Bash, the command gitlab-ci-local --variable MSYS_NO_PATHCONV=1 does not work but MSYS_NO_PATHCONV=1 gitlab-ci-local works 🎉.

It reports an rsync error The source and destination cannot both be remote. at the end of execution, but still creates all expected contents in the .gitlab-ci-local\artifacts subdir.