Klammertext runs natively on Windows; a Windows source-install guide; the bundled sh for @eval :shell
Assembled from klammertext-dev f344a37d772c. The commands, the library,
the Standard Klammer Set, the reflection klammerset and the Python
binding build and run natively on Windows (MSYS2 UCRT64 gcc, python.org
Python), and both test tiers pass there. doc/install/windows_source_install.md
is the fifth install guide: a source install parallel to the Linux and
macOS ones, verified by following it on a pristine Windows 11.
Behaviour on every system: paths Klammertext prints use forward slashes;
output is LF; the command line is UTF-8 on Windows; @eval :shell is a
POSIX shell command everywhere -- on Windows it runs the sh Klammertext
ships, BusyBox for Windows (win/busybox/, GPLv2, with its licence and the
source pointer). KLAMMERTEXT_FONTS and KLAMMERTEXT_KLAMMERSETS are lists in
the system's PATH convention (';' on Windows). On Linux and macOS nothing
observable changes.
This commit is contained in:
1 parent
f9af1ff869
commit
830b19394d
55 files changed
+1182
-153
No files matched your search
+11
-8
@@ -39,12 +39,15 @@ green=$'\033[32m'
|
||||
bold=$'\033[1m'
|
||||
reset=$'\033[0m'
|
||||
|
||||
OUTF=$(mktemp /tmp/kpy_out.XXXXXX)
|
||||
ERRF=$(mktemp /tmp/kpy_err.XXXXXX)
|
||||
WORK=$(mktemp -d /tmp/kpy_work.XXXXXX)
|
||||
OUTF=$(mktemp "${TMPDIR:-/tmp}"/kpy_out.XXXXXX)
|
||||
ERRF=$(mktemp "${TMPDIR:-/tmp}"/kpy_err.XXXXXX)
|
||||
WORK=$(mktemp -d "${TMPDIR:-/tmp}"/kpy_work.XXXXXX)
|
||||
trap 'rm -rf "$OUTF" "$ERRF" "$WORK"' EXIT
|
||||
|
||||
export PYTHONPATH="$K/kpy${PYTHONPATH:+:$PYTHONPATH}"
|
||||
# Python splits PYTHONPATH on the system's list separator: ':' on Linux and
|
||||
# macOS, ';' on Windows (an MSYS2 shell runs a native python.org Python).
|
||||
if command -v cygpath >/dev/null 2>&1; then sep=';'; else sep=':'; fi
|
||||
export PYTHONPATH="$K/kpy${PYTHONPATH:+$sep$PYTHONPATH}"
|
||||
|
||||
# A DEBUG=1 build instruments the module with AddressSanitizer, and an
|
||||
# instrumented extension imported into an uninstrumented python needs the
|
||||
@@ -57,9 +60,9 @@ export PYTHONPATH="$K/kpy${PYTHONPATH:+:$PYTHONPATH}"
|
||||
# the engine throws dies with "CHECK failed: asan_interceptors.cpp ...
|
||||
# real___cxa_throw != 0" (every error case of this suite, 2026-09-08).
|
||||
# Linux only (LD_PRELOAD); macOS ASan runs are not supported here.
|
||||
MODULE=$(ls "$K"/kpy/klammertext.*.so 2>/dev/null | head -1)
|
||||
MODULE=$(ls "$K"/kpy/klammertext.*.so "$K"/kpy/klammertext.*.pyd 2>/dev/null | head -1)
|
||||
if [ -z "$MODULE" ]; then
|
||||
echo "${red}FAIL${reset} kpy/ is not built (no kpy/klammertext.*.so)"
|
||||
echo "${red}FAIL${reset} kpy/ is not built (no kpy/klammertext.*.so or .pyd)"
|
||||
exit 1
|
||||
fi
|
||||
if nm -D "$MODULE" 2>/dev/null | grep -q '__asan_init'; then
|
||||
@@ -200,7 +203,7 @@ import os, klammertext as kt
|
||||
M = kt.Machine(klammersets="none", target="txt", files=["doc.kt"])
|
||||
M.read_files()
|
||||
out = M.output_filename
|
||||
print("files", M.apply(), "|", os.path.basename(out), "|", os.path.dirname(out) == os.getcwd())
|
||||
print("files", M.apply(), "|", os.path.basename(out), "|", os.path.normpath(os.path.dirname(out)) == os.getcwd())
|
||||
EOF
|
||||
expect " 7. files= and read_files(); output_filename beside the input" 'files hello from a file \| doc.txt \| True'
|
||||
|
||||
@@ -219,7 +222,7 @@ import os, klammertext as kt
|
||||
M = kt.Machine(klammersets="none", target="txt", files=["doc.kt"], output="out/renamed")
|
||||
M.read_file("doc.kt")
|
||||
M.apply()
|
||||
print("output", os.path.relpath(M.write()), os.path.exists("out/renamed.txt"))
|
||||
print("output", os.path.relpath(M.write()).replace(os.sep, "/"), os.path.exists("out/renamed.txt"))
|
||||
EOF
|
||||
expect " 9. output= is -o: directory plus basename" 'output out/renamed.txt True'
|
||||
|
||||
|
||||
Reference in new issue
Block a user