Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3b6e26d
Render Markdown task checkboxes and enable missing-glyph fallback
elcritch Oct 18, 2026
986c49b
Resolve packaged Windows text DLL names from installed artifacts
elcritch Oct 18, 2026
b507171
Document HarfBuzz backend selection and fallback activation
elcritch Oct 18, 2026
10802ff
Build Windows Kosmo with MSVC and fix HarfBuzz CI checks
elcritch Oct 18, 2026
edf4cf7
Pin corrected MSVC atomics and validate native worker ownership
elcritch Oct 18, 2026
ed9ae2e
Install pinned MSVC stdlib fix with official Nim binary
elcritch Oct 18, 2026
7640f99
Pin MSVC-compatible shader embedding and verify Windows startup
elcritch Oct 18, 2026
10669d2
Build pinned Nim once for MSVC atomics and large embedded strings
elcritch Oct 18, 2026
a57d231
Compile the Nim icon resource for the private MSVC build
elcritch Oct 18, 2026
1fbac83
Retain existing FigDraw dependency with the general MSVC compiler fix
elcritch Oct 18, 2026
24936f8
Pin Sigils 0.32 with the standalone MSVC safety guard
elcritch Oct 18, 2026
ebd338c
Invoke configured MSVC directly to preserve linker response files
elcritch Oct 18, 2026
d40fcc8
Require the released Sigils 0.32.0 package
elcritch Oct 18, 2026
6416bb0
Prepare 0.28.0 and fix locally signed Kosmo startup
elcritch Oct 19, 2026
8bd038c
Statically link both text libraries in local Kosmo installs
elcritch Oct 19, 2026
eaa3492
Keep cached local builds on the macOS deployment target
elcritch Oct 19, 2026
2925305
Rebuild cached native objects during local installation
elcritch Oct 19, 2026
79c496c
Update Harfbuzzy pin for MSVC static archive naming
elcritch Oct 19, 2026
8ddc74a
Allow optimized MSVC release builds to finish
elcritch Oct 19, 2026
f9e9d5b
Publish hook fixture readiness atomically
elcritch Oct 19, 2026
fd4116c
Pin Harfbuzzy 0.3.0 and the Windows-compatible raster dependency
elcritch Oct 19, 2026
b93cab7
Use released Harfbuzzy 0.3.0
elcritch Oct 19, 2026
6319b5a
Pin FigDraw 0.45.0
elcritch Oct 19, 2026
3e1e312
Retry Windows compiler promotion after transient file locks
elcritch Oct 19, 2026
5acad9b
Use released FigDraw 0.45.0 dependency
elcritch Oct 19, 2026
9b86a3a
Document development control and live screenshots for agents
elcritch Oct 19, 2026
5334031
Note background app presentation without taking focus
elcritch Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/lsan.supp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
leak:drawing::defaultFont
leak:imgutils::retainFontRefId
leak:typefaces::registerTypeface
# The HarfBuzz backend also retains parsed faces in an ARC/ORC threadvar table.
leak:harfbuzzy::initHarfbuzzTypeface
leak:libfontconfig.so
leak:outputs::memoryOutput
leak:times::newTimezone
Expand Down
115 changes: 115 additions & 0 deletions .github/scripts/install-msvc-nim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/usr/bin/env bash

set -euo pipefail

# Start with the complete official distribution, verify both pinned fixes, then
# compile the corrected compiler once. No Git clone or csources build is needed.
nimMsvcRevision=705392dc03a3f8233f5f0f048acaa9b5267576f6
nimMsvcAtomicsChecksum=2d9c6b381ad09b09b64d29f2af5a6da693c7835d574075e238a8d8c4370ef05a
nimMsvcCompilerChecksum=22e3011e65906288373fc991d2abc9a06e6ebd348c7682f162a14f21b047451b
projectRoot="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$projectRoot"
nimMsvcDir="$projectRoot/deps/nim-msvc-2.2.10-705392dc"
atomicsPath=lib/pure/concurrency/atomics.nim
compilerPath=compiler/ccgliterals.nim
stageDir=
probeDir=
nimMsvcCandidate="$nimMsvcDir"

