module Lapis::Docs::B_LAPIS_CLI_AND_TOOLCHAIN::J_COMMON_PITFALLS_AND_FAQ

Overview

Common CLI Pitfalls & Frequently Asked Questions

Comprehensive troubleshooting guide and FAQ addressing common errors encountered during installation, build orchestration, runtime execution, and debugging.

Executive Summary & Key Topics

Topic Method / Anchor Description
Common Failure Categories .topic_00_troubleshooting_categories Overview of file locks, missing dependencies, version mismatches, and path issues.
Error 32: File Sharing Violation .topic_01_win32_error_32 Why Windows locks DLLs and how shadow loading and lapis clean --shadows resolve it.
Missing Runtime DLLs (0xC0000135) .topic_02_missing_dlls Resolving STATUS_DLL_NOT_FOUND when launching standalone games or editor.
Optimizing Compilation Times .topic_03_compilation_times Fast incremental debug builds vs release optimization trade-offs.
Frequently Asked Questions (FAQ) .topic_04_general_faq Common questions about Crystal, Godot, performance, and tooling.

Related Guides & Source References

Defined in:

libgodot/docs/b_lapis_cli_and_toolchain/j_common_pitfalls_and_faq.cr

Class Method Summary

Class Method Detail

def self.topic_00_troubleshooting_categories : Nil #

Common Failure Categories: Overview of file locks, missing dependencies, version mismatches, and path issues.

Key Topics & Information

  • Windows Error 32: File sharing violation (DLL locked by open Godot process)
  • Missing Runtime DLLs: Access violation 0xC0000135 on game startup
  • Compilation Slowness: Using multi-module vs single-module tradeoffs
  • EditorPlugin Not Found: Plugin disabled in project.godot

def self.topic_01_win32_error_32 : Nil #

Error 32: File Sharing Violation: Why Windows locks DLLs and how shadow loading and lapis clean --shadows resolve it.

Symptom:

Error: Cannot write to file 'bin/game.dll': Access is denied (Windows Error 32)

Root Cause:

On Windows, any DLL currently loaded via LoadLibraryA cannot be deleted or overwritten by the compiler. If godot.exe or game.exe is still running, the file is locked.

Solution:

  1. Ensure you run via the loader bridge with shadow loading enabled (default in development).
  2. If a crashed Godot process left a stray file lock, run:
    lapis clean --shadows
  3. If an orphaned Godot process is hanging in Task Manager, terminate it:
    Stop-Process -Name godot -Force

def self.topic_02_missing_dlls : Nil #

Missing Runtime DLLs (0xC0000135): Resolving STATUS_DLL_NOT_FOUND when launching standalone games or editor.

Symptom:

The game executable exits immediately without a window, or Windows shows error 0xC0000135.

Root Cause:

game.exe cannot locate gc.dll, pcre2-8.dll, or libgodot.dll in the same directory or system PATH.

Solution:

Run:

lapis deps

This validates and copies all required platform DLLs into your project bin/ directory.


def self.topic_03_compilation_times : Nil #

Optimizing Compilation Times: Fast incremental debug builds vs release optimization trade-offs.

During active development:

  • DO NOT pass --release on every build. --release invokes LLVM optimization passes (-O3), which can increase build times by 5x to 10x.
  • Use standard lapis build game (incremental compilation).
  • Only pass --release when benchmarking (lapis bench) or packaging for distribution (lapis package game --release).

def self.topic_04_general_faq : Nil #

Frequently Asked Questions (FAQ): Common questions about Crystal, Godot, performance, and tooling.

Frequently Asked Questions (FAQ)

  • Q: Can I use GDScript and Crystal together in the same project? A: Yes! Lapis provides bidirectional interoperability. Crystal nodes are registered in ClassDB and can be instantiated, called, and connected to signals from GDScript, and vice versa.

  • Q: Does Lapis require Godot source compilation? A: No. Lapis uses the official precompiled Godot Engine binary via GDExtension and LibGodot dynamic linking.

  • Q: How fast is Crystal compared to GDScript in Godot? A: In mathematical transforms, node lifecycle churn, and physics calculations, Crystal is typically 20x to 100x faster than GDScript, matching C++ speed with expressive Ruby-like syntax.

  • Q: What happens if a node is deleted in GDScript while Crystal holds a reference? A: Lapis features dead-pointer protection. Crystal wrappers track Godot ObjectDB instance IDs and automatically raise Godot::DisposedObjectError rather than crashing with a segmentation fault.