Re: [BUG] Clones from local repositories do not work correctly under Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johannes,

Under a MSYS2 shell, follow these steps (feel free to replace the choice
of remote repo with any other supporting a Rust crate):

1. `cd` to a directory of your choice (let's call it `dirA`).
2. `git clone https://gitlab.gnome.org/GNOME/librsvg.git .`
3. `git checkout -b cerbero_build`.
4. `cd ..`
5. `git clone <full path to dirA> -s -b cerbero_build dirB`
6. `cd dirB`
7. `git status`

Now switch to any other shell of your choice, such as Git Bash, CMD, or
PowerShell, and try issuing commands such as `git status`. It will
result in a wall of "error: unable to normalize..."

To further the error state, try `git am` the attached diff to the repo
under the MSYS2 shell. It will succeed, but afterwards you'll also start
to get fatal errors from `git status`:

> error: unable to normalize alternate object path: <dirA>
> error: Could not read 819d81aefc255dee9d8845363038f7fdec809673
> fatal: Failed to traverse parents of commit
90042c71ef79cebeba782c98b26f0532de0e6a25

Attempting to build the repo using the well-known pair `meson setup
build; meson compile -C build` (assuming you have all the dependencies
around) will, at this step, crash at the very start with the following
Rust stacktrace:

> Error: CliError { error: Some(failed to determine package fingerprint for build script for librsvg v2.58.0-beta.1 (<dirB>/rsvg)
> 
> Caused by:
>     0: failed to determine the most recently modified file in <dirB>\rsvg
>     1: failed to determine list of files in <dirB>\rsvg
>     2: object not found - no match for id (32467a0191907fd571b502e395d033a06dfee655); class=Odb (9); code=NotFound (-3)), exit_code: 101 }

It should be noted, however, than exchanging the shells (cloning in Git
Bash, but then checking and patching under MSYS) appears to not cause
any errors. That leads me to believe there's some part of Git that is
not handling line separators under MSYS specifically.

> What is this .cache here?

This is part of the Cerbero package management system, used by GStreamer
to craft its SDK:

https://gitlab.freedesktop.org/gstreamer/cerbero.git

The above mentioned steps were reverse engineered from its caching steps.

Hope this is of use.

Best,

amyspark

On 12/04/2024 03:56, Johannes Sixt wrote:
> Am 11.04.24 um 19:03 schrieb L. E. Segovia:
>> Thank you for filling out a Git bug report!
>> Please answer the following questions to help us understand your issue.
>>
>> What did you do before the bug happened? (Steps to reproduce your issue)
>>
>> Under Windows 10 21H2, I cloned a Git repository off an existing local
>> copy, then applied a patch to it using `git am`.
> 
> This is an imprecise description of what you did. I did my best to
> follow these instructions, but could not reproduce the problem mentioned
> below.
> 
> You should post the commands you have given with their output.
> 
>>
>> What did you expect to happen? (Expected behavior)
>>
>> Operations on the repo like `git status` and `git log` should work out
>> of the box.
>>
>> What happened instead? (Actual behavior)
>>
>> I keep getting this error:
>>
>>> error: unable to normalize alternate object path:
>> /c/Users/Amalia/.cache/cerbero-sources/librsvg-2.40.20/.git/objects
> 
> What is this .cache here?
> 
> -- Hannes
> 

-- 
amyspark 🌸 https://www.amyspark.me
From 6519af2fbab17cd4b1861e6b9cbfbb2c76906edf Mon Sep 17 00:00:00 2001
From: "L. E. Segovia" <amy@xxxxxxxxxxx>
Date: Fri, 12 Apr 2024 09:43:51 -0300
Subject: [PATCH] test

---
 AUTHORS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/AUTHORS b/AUTHORS
index 9971ce58..7b2a9266 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -68,6 +68,7 @@ Kurosawa Takeshi
 liucougar
 LRN
 Laszlo Peter
+L. E. Segovia
 Luis Menina
 Maarten Bosmans
 Maciej Piechotka
-- 
2.44.0.windows.1


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux