remove contrib/ (#4)
dead code; our release and testing processes changed quite a bit.
This commit is contained in:
parent
af9360366b
commit
3f4b4ef88e
@ -1,33 +0,0 @@
|
||||
Patched Zig release
|
||||
-------------------
|
||||
|
||||
This file explains how this zig version was created. As of first writing,
|
||||
0.10.0-dev.4301+uber1 + https://github.com/ziglang/zig-bootstrap/pull/131
|
||||
|
||||
Steps to re-create a patched zig:
|
||||
|
||||
```
|
||||
$ wget https://github.com/ziglang/zig/pull/13051.patch
|
||||
$ git clone https://github.com/ziglang/zig-bootstrap; cd zig-bootstrap
|
||||
|
||||
# if https://github.com/ziglang/zig-bootstrap/pull/131 is not merged: patch it.
|
||||
|
||||
$ git am --directory=zig ../13051.patch
|
||||
|
||||
$ ${EDITOR:-vi} build # replace the hash with "+uber1" and bump the last number in ZIG_VERSION
|
||||
|
||||
$ ./build-and-archive
|
||||
```
|
||||
|
||||
Recent zig-bootstrap versions require cmake >= 3.19, which is available from
|
||||
ubuntu 22.04 (jammy) or debian 12 (bookworm). Otherwise CMAKE will unable to
|
||||
"Find the C compiler". A workaround:
|
||||
|
||||
docker run --privileged -v `pwd`:/x -w /x -ti --rm buildpack-deps:bookworm \
|
||||
sh -c 'apt-get update && apt-get install -y cmake && exec ./build-and-archive'
|
||||
|
||||
(`--privileged` is necessary because of devpod nuances. You can skip it if you
|
||||
don't know what is a devpod.)
|
||||
|
||||
`build-and-archive`, this file and 13051.patch should be in the archive where
|
||||
you got your patched zig.
|
@ -1,57 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -xeuo pipefail
|
||||
|
||||
zig_version=$(awk -F'"' '/^ZIG_VERSION=/{print $2}' build)
|
||||
|
||||
./build -j"$(nproc)" x86_64-linux-musl baseline
|
||||
./build -j"$(nproc)" x86_64-macos-none baseline
|
||||
./build -j"$(nproc)" aarch64-linux-musl baseline
|
||||
./build -j"$(nproc)" aarch64-macos-none apple_a14
|
||||
./build -j"$(nproc)" x86_64-windows-gnu baseline
|
||||
|
||||
rm -fr zig-linux-x86_64-"${zig_version}"
|
||||
rm -fr zig-macos-x86_64-"${zig_version}"
|
||||
rm -fr zig-linux-aarch64-"${zig_version}"
|
||||
rm -fr zig-macos-aarch64-"${zig_version}"
|
||||
rm -fr zig-windows-x86_64-"${zig_version}"
|
||||
|
||||
cp -r out/zig-x86_64-linux-musl-baseline zig-linux-x86_64-"${zig_version}"
|
||||
cp -r out/zig-x86_64-macos-none-baseline zig-macos-x86_64-"${zig_version}"
|
||||
cp -r out/zig-aarch64-linux-musl-baseline zig-linux-aarch64-"${zig_version}"
|
||||
cp -r out/zig-aarch64-macos-none-apple_a14 zig-macos-aarch64-"${zig_version}"
|
||||
cp -r out/zig-x86_64-windows-gnu-baseline zig-windows-x86_64-"${zig_version}"
|
||||
|
||||
for os_arch in linux-{x86_64,aarch64} macos-{x86_64,aarch64} windows-x86_64; do
|
||||
if [[ $os_arch == windows-x86_64 ]]; then
|
||||
zig=zig.exe
|
||||
else
|
||||
zig=zig
|
||||
fi
|
||||
mv zig-${os_arch}-"${zig_version}"/{bin/${zig},}
|
||||
rmdir zig-${os_arch}-"${zig_version}"/bin
|
||||
|
||||
# copy some clarifying files for future readers
|
||||
mkdir zig-${os_arch}-"${zig_version}"/patches
|
||||
cp README-patched.md zig-${os_arch}-"${zig_version}"/patches/README.md
|
||||
cp 13051.patch "$0" zig-${os_arch}-"${zig_version}"/patches/
|
||||
done
|
||||
|
||||
# linux-x86_64, windows-x86_64 and macos-aarch64 have libs in lib/, rather than
|
||||
# in lib/zig/.
|
||||
for os_arch in linux-x86_64 windows-x86_64 macos-aarch64; do
|
||||
mv zig-${os_arch}-"${zig_version}"/{lib,lib2}
|
||||
mv zig-${os_arch}-"${zig_version}"/{lib2/zig,lib}
|
||||
rmdir zig-${os_arch}-"${zig_version}"/lib2
|
||||
done
|
||||
|
||||
tar cJf zig-linux-x86_64-"${zig_version}".tar.xz zig-linux-x86_64-"${zig_version}"/ &
|
||||
tar cJf zig-macos-x86_64-"${zig_version}".tar.xz zig-macos-x86_64-"${zig_version}"/ &
|
||||
tar cJf zig-linux-aarch64-"${zig_version}".tar.xz zig-linux-aarch64-"${zig_version}"/ &
|
||||
tar cJf zig-macos-aarch64-"${zig_version}".tar.xz zig-macos-aarch64-"${zig_version}"/ &
|
||||
|
||||
# 7z is the quickest, so blocking on it first. Then wait for tars to complete.
|
||||
7z a zig-windows-x86_64-"${zig_version}".zip zig-windows-x86_64-"${zig_version}"/
|
||||
wait %1 %2 %3 %4
|
||||
|
||||
sha256sum ./*.tar.xz ./*.zip
|
||||
ls -l ./*.tar.xz ./*.zip
|
@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
zigdir=out/zig-x86_64-linux-musl-x86_64_v3
|
||||
|
||||
if [[ ! "$PWD" =~ /zig-bootstrap$ ]]; then
|
||||
>&2 echo "expected to be in zig-bootstrap directory. Bailing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -f "$zigdir/bin/zig" ]]; then
|
||||
>&2 echo "$zigdir/bin/zig not found. Please run:"
|
||||
>&2 echo " ./build -j\$(nproc) x86_64-linux-musl x86_64_v3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd "$zigdir"
|
||||
vsn=$(bin/zig version)
|
||||
outdir="zig-linux-x86_64-$vsn"
|
||||
mkdir -p "$outdir"
|
||||
cp -r "bin/zig" "$outdir"
|
||||
cp -r "lib/zig" "$outdir/lib"
|
||||
tar -cf "$outdir.tar" "$outdir"
|
||||
xz -vk -9 -T0 "$outdir.tar"
|
||||
popd
|
||||
|
||||
echo "$zigdir/$outdir.tar.xz is ready for use"
|
@ -1,39 +0,0 @@
|
||||
How to test a different version of zig
|
||||
--------------------------------------
|
||||
|
||||
Assume you want to test an unreleased version of zig. Here's how:
|
||||
|
||||
1. Clone zig-bootstrap:
|
||||
|
||||
$ git clone https://github.com/ziglang/zig-bootstrap
|
||||
$ cd zig-bootstrap
|
||||
|
||||
2. Copy over zig/ from ~/zig:
|
||||
|
||||
$ rm -fr zig
|
||||
$ git -C ~/zig archive --format=tar --prefix=zig/ master | tar -xv
|
||||
|
||||
3. Build it (assuming `x86_64-linux`):
|
||||
|
||||
$ vim build # edit ZIG_VERSION
|
||||
$ ./build -j$(nproc) x86_64-linux-musl baseline
|
||||
|
||||
4. Pack the release tarball:
|
||||
|
||||
$ ~/code/bazel-zig-cc/makerel
|
||||
|
||||
This gives us a usable Zig SDK. Now:
|
||||
|
||||
- Send the .tar.xz it to your mirror.
|
||||
- Point toolchain/defs.bzl to the new version.
|
||||
- Run tests.
|
||||
|
||||
Links
|
||||
-----
|
||||
|
||||
- [ziglang/release-cutter][1], a script that creates binaries for [ziglang.org/download][2].
|
||||
- [ziglang/zig-bootstrap][3], a set of scripts that compile a static Zig.
|
||||
|
||||
[1]: https://github.com/ziglang/release-cutter/blob/master/script
|
||||
[2]: https://ziglang.org/download
|
||||
[3]: https://github.com/ziglang/zig-bootstrap
|
Loading…
Reference in New Issue
Block a user