{"thread":{"id":"64070","subject":"[PATCH] gitlab-ci: disable realtime monitoring to unbreak Windows jobs","startedAt":"2025-09-02T10:47:51Z","lastAt":"2025-09-03T04:39:43Z","messageCount":3,"participants":["Patrick Steinhardt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"525314","messageId":"20250902-b4-pks-gitlab-ci-windows-defender-v1-1-fcb1f19321aa@pks.im","threadId":"64070","inReplyTo":null,"subject":"[PATCH] gitlab-ci: disable realtime monitoring to unbreak Windows jobs","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-09-02T10:47:41Z","receivedAt":"2025-09-02T10:47:51Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"The GitLab CI runners using Windows machines have realtime monitoring\nvia Windows Defender enabled by default. This has just now started to\ncause issues in our CI jobs using Microsoft Visual Studio:\n\n    Program 'meson.exe' failed to run: Operation did not complete successfully because the file contains a virus or\n    potentially unwanted softwareAt line:356 char:1\n    + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...\n    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\n    At line:356 char:1\n    + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...\n    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n        + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException\n        + FullyQualifiedErrorId : NativeCommandFailed\n\nThe detected issue is more likely than not completely bogus, but it\nbreaks the jobs.\n\nFix the issue by disabling realtime monitoring. Besides unbreaking CI,\nit also improves our build times a bit:\n\n  - Building Git goes from 26 to 22 minutes.\n\n  - Executing tests goes from ~1h for one slice of tests to ~30 minutes.\n\nThis is still painfully slow, but the issue here is that the Windows\nrunners on GitLab CI are quite underwhelming overall.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\nHi,\n\nthis patch fixes some issues that started to surface in our Windows\njobs. A CI run of these changes to demonstrate that this works as\nintended can be found at [1].\n\nThanks!\n\nPatrick\n\n[1]: https://gitlab.com/gitlab-org/git/-/merge_requests/408\n---\n .gitlab-ci.yml | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/.gitlab-ci.yml b/.gitlab-ci.yml\nindex af10ebb59a..cf122e706f 100644\n--- a/.gitlab-ci.yml\n+++ b/.gitlab-ci.yml\n@@ -119,6 +119,7 @@ build:mingw64:\n   variables:\n     NO_PERL: 1\n   before_script:\n+    - Set-MpPreference -DisableRealtimeMonitoring $true\n     - ./ci/install-sdk.ps1 -directory \"git-sdk\"\n   script:\n     - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'\n@@ -135,6 +136,7 @@ test:mingw64:\n     - job: \"build:mingw64\"\n       artifacts: true\n   before_script:\n+    - Set-MpPreference -DisableRealtimeMonitoring $true\n     - git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'\n     - New-Item -Path .git/info -ItemType Directory\n     - New-Item .git/info/exclude -ItemType File -Value \"/git-sdk\"\n@@ -148,6 +150,7 @@ test:mingw64:\n   tags:\n     - saas-windows-medium-amd64\n   before_script:\n+    - Set-MpPreference -DisableRealtimeMonitoring $true\n     - choco install -y git meson ninja openssl\n     - Import-Module $env:ChocolateyInstall\\helpers\\chocolateyProfile.psm1\n     - refreshenv\n\n---\nbase-commit: 6ad802182101d622e6a4132f48292ddfa79e2024\nchange-id: 20250902-b4-pks-gitlab-ci-windows-defender-a5d13da02c77\n\n"},{"id":"525350","messageId":"xmqq8qiwlsn6.fsf@gitster.g","threadId":"64070","inReplyTo":"20250902-b4-pks-gitlab-ci-windows-defender-v1-1-fcb1f19321aa@pks.im","subject":"Re: [PATCH] gitlab-ci: disable realtime monitoring to unbreak Windows jobs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-09-02T16:35:09Z","receivedAt":"2025-09-02T16:35:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> The GitLab CI runners using Windows machines have realtime monitoring\n> via Windows Defender enabled by default. This has just now started to\n> cause issues in our CI jobs using Microsoft Visual Studio:\n>\n>     Program 'meson.exe' failed to run: Operation did not complete successfully because the file contains a virus or\n>     potentially unwanted softwareAt line:356 char:1\n>     + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...\n>     + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\n>     At line:356 char:1\n>     + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...\n>     + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n>         + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException\n>         + FullyQualifiedErrorId : NativeCommandFailed\n>\n> The detected issue is more likely than not completely bogus, but it\n> breaks the jobs.\n>\n> Fix the issue by disabling realtime monitoring. Besides unbreaking CI,\n> it also improves our build times a bit:\n>\n>   - Building Git goes from 26 to 22 minutes.\n>\n>   - Executing tests goes from ~1h for one slice of tests to ~30 minutes.\n\nInteresting observation.  I didn't realize that we are shipping\nvirus or potentially unwanted software.\n\nDoes the same issue exist on other forges (like GitHub Actions), I\nwonder?\n\n"},{"id":"525389","messageId":"aLfGiYisf22OQCvc@pks.im","threadId":"64070","inReplyTo":"xmqq8qiwlsn6.fsf@gitster.g","subject":"Re: [PATCH] gitlab-ci: disable realtime monitoring to unbreak Windows jobs","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-09-03T04:39:37Z","receivedAt":"2025-09-03T04:39:43Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Sep 02, 2025 at 09:35:09AM -0700, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > The GitLab CI runners using Windows machines have realtime monitoring\n> > via Windows Defender enabled by default. This has just now started to\n> > cause issues in our CI jobs using Microsoft Visual Studio:\n> >\n> >     Program 'meson.exe' failed to run: Operation did not complete successfully because the file contains a virus or\n> >     potentially unwanted softwareAt line:356 char:1\n> >     + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...\n> >     + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\n> >     At line:356 char:1\n> >     + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...\n> >     + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> >         + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException\n> >         + FullyQualifiedErrorId : NativeCommandFailed\n> >\n> > The detected issue is more likely than not completely bogus, but it\n> > breaks the jobs.\n> >\n> > Fix the issue by disabling realtime monitoring. Besides unbreaking CI,\n> > it also improves our build times a bit:\n> >\n> >   - Building Git goes from 26 to 22 minutes.\n> >\n> >   - Executing tests goes from ~1h for one slice of tests to ~30 minutes.\n> \n> Interesting observation.  I didn't realize that we are shipping\n> virus or potentially unwanted software.\n> \n> Does the same issue exist on other forges (like GitHub Actions), I\n> wonder?\n\nI would assume that other forges already know to disable realtime\nmonitoring by default. These are throwaway machines anyway, so there\nisn't much of a point in having it enabled in the first place. And as\nmentioned in the commit message, the Windows runners for GitLab CI are\nnot exactly well-polished.\n\nPatrick\n"}]}