Hi,
I recently had a need to create a tar archive in my zig project.
Looking into std.tar I can see that there doesn’t exist a way to create an archive from the std lib just yet, so I figured that I might try to add that functionality.
I followed the “Building-Zig-on-Windows” wiki entry in language repo and have done roughly the following steps:
Summary
New-Item -Path . -Name "custom-zig" -ItemType Directory
$versionLine = (Invoke-RestMethod "https://raw.githubusercontent.com/ziglang/zig/master/ci/x86_64-windows-debug.ps1") -split "`n" |
Where-Object { $_.StartsWith('$ZIG_LLVM_CLANG_LLD_NAME') }
$version = $versionLine.substring('$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-'.Length).TrimEnd('"')
Invoke-WebRequest "https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-windows-gnu-$version.zip"
Expand-Archive -Path "zig+llvm+lld+clang-x86_64-windows-gnu-$version.zip" -DestinationPath "custom-zig"
Push-Location custom-zig
$devkit = (Get-Item "zig+llvm+lld+clang-x86_64-windows-gnu-$version" |
Select-Object -ExpandProperty FullName) -replace '\\', '/'
git clone https://github.com/ziglang/zig.git
cmake .. -GNinja -DCMAKE_PREFIX_PATH="$devkit" `
-DCMAKE_C_COMPILER="$devkit/bin/zig.exe;cc" `
-DCMAKE_CXX_COMPILER="$devkit/bin/zig.exe;c++" `
-DCMAKE_AR="$devkit/bin/zig.exe" `
-DZIG_AR_WORKAROUND=ON `
-DZIG_STATIC=ON `
-DZIG_USE_LLVM_CONFIG=OFF
ninja install
stage3\bin\zig.exe build test
# After making local changes
stage3/bin/zig build -p stage4 -Denable-llvm -Dno-lib
# Together with
stage4/bin/zig build test-std -Dskip-release -Dtest-filter="my test"
Pop-Location
I added functionality to create a rudimentary ustar tar archive to the std lib and am now wondering if someone would be willing to help me create a patch out of my changes.
I’ve tried to find documentation in the repository on how patches are made and submitted but have not been able to find any.
I don’t really know how to continue and any help would be greatly appreciated!