Replace the MSYS2/UCRT64 toolchain with the portable w64devkit kit: bootstrap a pinned kit, build with its sh/make/gcc, and keep the compiler's temporary files inside work/. Update upstream to 6.1.0 and add a portable-prefix patch: when the configured prefix is gone, csc, csi, chicken, and the chicken-* tools derive include, library, and repository paths from the running executable. A released zip now works wherever it is unpacked, which it did not before. Signed-off-by: Pavel Kulyov <kulyov.pavel@gmail.com>
chicken6-4-win
Chicken (6) 4 Windows 10+.
This repo keeps the MinGW pathes, builds a MinGW-w64 prefix with w64devkit and publishes that prefix as a Gitea release.
Kit
The build uses w64devkit, a portable folder with MinGW-w64 GCC, GNU make, and a POSIX shell.
.\ck.ps1 bootstrap
That downloads one pinned kit archive into work/w64devkit. To use a kit you already unpacked:
$env:W64DEVKIT_ROOT = 'C:\w64devkit'
Nothing is added to the machine PATH; ck.ps1 puts the kit on PATH for each command.
Commands
.\ck.ps1 bootstrap
.\ck.ps1 fetch-sources
.\ck.ps1 patch
.\ck.ps1 build
.\ck.ps1 test
.\ck.ps1 publish
.\ck.ps1 clean
Versions live in chicken.json, the script loads and saves it.
Change upstream.version and clear upstream.sha256; fetch-sources downloads that release and writes the hash back.
.\ck.ps1 fetch-sources -Latest (and publish -Latest) instead takes whatever
https://code.call-cc.org/releases/current/ is serving and overwrites upstream.version and upstream.sha256.
revision is the local serial in the same file. The tag is <version>-win<revision>.
publish runs fetch, patch, build, and test, then uploads work/dist/chicken-<version>-mingw-x86_64.zip.
If that tag already exists, publish stops. Bump revision to ship another build of the same upstream tarball.
clean deletes the sources, prefix, and dist; it keeps the toolchain in work/w64devkit.
Publishing reads GITEA_TOKEN from a gitignored .env in this directory:
GITEA_TOKEN=...
The zip
The release zip is relocatable: unpack it anywhere and run bin\csc.exe.
When the prefix it was configured with is gone, csc, csi, and the chicken-* tools locate
the include, library, and share directories from the running executable.
Compiling with csc still needs a C compiler on PATH: the w64devkit bin directory (it provides cc and gcc).
csc -static links a standalone executable; the default links libchicken.dll, which must sit next to the executable or on PATH.
The two MinGW patches keep MinGW's SEH setjmp off CHICKEN's alloca frames and make the standard
handles inheritable for process. The third makes the installed prefix relocatable.