✓
Passing This code compiles and runs correctly.
Code
import std/build
import std/io
std/build:app { name: "Regtest App", id: "org.koru.regtest.bundle", version: "0.2" }
std/io:print.ln("bundled input")
Supporting Files
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundleIdentifier</key><string>org.koru.regtest.bundle</string><key>CFBundleName</key><string>Regtest App</string><key>CFBundleDisplayName</key><string>Regtest App</string><key>CFBundleExecutable</key><string>Regtest App</string><key>CFBundlePackageType</key><string>APPL</string><key>NSPrincipalClass</key><string>NSApplication</string><key>LSMinimumSystemVersion</key><string>10.13</string><key>CFBundleShortVersionString</key><string>0.2</string><key>CFBundleVersion</key><string>0.2</string></dict></plist>APPL????<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
Actual
bundled input
Expected output
bundled input
Flows
flow ~app click a branch to expand · @labels scroll to their anchor
app (source: name: "Regtest App", id: "org.koru.regtest.bundle", version: "0.2")
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "bundled input")
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# koru bundle must assemble a real .app from std/build:app — directory
# layout, on-disk Info.plist, executable bit, and a signature whose
# embedded __TEXT,__info_plist agrees with the disk plist.
set -u
APP="Regtest App.app"
rm -rf "$APP"
if ! koruc bundle "$KORU_INPUT" > bundle.log 2>&1; then
echo "FAIL: koruc bundle refused"
cat bundle.log
exit 1
fi
fail() { echo "FAIL: $1"; exit 1; }
[ -d "$APP/Contents/MacOS" ] || fail "no Contents/MacOS"
[ -d "$APP/Contents/Resources" ] || fail "no Contents/Resources"
[ -f "$APP/Contents/Info.plist" ] || fail "no Info.plist"
[ -f "$APP/Contents/PkgInfo" ] || fail "no PkgInfo"
[ "$(cat "$APP/Contents/PkgInfo")" = "APPL????" ] || fail "PkgInfo is not APPL????"
[ -x "$APP/Contents/MacOS/Regtest App" ] || fail "no executable Contents/MacOS/Regtest App"
plutil -lint "$APP/Contents/Info.plist" | grep -q "OK" || fail "Info.plist does not lint"
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$APP/Contents/Info.plist")" = "org.koru.regtest.bundle" ] \
|| fail "CFBundleIdentifier mismatch"
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info.plist")" = "Regtest App" ] \
|| fail "CFBundleExecutable mismatch"
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$APP/Contents/Info.plist")" = "0.2" ] \
|| fail "version mismatch"
codesign --verify "$APP" 2> codesign.err || { cat codesign.err; fail "bundle does not verify"; }
echo "PASS: Regtest App.app — layout, plist, executable, signature all verify"
exit 0