Zig Version
0.17.0-dev.607+456b2ec07
Steps to Reproduce, Observed Behavior, and Expected Behavior
I was trying to download MPICH with Zig, and they ship a tarball at their downloads page.
Reproduce & Observe
Running zig fetch --save https://www.mpich.org/static/downloads/5.0.1/mpich-5.0.1.tar.gz yields:
error: unable to unpack tarball
note: unable to create file 'man/man3/MPI_Offset.3': PathAlreadyExists
note: unable to create file 'man/man3/MPI_AINT.3': PathAlreadyExists
note: unable to create file 'man/man3/MPI_Count.3': PathAlreadyExists
Manually inspecting the tarball via tar -tf mpich-5.0.1.tar.gz | grep -i "mpi_offset" yields:
mpich-5.0.1/man/man3/MPI_OFFSET.3
mpich-5.0.1/man/man3/MPI_Offset.3
So there are two files with different capitalizations, and since apfs is case-insensitive, it fails to unpack (file already exists on the createDirAndFile call (tar.zig:622)).
Expected behavior
Using the builtin macos tar utility, the file decompresses silently with the "MPI_Offet.3" file, so likely the last entry in the archive overwrites earlier ones. In fact, tar is perfectly happy overwriting whole directories.
It would be nice if zig fetch worked just like wget + tar does on mac, so I propose adding an exclusive: bool = false field to the ExtactOptions struct and have Fetch.zig set that to true.
Open question: what is the default behavior of tar on Linux?
If that seems like a good course of action I can make a PR.
### Zig Version
0.17.0-dev.607+456b2ec07
### Steps to Reproduce, Observed Behavior, and Expected Behavior
I was trying to download MPICH with Zig, and they ship a tarball at [their downloads page](https://www.mpich.org/downloads/).
### Reproduce & Observe
Running `zig fetch --save https://www.mpich.org/static/downloads/5.0.1/mpich-5.0.1.tar.gz` yields:
```
error: unable to unpack tarball
note: unable to create file 'man/man3/MPI_Offset.3': PathAlreadyExists
note: unable to create file 'man/man3/MPI_AINT.3': PathAlreadyExists
note: unable to create file 'man/man3/MPI_Count.3': PathAlreadyExists
```
Manually inspecting the tarball via `tar -tf mpich-5.0.1.tar.gz | grep -i "mpi_offset"` yields:
```
mpich-5.0.1/man/man3/MPI_OFFSET.3
mpich-5.0.1/man/man3/MPI_Offset.3
```
So there are two files with different capitalizations, and since apfs is case-insensitive, it fails to unpack (file already exists on the `createDirAndFile` call (tar.zig:622)).
### Expected behavior
Using the builtin macos `tar` utility, the file decompresses silently with the "MPI_Offet.3" file, so likely the last entry in the archive overwrites earlier ones. In fact, tar is perfectly happy overwriting whole directories.
It would be nice if `zig fetch` worked just like `wget` + `tar` does on mac, so I propose adding an `exclusive: bool = false` field to the ExtactOptions struct and have Fetch.zig set that to true.
Open question: what is the default behavior of tar on Linux?
If that seems like a good course of action I can make a PR.