cleanup() {
if [[ -n "$stageDir" ]]; then rm -rf "$stageDir"; fi
if [[ -n "$probeDir" ]]; then rm -rf "$probeDir"; fi
}
trap cleanup EXIT

verifyFile() {
[[ -f "$1" ]] && [[ "$(sha256sum "$1" | cut -d ' ' -f 1)" == "$2" ]]
}

fetchPatch() {
local relativePath="$1" expectedChecksum="$2"
curl --fail --location --retry 3 \
"https://raw.githubusercontent.com/elcritch/Nim/$nimMsvcRevision/$relativePath" \
--output "$stageDir/$relativePath"
if ! verifyFile "$stageDir/$relativePath" "$expectedChecksum"; then
echo "The pinned $relativePath checksum does not match." >&2
exit 1
fi
}

if [[ ! -e "$nimMsvcDir" ]]; then
atlas env 2.2.10 --binary
stageDir="$(mktemp -d "$projectRoot/deps/.nim-msvc-XXXXXX")"
cp -R "$projectRoot/deps/nim-2.2.10/." "$stageDir/"
fetchPatch "$atomicsPath" "$nimMsvcAtomicsChecksum"
fetchPatch "$compilerPath" "$nimMsvcCompilerChecksum"
# Binary distributions omit the prebuilt MSVC resource used by compiler/nim.nim.
(
cd "$stageDir/icons"
MSYS2_ARG_CONV_EXCL='*' rc.exe /nologo /fo nim-amd64-windows-vcc.res nim.rc
)
stageWindows="$(cygpath -m "$stageDir")"
# Keep compiler/nim.cfg (booting/nimcore), but skip Merenda's parent config.
"$projectRoot/deps/nim-2.2.10/bin/nim.exe" c --cc:vcc -d:release --mm:orc \
--vcc.exe:cl.exe --vcc.linkerexe:cl.exe \
--skipUserCfg:on --skipParentCfg:on --lib:"$stageWindows/lib" \
--out:"$stageWindows/bin/nim.exe" "$stageDir/compiler/nim.nim"
# Atlas activation scripts contain the original installation's absolute path.
# Use the private compiler path printed below instead.
rm -f "$stageDir/activate.bat" "$stageDir/activate.ps1" "$stageDir/activate.sh"
nimMsvcCandidate="$stageDir"
fi

if [[ ! -f "$nimMsvcCandidate/bin/nim.exe" ]] ||
! verifyFile "$nimMsvcCandidate/$atomicsPath" "$nimMsvcAtomicsChecksum" ||
! verifyFile "$nimMsvcCandidate/$compilerPath" "$nimMsvcCompilerChecksum"; then
echo "Incomplete MSVC Nim environment: remove $nimMsvcDir and retry." >&2
exit 1
fi

# Use the compiler's default library lookup, including on cached installations.
probeDir="$(mktemp -d "$projectRoot/deps/.msvc-atomics-probe-XXXXXX")"
probeFile="$probeDir/msvc_atomics_probe.nim"
cat > "$probeFile" <<'NIM'
import std/atomics
static:
doAssert declared(nimHasCorrectMsvcAtomics)
const binary = block:
var data = newString(20_000)
for i in 0 ..< data.len:
data[i] = char(i mod 256)
data
var value = binary
let original = value
for i, c in value:
doAssert c == char(i mod 256)
value[0] = 'x'
doAssert original[0] == '\0'
NIM
"$nimMsvcCandidate/bin/nim.exe" c -r --cc:vcc --mm:arc \
--vcc.exe:cl.exe --vcc.linkerexe:cl.exe \
--skipUserCfg:on --skipParentCfg:on --skipProjCfg:on \
--out:"$(cygpath -m "$probeDir")/msvc_probe.exe" "$probeFile"

if [[ -n "$stageDir" ]]; then
# Windows may briefly retain a file lock after the compiler/probe exits.
for moveAttempt in {1..20}; do
# Do not nest the staged compiler if the destination unexpectedly exists.
if mv -T "$stageDir" "$nimMsvcDir"; then
stageDir=
break
fi
if ((moveAttempt == 20)); then
echo "Cannot install the MSVC Nim environment at $nimMsvcDir." >&2
exit 1
fi
sleep 0.5
done
fi

