-
-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3 new Windows GIX_TEST_IGNORE_ARCHIVES=1 failures with Git 2.48.1 #1849
Comments
Thanks a lot for the exhaustive evaluation of the issue (and for detecting it ahead of time in the first place). I understand that the tests are failing because the test-scripts don't create symlinks consistently anymore, even though nothing seems to have changed about the Quite puzzling. |
What puzzled me was that far more test fixture scripts would have failed if this was fully broken. I've looked into it further. It turns out that it is specifically renaming symlinks that is broken, which we are doing in the working tree with MSYS is not broken and This is caused by a new and--other than this bug--improved renaming implementation, which uses |
This is fascinating, thanks for figuring this out and sharing! Amazing that you managed to fix it as well! |
I accidentally closed this, sorry. It is not fixed yet; that was a misclick. I've reopened it. I suggest that this be kept open until the forthcoming workaround to let CI pass can be removed, and using this to track that. What I actually wanted to post here, when accidentally clicking the wrong thing, is... The fix is planned to appear in Git 2.49.0, but currently that only has a release candidate. Meanwhile, new stable GitHub Actions images that upgrade Git to 2.48.1 are available and now deployed on GitHub-hosted runners, including 20250224 of the Windows Server 2022 image used in New CI runs therefore now fail in the Fortunately, a workaround to partly or completely suppress the affected tests when they are run that way on CI can be put in place for the mean time, then undone later. I don't have time to do that at the moment, but I'd be pleased to do it soon, probably later today. |
This is to work around for GitoxideLabs#1849 while still running tests and fixture scripts that rely on the ability of `git` to rename symlinks on Windows.
This is to work around for GitoxideLabs#1849 while still running tests and fixture scripts that rely on the ability of `git` to rename symlinks on Windows.
This is to work around for GitoxideLabs#1849 while still running tests and fixture scripts that rely on the ability of `git` to rename symlinks on Windows.
This is to work around GitoxideLabs#1849, while still running tests and fixture scripts that rely on `git` being able to to rename symlinks on Windows.
This is to work around GitoxideLabs#1849, while still running tests and fixture scripts that rely on Git being able to rename symlinks on Windows.
This is to work around GitoxideLabs#1849, while still running tests and fixture scripts that rely on Git being able to rename symlinks on Windows.
I've opened #1870 as a workaround. This uses a different approach than I mentioned in #1849 (comment) as expecting to use. |
This is to work around GitoxideLabs#1849, while still running tests and fixture scripts that rely on Git being able to rename symlinks on Windows.
Unlike #1622, where it makes sense for the test suite to account for the underlying Git bug, I don't think we should do anything like that for this. It seems to me that this bug is more harmful to ignore, such that if someone is working on gitoxide and running the tests with an affected version of Git for Windows, it is better that they observe the failures (then they can still decide to skip some tests or ignore failures). However, the affected version, 2.48.1, may remain in some use for a while, because, per the release notes:
Of course, people should not use a version one it is no longer maintained. However, I expect that this may continue to be used as people move 32-bit workloads to MinGit. To figure out if differences are due to full vs. MinGit, some people will likely use both the full and MinGit of 2.48.1. Actually, I have little idea how many people will do that. It may be rare. But I expect to do it while figuring out if there is a way to continue testing gitoxide on 32-bit Windows, as well as part of figuring out if there is anything gitoxide needs to do differently to interoperate with MinGit (such as related to finding the shell, see MinGit-related entries in #1761). But I think that, when doing that, it is still better to get the test failures than for someone who has not deliberately sought to suppress them to get them. (They only occur with However, if it turns out to be necessary to get these tests to pass with |
Now that Git for Windows 2.49.0 has a stable release, this changes the upgrade step that was added to `test-fixtures-windows` in 4237e5a (GitoxideLabs#1870), so that it downloads an installer from the release marked as "latest", rather than the release that has the newest tag. The release marked "latest" is usually a stable release in projects that have any stable releases, and in particular it is a stable release in Git for Windows. This is *not* needed to switch from the release candidate to the stable release for 2.49.0. The download logic already in place currently gets the stable release automatically, because it is the newest tag. Nonetheless, there are three reasons to prefer the "latest" tag to get the stable release, now that the stable release is available. In descending order of significance, they are: - We upgrade to work around GitoxideLabs#1849, for which 2.49.0 is preferable to 2.48.1 (which the Windows runner images currently have). Continuing to take the newest tag will eventually take a pre-release for the next version. That would probably work, but it is not currently a goal. There is sometimes a delay between when a stable release of Git for Windows comes out and when the stable runner images are released with it. (Pre-release runner images exist, but they are not run on GitHub-hosted runners.) So even assuming this upgrade step is to be removed once it is no longer needed, it could easily end up remaining long enough for a new Git for Windows pre-release to come out. - An update may potentially be released for an earlier minor version (y in x.y.z), in which case the tag for it would be newer and we would downgrade instead. Now that the release marked "latest" is usable here, we can use it and avoid that. - If we decide to eventually deliberately test pre-releases, the step added in GitoxideLabs#1849 would probably not be usable in that form, because it could take either the next pre-release or a patch to an ealier release per the above points, and also for the separate reason that this CI job is not necessarily where we would want to test that. (As one example, there is currently no CI testing of the Git for Windows SDK, even though supporting it is an explicit goal discussed in GitoxideLabs#1758, GitoxideLabs#1761, GitoxideLabs#1862, and GitoxideLabs#1864. If that is added, it may be a more opportune way to test prereleases.)
Now that Git for Windows 2.49.0 has a stable release, this changes the upgrade step that was added to `test-fixtures-windows` in 4237e5a (GitoxideLabs#1870), so that it downloads an installer from the release marked as "latest", rather than the release that has the newest tag. The release marked "latest" is usually a stable release in projects that have any stable releases, and in particular it is a stable release in Git for Windows. This is *not* needed to switch from the release candidate to the stable release for 2.49.0. The download logic already in place currently gets the stable release automatically, because it is the newest tag. Nonetheless, there are three reasons to prefer the "latest" tag to get the stable release, now that the stable release is available. In descending order of significance, they are: - We upgrade to work around GitoxideLabs#1849, for which 2.49.0 is preferable to 2.48.1 (which the Windows runner images currently have). Continuing to take the newest tag will eventually take a pre-release for the next version. That would probably work, but it is not currently a goal. There is sometimes a delay between when a stable release of Git for Windows comes out and when the stable runner images are released with it. (Pre-release runner images exist, but they are not run on GitHub-hosted runners.) So even assuming this upgrade step is to be removed once it is no longer needed, it could easily end up remaining long enough for a new Git for Windows pre-release to come out. - An update may potentially be released for an earlier minor version (y in x.y.z), in which case the tag for it would be newer and we would downgrade instead. Now that the release marked "latest" is usable here, we can use it and avoid that. - If we decide to eventually deliberately test pre-releases, the step added in GitoxideLabs#1849 would probably not be usable in that form, because it could take either the next pre-release or a patch to an ealier release per the above points, and also for the separate reason that this CI job is not necessarily where we would want to test that. (As one example, there is currently no CI testing of the Git for Windows SDK, even though supporting it, in general and for running the test suite, is an explicit goal discussed in GitoxideLabs#1758, GitoxideLabs#1761, GitoxideLabs#1862, and GitoxideLabs#1864. If that is added, it may be a more opportune way to test prereleases.)
Current behavior 😯
When the test suite is run on Windows with
GIX_TEST_IGNORE_ARCHIVES=1
, there are three new failures starting in Git for Windows 2.48.1. I don't know if the problem is in Git for Windows, gitoxide, or gitoxide's test suite:gix-diff-tests::diff index::renames_by_identity
gix-diff-tests::diff tree_with_rewrites::renames_by_identity
gix-merge::merge tree::run_baseline
Those links go to the directly relevant sections of the test output in a gist that contains the full output. The directly relevant sections themselves are:
gix-diff-tests::diff index::renames_by_identity
gix-diff-tests::diff tree_with_rewrites::renames_by_identity
gix-merge::merge tree::run_baseline
In that third test, navigating to
C:/Users/ek/source/repos/gitoxide/gix-merge/tests/fixtures/generated-do-not-edit/tree-baseline/3163911692-windows/rename-add-same-symlink
reveals thatlink
is a symlink pointing totarget
andlink-new
is a regular file. The output ofls
(i.e.Get-ChildItem
, as this is in PowerShell) is:The output of
git status
is:The relevant fixture script code for that test is:
gitoxide/gix-merge/tests/fixtures/tree-baseline.sh
Lines 337 to 355 in 2efce72
This made me wonder if this is no longer taking effect with the version of MSYS2 provided by Git for Windows that provides the Git Bash environment:
gitoxide/tests/tools/src/lib.rs
Lines 620 to 621 in 2efce72
But at least under a cursory examination that does not seem to be broken: I am able to create actual symlinks with
ln -s
when setting that environment variable and invoking thebash
shell provided by Git for Windows, including when version 2.48.1 is installed, and it works whether thebash.exe
I use is the "real"bash
in(git root)/usr/bin
, the Git for Windows wrapper in(git root)/bin
, or thescoop
wrapper that calls the(git root)/bin
wrapper.The run shown and linked above was from PowerShell 7.5. All the same failures, including those three, occur when running the tests on the same system from Git Bash. The same tests will typically pass or fail from either environment, since a
bash.exe
shipped with Git for Windows is used either way since #1712 fixed #1359; these new failures do not go against that expectation.Modifying
gix-testtools
to use a path tobash.exe
in which all directory separators are/
does not affect the results. The test failures do not seem to suggest that this would, but I mention this in case it turns out to be relevant. (The reason I know this is that I discovered this bug while testing such a change on a feature branch, then when rerunning tests on the main branch discovered that it was not caused by that change.)Expected behavior 🤔
Ideally no tests should fail, but the specific expectation that is broken here is that no tests other than the 15 tests known to fail on Windows with
GIX_TEST_IGNORE_ARCHIVE=1
and documented in #1358--one of which is a performance test that does not always fail locally and in practice never fails on CI--should fail.This expectation continues to hold when the test suite is run with Git for Windows 2.47.1(2). Running the tests in otherwise the same local environment matches CI. It is only with Git for Windows 2.48.1 that these three tests fail.
The reason they are not yet failing on CI in the
test-fixtures-windows
job--which since #1663 will reliably detect any such new failures--appears to be that the runner image being used has Git for Windows 2.47.1(2). It seems likely that those new failures will occur on CI once it is upgraded to 2.48.1.Git behavior
A change in Git is involved in triggering this, but I don't know what the change is, nor if the change is itself correct.
git-for-windows/git#5411, which pertains to the 2.48.1 release of Git for Windows, links to git-for-windows/git#5376, which mentions that, for 2.48, Git for Windows integrated some patches from the Git mailing list before they were integrated into the upstream Git. I'm not sure to what extent Git for Windows 2.48.1 has Windows-nonspecific patches that didn't make it upstream yet, though. (The Git for Windows 2.48.1 release page does not list such changes.) Even if Git for Windows 2.48.1 does contain such changes, I do not assume that they would be the cause of this.
Steps to reproduce 🕹
This is mostly detailed above, but the specific commands I used to run the tests in PowerShell were:
And in Git Bash, where the results were the same:
I ran the tests on the main branch at 2efce72 on my main Windows 10 development machine. After initially running them with Git for Windows 2.48.1 installed, I downgraded Git for Windows to 2.47.1(2) and verified that the new failures did not occur, then upgraded it back to 2.48.1 and verified again that they failed again and in the same way. Both versions were installed using
scoop
, from the scoop main bucket. This packages Portable Git. I do not think that the use ofscoop
is important here--the trigger seems to be Git for Windows 2.48.1--but I mention it just in case. I also ran the tests withoutGIX_TEST_IGNORE_ARCHIVES=1
to verify that these tests only fail when that is set.To check if the problem was specific to Windows, I verified that are still no failures on Arch Linux with Git 2.48.1-1 or Git 2.48.1-2, nor on Ubuntu 24.04 LTS with Git 2.48.1-0 from the git-core PPA, including running the tests both with and without
GIX_TEST_IGNORE_ARCHIVES=1
on each. Before each test run, I rangix clean -xde
(not just before the test runs shown above).The text was updated successfully, but these errors were encountered: