Skip to content
Karak Studio icon

Desktop · Windows

Karak Studio

Building

  • Rust, installed with rustup, using the GNU toolchain (stable-x86_64-pc-windows-gnu). Visual Studio is not needed.
  • Python 3 with Pillow, only for the icon scripts and the fuzz test.

%USERPROFILE%\.cargo\bin must be on your PATH. A new terminal picks this up after Rust is installed.

From a terminal in G:\KarakStudio:

cargo build --release
copy /y target\release\KarakStudio.exe "dist\Karak Studio.exe"
python set_icon.py "dist\Karak Studio.exe"

build.bat does the same three things.

The icon step must be repeated after every build, because a fresh build has no icon inside the file. The app must be closed while its exe is replaced.

  • Do not run cargo update without a package name. Cargo.lock pins libloading 0.8.5, parking_lot 0.12.3, parking_lot_core 0.9.10, arboard 3.4.1 and webbrowser 1.0.1. Newer versions of these need a tool (dlltool together with an assembler) that this toolchain does not fully provide.
  • .cargo\config.toml contains absolute paths: to the toolchain’s bundled dlltool.exe, and to G:/KarakStudio/linklibs. If the project moves, or Rust is installed for a different user, edit them.
  • linklibs\shlwapi.dll is a copy of the Windows file. The linker reads it to learn the names of its functions. The finished app uses the real one in Windows.
cd practice
cargo build --release
copy /y target\release\*.exe ..\src\practice\

Then rebuild the main app. The practice project uses no standard library, starts at its own start function, and is optimised for size so that loops stay simple to read. core::hint::black_box is used in a few places to stop the compiler from working answers out in advance; without it the lessons disappear from the compiled code.

After changing a practice program, check that its hints and solution in src\practice.rs still describe what the compiler produced. Open the new exe in the app and read the check function.

python make_icon.py sheet icon-options.png draws all options on one sheet
python make_icon.py pick D writes src\icon.rgba and icon.ico

Then rebuild and run set_icon.py.