if [[ -n "${GITHUB_PATH:-}" ]]; then
cygpath -w "$nimMsvcDir/bin" >> "$GITHUB_PATH"
fi

nimMsvcCompilerWindows="$(cygpath -w "$nimMsvcDir/bin/nim.exe")"
echo "Patched MSVC compiler: $nimMsvcCompilerWindows"
56 changes: 53 additions & 3 deletions .github/workflows/build-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
tests:
name: tests (${{ matrix.os }}, ${{ matrix.nimversion }}, ${{ matrix.display }})
runs-on: ${{ matrix.os }}
timeout-minutes: 40
# Full GUI and integration coverage can take nearly 40 minutes on macOS.
timeout-minutes: 60
env:
ATLAS_TEST_NIM_ARGS: ${{ matrix.nimargs }}
defaults:
Expand Down Expand Up @@ -58,6 +59,10 @@ jobs:
- name: Check shared test runner coverage
run: nim e --skipParentCfg:on --skipProjCfg:on .github/scripts/check_test_imports.nims

- name: Install macOS text rendering libraries
if: runner.os == 'macOS'
run: brew install harfbuzz fribidi

- name: Setup software OpenGL (Mesa)
if: runner.os == 'Windows'
uses: ssciwr/setup-mesa-dist-win@v3.0.0
Expand Down Expand Up @@ -87,6 +92,8 @@ jobs:
libgl1-mesa-dev \
libgles2-mesa-dev \
libegl1-mesa-dev \
libharfbuzz-dev \
libfribidi-dev \
mesa-utils \
vulkan-tools \
mesa-vulkan-drivers \
Expand Down Expand Up @@ -260,6 +267,8 @@ jobs:
libgl1-mesa-dev \
libgles2-mesa-dev \
libegl1-mesa-dev \
libharfbuzz-dev \
libfribidi-dev \
mesa-utils \
vulkan-tools \
mesa-vulkan-drivers \
Expand Down Expand Up @@ -308,6 +317,30 @@ jobs:
steps:
- uses: actions/checkout@v5

- name: Configure MSVC for x64
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Install macOS text rendering libraries
if: runner.os == 'macOS'
run: brew install harfbuzz fribidi

- name: Install Linux text rendering libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libharfbuzz-dev libfribidi-dev

- name: Install Windows text rendering headers
if: runner.os == 'Windows'
shell: pwsh
run: |
& "$env:VCPKG_INSTALLATION_ROOT/vcpkg.exe" install harfbuzz:x64-windows
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
"INCLUDE=$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows/include/harfbuzz;$env:INCLUDE" >> $env:GITHUB_ENV

- name: Cache packages
uses: actions/cache@v4
with:
Expand All @@ -317,9 +350,18 @@ jobs:
- name: Install latest Atlas and set up Nim
run: |
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
if [[ "$RUNNER_OS" == "Windows" ]]; then
cygpath -w "$HOME/.local/bin" >> "$GITHUB_PATH"
else
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
fi
export PATH="$HOME/.local/bin:$PATH"
bash .github/scripts/install-atlas.sh
"$HOME/.local/bin/atlas" env "${{ matrix.nimversion }}" --binary --github-path
if [[ "$RUNNER_OS" == "Windows" ]]; then
bash .github/scripts/install-msvc-nim.sh
else
"$HOME/.local/bin/atlas" env "${{ matrix.nimversion }}" --binary --github-path
fi

- name: Verify Nim
run: |
Expand All @@ -340,5 +382,13 @@ jobs:
run: bash .github/scripts/clean_generated_examples.sh

- name: Compile Examples
if: runner.os != 'Windows'
run: |
atlas-run tests --jobs:2 --compile-only --only-errors "examples/all_compile.nim"

- name: Compile Windows Examples with MSVC
if: runner.os == 'Windows'
shell: pwsh
run: |
atlas-run tests --jobs:2 --compile-only --only-errors "examples/all_compile.nim" -- --cc:vcc --passC:/MT
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Loading
Loading