Page MenuHomePhorge

ArcanistBundleTestCase::testGitRepository fails
Open, Needs TriagePublic

Description

arc unit src/parser/__tests__/ArcanistBundleTestCase.php
fails reliably on two of my machines running git master of arcanist.
(Before you ask: Trying to use git bisect will just throw lots of PHP 8.4 deprecation errors at me.)

  • Fedora 42
  • php 8.4.8
  • git 2.49.0
EXCEPTION (Exception): Expected patch and actual patch for 5dec8bf28557f078d1987c4e8cfb53d08310f522 differ. Wrote actual patch to '/var/www/html/phorge/arcanist/src/parser/__tests__/patches//5dec8bf28557f078d1987c4e8cfb53d08310f522.gitpatch.real'.
#0 /var/www/html/phorge/arcanist/src/parser/__tests__/ArcanistBundleTestCase.php(87): ArcanistBundleTestCase->runGitRepositoryTests(Object(PhutilDirectoryFixture))
#1 /var/www/html/phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(639): ArcanistBundleTestCase->testGitRepository()
diff --git a/image_2.png b/image.png
copy from image_2.png
copy to image.png
index 229920a50597be0644f4b994d213fc7042050289..229920a50597be0644f4b994d213fc7042050289
GIT binary patch
literal 108
zc%17D@N?(olHy`uVBq!ia0y~yU|<1Z4kiW$2DQnYnhXpKk|nMYCBgY=CFO}lsSJ)O
z`AMk?p1FzXsX?iUDV2pMQ*9U+82CJ0978H@B_$}xGO$Q6Fqkkf@+2Od!oa}5;OXk;
Jvd$@?2>`UB82A7H

literal 108
zc%17D@N?(olHy`uVBq!ia0y~yU|<1Z4kiW$2DQnYnhXpKk|nMYCBgY=CFO}lsSJ)O
z`AMk?p1FzXsX?iUDV2pMQ*9U+82CJ0978H@B_$}xGO$Q6Fqkkf@+2Od!oa}5;OXk;
Jvd$@?2>`UB82A7H

diff --git a/image_2.png b/image_2.png
index 229920a50597be0644f4b994d213fc7042050289..69ac76e69fabc49d97339547b91cf748ab703052
GIT binary patch
literal 113
zc%17D@N?(olHy`uVBq!ia0y~yU|<1Z4kiW$2DQnYnhXpKk|nMYCBgY=CFO}lsSJ)O
z`AMk?p1FzXsX?iUDV2pMQ*9U+7=%4t978H@CH*<yz~IB<Qpmu>!(e=ok=^x?;WY*Z
O1_n=8KbLh*2~7Zgh8*nx

literal 108
zc%17D@N?(olHy`uVBq!ia0y~yU|<1Z4kiW$2DQnYnhXpKk|nMYCBgY=CFO}lsSJ)O
z`AMk?p1FzXsX?iUDV2pMQ*9U+82CJ0978H@B_$}xGO$Q6Fqkkf@+2Od!oa}5;OXk;
Jvd$@?2>`UB82A7H

Event Timeline

I'm not convinced that git bisect will help us. Spinning up what's around here:
Running a Fedora 38 live CD with php-8.2.18 and git-2.40.0 on current arcanist git master does not expose the issue. Test passes.
Running a Fedora 39 live CD with php-8.2.25 and git-2.41.0 on current arcanist git master does not expose the issue. Test passes.
Running a Fedora 40 live CD with php-8.2.11 and git-2.42.0 on current arcanist git master exposes the issue. Test does not pass.
Running a Fedora 40 live CD with php-8.2.11 and git-2.44.0 on current arcanist git master exposes the issue. Test does not pass.
Running a Fedora 40 live CD with php-8.3.0 and git-2.44.0 on current arcanist git master exposes the issue. Test does not pass.
Running a Fedora 40 live CD with php-8.3.20 and git-2.44.0 on current arcanist git master exposes the issue. Test does not pass.

This might be distribution related.

Weird. I cannot reproduce on Debian Trixie (13), with PHP 8.4.6 and git 2.47.2.

@aklapper Can you upload 5dec8bf28557f078d1987c4e8cfb53d08310f522.gitpatch.real ?

Given the output mentioned in the task description I assume it's generated on failure

@valerio.bozzolan See last code block in the task description

We end up in the depths of ArcanistBundle::newBase85Data() here.
Which tries to copy behavior of https://github.com/git/git/blob/master/diff.c#L3325-L3395 which may have changed over time (or not).
I'm still wondering if this is a change in git (the software) creating a binary diff which Phorge then compares to https://we.phorge.it/source/arcanist/browse/master/src/parser/__tests__/patches//5dec8bf28557f078d1987c4e8cfb53d08310f522.gitpatch.

ArcanistBundleTestCase says the commit in that failing test does // image_2.png is copied to image.png and then replaced.

If one extracted the git repo in https://we.phorge.it/source/arcanist/history/master/src/parser/__tests__/bundle.git.tgz locally, and git checkout fb28468d25a5fdd063aca4ca559454c998a0af51 (the commit before the problematic check), git branch foobar, git checkout foobar, one could probably try to reproduce if the steps were clearer. Because I have no clue what "copy and then replace" (by what?) means exactly.