johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
51 stars 9 forks source link

gitup: load_file: problem reading /usr/src/contrib/llvm-project/libcxx/include/__string: Input/output error #94

Closed grahamperrin closed 1 year ago

grahamperrin commented 1 year ago

Briefly:

  1. /usr/src might have been at 13.2.0 before the commands below
  2. gitup release -t release/13.1.0 included removal of the /usr/src/contrib/llvm-project/libcxx/include/__string directory and its contents (lines 14035 and 14036 of the attached transcript), with an invitation to rerun gitup
  3. gitup release -t release/13.1.0 failed with what might be a file-related error:
root@fuji:~ # gitup release -t release/13.1.0
# Scanning local repository...
# Host: git.freebsd.org
# Port: 443
# Repository Path: /src.git
# Target Directory: /usr/src
# Tag: release/13.1.0
# Have: 525ecfdad597980ea4cd59238e24c8530dbcd31d
# Want: fc952ac2212b121aa6eefc273f5960ec3e0a466d
# Action: pull
gitup: load_file: problem reading /usr/src/contrib/llvm-project/libcxx/include/__string: Input/output error
root@fuji:~ # 

error, __string.txt

Edge case, I suspect.

johnmehr commented 1 year ago

When I clone 525ecfdad5 and then pull fc952ac221, it goes through without any issue.

When I clone a previous commit (such as 3b5e5ce87b) then pull 525ecfdad5 and then pull fc952ac221, I get a different list of files to repair than what you're seeing and the repair never takes so this problem seems more widespread when reverting to earlier commits. This one might take me a while to fix.

grahamperrin commented 1 year ago

If it helps …

contrib/llvm-project/libcxx/include/__string is:

From https://github.com/johnmehr/gitup/issues/94#issue-1704546486:

… removal of the /usr/src/contrib/llvm-project/libcxx/include/__string directory and its contents (lines 14035 and 14036 of the attached transcript), …

Despite that, it still exists as a directory file:

root@fuji:~ # file /usr/src/contrib/llvm-project/libcxx/include/__string
/usr/src/contrib/llvm-project/libcxx/include/__string: directory
root@fuji:~ # 
johnmehr commented 1 year ago

I just committed a potential fix for this issue. When you have a chance, could you please retrace your steps and see if the problem persists? Thank you!

grahamperrin commented 1 year ago

Thanks. Cloned, but (sorry) I need a hint of how to build and install from source.

grahamperrin@fuji:~ % git -C ~/dev/gitup log -n 2 --oneline
2673dc7 (HEAD -> main, origin/main, origin/HEAD) Added fix for Issue #95
640d212 Added potential fix for Issue #94
grahamperrin@fuji:~ % 
johnmehr commented 1 year ago

If you cd into cloned directory and then execute make you should be able to run the updated code via ./gitup with your test parameters. Thanks!

grahamperrin commented 1 year ago

Sorry for taking so long.

… please retrace your steps and see if the problem persists? …

I think I retraced correctly, the problem is no longer reproducible. Thanks!

/usr/local/etc/gitup.conf temporarily edited to include these lines:

        "release" : {
                "repository" : "/src.git",
#               "branch"     : "releng/13.2",
                "branch"     : "releng/13.1",
#               "target"     : "/usr/src",
                "target"     : "/usr/home/grahamperrin/dev/freebsd/src",
                "ignores"    : [
                        "sys/amd64/conf",
                        "sys/arm64/conf",
                        "sys/i386/conf",
                        "sys/pc98/conf",
                        "sys/powerpc/conf",
                        "sys/riscv/conf",
                        "sys/sparc64/conf",
                ]
        },

Command history, condensed:

16:34   cd ~/dev/gitup
16:34   git pull --ff-only
16:34   make
16:53   cd ..
16:53   mkdir freebsd
16:53   cd freebsd
16:58   nano /usr/local/etc/gitup.conf
17:01   git clone https://git.freebsd.org/src.git
17:31   cd src
17:31   git fetch
18:10   git checkout release/13.1.0
18:12   git checkout release/13.2.0
18:15   man -P cat gitup
18:16   sudo rm -r /usr/home/grahamperrin/dev/freebsd/src/.git
18:20   sudo /usr/home/grahamperrin/dev/gitup/gitup release -t release/13.1.0

2023-09-23 success.txt

johnmehr commented 1 year ago

No worries!