Repository navigation
Fix minor SHA-256 issues in CLI - #3029
Sebastian Thiel (Byron) merged 5 commits into
Conversation
Instead, take it from `--object-hash`.
Fix key name in comment.
For 32-bit testing, I suspect you may not need a 32-bit VM, nor a 32-bit operating system installed on a compatible 64-bit VM. In principle you might be able to just install a 32-bit target and build for it and use it. This assumes you have a (physical or virtual) machine with a 64-bit CPU and operating system that is capable of running 32-bit binaries, either natively or by emulation. But even then there might be dependency problems on some 64-bit systems, which might not necessarily be easy to fix, especially if they come down to problems getting But containerization generally works fine! On a 64-bit system, you can use a 32-bit Docker image. This is how we test 32-bit ARM and x86 on CI, and those CI jobs should help point the way to doing it. gitoxide/.github/workflows/ci.yml Lines 387 to 409 in acf906f (You may also be able to test this by If you're using a system where the CPU doesn't support running machine code for the target architecture, you can use QEMU sudo apt install binfmt-support qemu-user-staticIf that isn't sufficient to cause docker run --rm --privileged multiarch/qemu-user-static --reset -p yes(If you go the route of using If using For size tests, there's no actual guarantee that data structures will be the same size across different platforms of the same word size, even if they have the same endianness. This can happen across different operating systems on the same architecture, as well as across different architectures on the same operating system, all with the same target word size. I recall that, in our use cases, this rarely happens for 64-bit architectures (even s390x, which is big-endian, didn't fail size tests, back when I was testing on that), but much more often happens on 32-bit architectures. The gitoxide/tests/tools/src/lib.rs Lines 2584 to 2606 in acf906f See #1687, where that was introduced, for further context. Note that I am not advocating that the best way forward is necessarily for the test suite to use The real solution, I think--though I don't know if it's what you'd prefer right now--is to test SHA256 more heavily on CI. If I understand correctly what is happening, a lot of the important tests of SHA256 are currently tested on CI only in the full More broadly, I think that any scenario where fully testing something would be inconvenient for architecture-related reasons is a sign that CI coverage of that architecture should be expanded if feasible. We're already testing substantially on two 32-bit architectures on CI, so expanding that should be feasible. Sometimes adding new tests can slow down CI, which in principle could decrease the velocity at which PRs are integrated. But I think this is more of an issue for Windows--the Windows jobs tend to be the ones that take the longest. Even then, if it's just size tests, then it shouldn't be too bad. (And at least on x86 Windows, you generally can just install and use a 32-bit target on a 64-bit system and building and running work.) |
This is mostly by merit of knowing that either crates don't care about the hash, or they will run their tests under SHA-256 as well. This includes networking. The corresponding plan was generated, and even though it still might contain some valid points, I feel they can only be minor.
|
Thanks a lot Christoph Rüßler (@cruessler), and Eliah Kagan (@EliahKagan) for chiming in! I took the liberty of removing the SHA-256 plan to declare 'done enough', which also means that we could bring it back based on the status quo - the plan in question was fully generated anyway, but by an older model, and not necessarily kept up to date either. The 32bit topic I am also not tackling here, but it's certainly something that could be looked at more particularly once there is issues coming up related to it (and maybe a greater amount of embedded usage). |
<!-- agent --> `ein tool query . trace-path file` failed on SHA-256 repositories because path history rows were decoded as `[u8; 20]`, although SQLite stores the full 32-byte commit IDs. Decode the blob into `Vec<u8>` and use `ObjectId::try_from()` to select the hash kind from its length while rejecting unsupported lengths. Add an isolated journey test for SHA-1 and SHA-256 that checks the traced path, diff statistics, and full commit ID against Git. Assisted-by: GPT 6.0 Astra Co-authored-by: GPT 6.0 Astra <codex@openai.com>
This PR fixes a few minor issues in the CLI related to SHA-256 support.
gix free index. Instead, take it from--object-hash.AsHashKind.Some of them were found by GPT 6.0 when I asked it to trim
etc/plan/sha256-support.mdto only those items that are still left open. This was the list it came up with:This PR addresses the first as well as the last item. Now I’m wondering: do we want to address the two other items as well? I don’t have access to a 32-bit machine, and I don’t know whether I want to spin up a 32-bit VM on my machine just to get the two missing values. 😀 Regarding the query engine, do you want SHA-256 support in it?