dub.sdlsdl · 65 linesall
name "text-conformance"
description "Differential-testing harness cross-checking sparkles.base.text against independent Unicode oracles"
authors "Petar Kirov"
copyright "Copyright © 2026, Petar Kirov"
license "BSL-1.0"

targetType "executable"
targetName "text-conformance"
targetPath "build"
mainSourceFile "src/app.d"

dflags "-preview=in" "-preview=dip1000"

dependency "sparkles:base" path="../../../.."
dependency "sparkles:core-cli" path="../../../.."

// `libs "curl"` lives per-configuration (not at top level) so the offline
// config can build without libcurl — which lets the harness run under a
// `--compiler=dmd` Nix toolchain whose libcurl would otherwise pull a newer
// glibc than the dmd-linked binary. The shared-phobos / gold-linker flags are
// the repo convention for linking against the right glibc in the Nix shell.
configuration "application" {
    targetType "executable"

    libs "curl"

    // Native-library oracles via ImportC bindings. ghostty stays a top-level
    // sparkles lib (used by apps/terminal too); the conformance-only bindings
    // live under bindings/ and are referenced by relative path. Gated behind
    // versions so the offline/unittest configs build without the native deps.
    dependency "sparkles:ghostty" path="../../../.."
    dependency "utf8proc" path="bindings/utf8proc"
    dependency "icu" path="bindings/icu"
    dependency "notcurses" path="bindings/notcurses"
    // Layer 10 embeds Python via PyD. Pinned to the upstream commit that carries
    // the (untagged) D-2.111 compatibility fix (ariovistus/pyd PR #172); the
    // tagged 0.14.5 does not compile with this toolchain.
    dependency "pyd" repository="git+https://github.com/ariovistus/pyd.git" version="bdba4ca50d0329780c5317c1a06f8afd4032535b"
    subConfiguration "pyd" "python311"
    versions "TextConformanceGhostty" "TextConformanceUtf8proc" "TextConformanceIcu" "TextConformanceNotcurses" "TextConformancePython"

    dflags "-defaultlib=libphobos2.so" "-L-fuse-ld=gold" platform="linux-dmd"
}

configuration "offline" {
    targetType "executable"

    versions "TextConformanceNoCurl"

    dflags "-defaultlib=libphobos2.so" "-L-fuse-ld=gold" platform="linux-dmd"
}

configuration "unittest" {
    targetType "library"
    excludedSourceFiles "src/app.d"

    libs "curl"

    dependency "sparkles:test-runner" path="../../../.."

    dflags "-checkaction=context" "-allinst"
    dflags "-defaultlib=libphobos2.so" "-L-fuse-ld=gold" platform="linux-dmd"
    dflags "--link-defaultlib-shared" "--linker=gold" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}